| 24-search-history-branching |
02 |
ui |
| react |
| tanstack-query |
| cmdk |
| lucide-react |
| typescript |
|
| phase |
provides |
| 24-00 |
shared types (ChatMessageSearchResult, ChatBookmarkWithMessage, ChatBookmarkToggleResponse, ChatBookmarkListResponse, ChatConversation with branch fields) |
|
|
| chatApi.searchMessages — FTS endpoint client method |
| chatApi.toggleBookmark — bookmark toggle client method |
| chatApi.getBookmarks — bookmark list client method |
| chatApi.branchConversation — branch creation client method |
| chatApi.listBranches — branch list client method |
| chatApi.exportConversation — export download URL helper |
| useChatSearch hook — debounced FTS query hook with placeholderData |
| useChatBookmarks hook — bookmark list query hook |
| useToggleBookmark hook — bookmark mutation with cache invalidation |
| ChatSearchDialog component — CommandDialog FTS overlay with term highlighting |
| ChatMessageBookmark component — bookmark toggle icon button |
| ChatBookmarkList component — filterable scrollable bookmark list |
| ChatBranchSelector component — horizontal branch picker bar |
|
|
| added |
patterns |
|
|
| useChatSearch: placeholderData=(prev)=>prev keeps previous results while new query loads |
| ChatSearchDialog: shouldFilter=false on Command for server-side FTS (not cmdk client filtering) |
| HighlightedText: React component splits text into segments to avoid unsafe innerHTML XSS risk |
| useToggleBookmark: invalidates both [chat, bookmarks] and [chat, search] queries after toggle |
|
|
| created |
modified |
| ui/src/hooks/useChatSearch.ts |
| ui/src/hooks/useChatBookmarks.ts |
| ui/src/components/ChatSearchDialog.tsx |
| ui/src/components/ChatMessageBookmark.tsx |
| ui/src/components/ChatBookmarkList.tsx |
| ui/src/components/ChatBranchSelector.tsx |
|
|
|
| Used HighlightedText React component instead of innerHTML for term highlighting — eliminates XSS surface |
| exportConversation returns URL string (not fetch call) since server sends file download via browser navigation |
| ChatBranchSelector renders null when branches.length === 0 — no empty bar shown |
|
| shouldFilter=false pattern: all server-side search dialogs set this to bypass cmdk client filtering |
| Cache invalidation pattern: bookmark mutations invalidate both bookmarks and search query caches |
|
| CHAT-07 |
| CHAT-13 |
| CHAT-14 |
| HIST-04 |
| HIST-12 |
| PERF-04 |
|
3min |
2026-04-01 |