fix(#72, #101): sidebar default-open + search, API call standardization#118
Open
nv78 wants to merge 1 commit intoclaude/add-multimodal-support-QBQcafrom
Open
fix(#72, #101): sidebar default-open + search, API call standardization#118nv78 wants to merge 1 commit intoclaude/add-multimodal-support-QBQcafrom
nv78 wants to merge 1 commit intoclaude/add-multimodal-support-QBQcafrom
Conversation
…; API standardization Issue #72 — Sidebar: - Sidebar now defaults to expanded on desktop (md+), collapsed only on mobile (was always collapsed, hiding chat history from users) - ChatHistory: search/filter bar appears when there are >3 chats - ChatHistory: animated loading skeleton while chats are being fetched - ChatHistory: "no results" state for empty search - Sidebar passes chatsLoading prop through to ChatHistory Issue #101 — API call standardization: - useChatHistory.js: switched from verbose fetcher({method, headers, body}) to the post() shorthand from RequestConfig — one consistent pattern - useChatHistory.js: added loading state (prevents double-fetch flash) - useChatHistory.js: added createChat() — moves chat creation out of Home.js into the dedicated data hook (single responsibility) - Home.js: createNewChat() is now a thin wrapper over createChat() (removed ~20 lines of inline fetch logic) - Home.js: removed unused fetcher import (now handled by hook) https://claude.ai/code/session_01C9mHttiQ4ZAaBbQecVV7uu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #72 — Sidebar
Root cause: Sidebar defaulted to
isSidebarCollapsed = trueunconditionally — users never saw their chat history unless they discovered the toggle.Changes:
window.innerWidth >= 768), collapsed on mobileFixes #101 — API call standardization
Root cause:
useChatHistoryused verbosefetcher(url, {method, headers, body, ...})calls;Home.jshad 25 lines of inlinefetcherlogic for creating a chat; thepost()shorthand fromRequestConfig.jsexisted but wasn't used in hooks.Changes:
useChatHistory.js: switched all calls topost()fromRequestConfig.js— one import, one patternuseChatHistory.js: addedcreateChat({ chatType, modelType })— chat creation now lives in the data hook, not the componentuseChatHistory.js: exposedloadingboolean fromrefreshChatsfor the skeletonHome.js:createNewChat()reduced from ~25 lines to 10 by delegating tocreateChat()Home.js: removed now-unusedfetcherimportTest plan
https://claude.ai/code/session_01C9mHttiQ4ZAaBbQecVV7uu