Skip to content

feat: add sidebar conversation filter#59

Merged
shirshanka merged 1 commit into
datahub-project:mainfrom
shawnxiao105-afk:feat/sidebar-filter
May 25, 2026
Merged

feat: add sidebar conversation filter#59
shirshanka merged 1 commit into
datahub-project:mainfrom
shawnxiao105-afk:feat/sidebar-filter

Conversation

@shawnxiao105-afk
Copy link
Copy Markdown
Contributor

Summary

Closes #35. Adds a text filter above the conversation list in the sidebar — type to narrow the list by title (case-insensitive substring match).

Per the issue's stretch goal, the filter clears automatically when a new conversation is started.

What changes

Single component (frontend/src/components/Sidebar/Sidebar.tsx):

  • Local useState for the filter string (kept out of Zustand — sidebar is the only consumer)
  • <input> with a Search icon, styled to match existing form inputs (focus:ring-primary/50, placeholder:text-muted-foreground/40)
  • handleNew resets the filter after creating a new conversation
  • Empty states split into two: "No conversations yet" (list empty) vs "No matching conversations" (filter active, no hits)

Test plan

  • Type into the filter — list narrows in real time
  • Type something that matches nothing — see "No matching conversations"
  • Clear the filter — full list returns
  • Click + (new conversation) while a filter is active — filter clears, new conversation opens
  • Delete a conversation while filtering — remaining matches stay; active-conversation behavior unaffected

@shirshanka shirshanka merged commit 9ff8bd9 into datahub-project:main May 25, 2026
5 checks passed
@shirshanka
Copy link
Copy Markdown
Contributor

shirshanka commented May 25, 2026

Merged — thanks @shawnxiao105-afk! Clean execution: local state instead of Zustand was the right call (sidebar is the only consumer), the truthy guard on normalizedFilter keeps the array identity stable when no filter is active, and splitting the empty state into "no conversations yet" vs "no matching conversations" is a nice UX touch. 🎉

If you ever want to take this further: hiding the filter input entirely when conversations.length === 0 would be a small polish, and a keyboard shortcut to focus the input (e.g. / or Cmd+K) would be a natural follow-up. Both are nice-to-haves, not asks.

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.

Filter conversations in the sidebar

2 participants