Skip to content

fix(#72, #101): sidebar default-open + search, API call standardization#118

Open
nv78 wants to merge 1 commit intoclaude/add-multimodal-support-QBQcafrom
claude/sidebar-api-improvements
Open

fix(#72, #101): sidebar default-open + search, API call standardization#118
nv78 wants to merge 1 commit intoclaude/add-multimodal-support-QBQcafrom
claude/sidebar-api-improvements

Conversation

@nv78
Copy link
Member

@nv78 nv78 commented Mar 24, 2026

Fixes #72 — Sidebar

Root cause: Sidebar defaulted to isSidebarCollapsed = true unconditionally — users never saw their chat history unless they discovered the toggle.

Changes:

  • Default: expanded on desktop (window.innerWidth >= 768), collapsed on mobile
  • Search bar appears in the sidebar when the user has >3 chats — filter by name in real time
  • Loading skeleton (4 animated grey bars) shows while chats are being fetched on first load, preventing layout jump
  • Empty/no-results states for both "no chats yet" and "no search matches"

Fixes #101 — API call standardization

Root cause: useChatHistory used verbose fetcher(url, {method, headers, body, ...}) calls; Home.js had 25 lines of inline fetcher logic for creating a chat; the post() shorthand from RequestConfig.js existed but wasn't used in hooks.

Changes:

  • useChatHistory.js: switched all calls to post() from RequestConfig.js — one import, one pattern
  • useChatHistory.js: added createChat({ chatType, modelType }) — chat creation now lives in the data hook, not the component
  • useChatHistory.js: exposed loading boolean from refreshChats for the skeleton
  • Home.js: createNewChat() reduced from ~25 lines to 10 by delegating to createChat()
  • Home.js: removed now-unused fetcher import

Test plan

  • On desktop: open the app → sidebar is visible and expanded by default
  • On mobile (< 768px): sidebar starts collapsed, toggle shows it
  • Create >3 chats → search bar appears; type a name → list filters live
  • Delete a chat → it disappears immediately from sidebar (optimistic update)
  • Rename a chat → name updates in sidebar without page reload
  • Fresh load → skeleton shows briefly, then chats populate

https://claude.ai/code/session_01C9mHttiQ4ZAaBbQecVV7uu

…; 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants