-
Notifications
You must be signed in to change notification settings - Fork 2.6k
ui/ux feat: chat search w/ highlight + jump #3144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
The pull request introduces a comprehensive chat search feature with highlighting and navigation capabilities across multiple components. Given the cohesive nature of the changes, it seems appropriate to keep them within a single pull request. However, if there are any unrelated changes that could be split into separate pull requests, please consider doing so for better manageability and review efficiency. Thank you for your contributions! |
| messages, | ||
| virtuosoRef, | ||
| getSearchableText, | ||
| // disableAutoScrollRef, // Removed unused prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disableAutoScrollRef prop is defined in the interface but is commented out in the hook implementation; if it’s meant to control auto-scroll behavior during search, please integrate it properly or remove it from the interface.
This comment was generated because it violated a code review rule: mrule_aQsEnH8jWdOfHq2Z.
| if (isCollapsing && isAtBottom) { | ||
| const timer = setTimeout(() => scrollToBottomAuto(), 0) | ||
| const timer = setTimeout(() => { | ||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several debug console.log statements in functions like toggleRowExpansion and handleRowHeightChange; consider removing or conditionally disabling these logs in production for cleaner output.
|
oh! Can |
|
I like this, but I really do think the icon positioning doesn't work for me. I'd probably be up for making this a keyboard-only shortcut for now, but I'm hesitant to keep crowding the visual UI (for now). |
I agree with that: It should be hidden until someone presses CTRL-F, and then it also needs to grab the focus. |
|
Hey @hannesrudolph do we have a "needs changes" status yet? |
I agree keyboard only is best, no need to crowd. (I'd still remove the extra new task button if not replacing) |
We do now @sachasayan !! |
|
Hey @dlab-anton, |
|
@dlab-anton Sorry about the premature close. My fault! Let me see if we can get this approved. |
|
@mrubens can you take a look at this feature and if its ok to move forwad with it I will ask @dlab-anton to rebase it and deal witht he conflicts. Otherwise there is no point. |
|
Are there any updates regarding this? |
Generally speaking, one feature per pull request unless they are strongly related, or if separating them would create unnecessarily merge conflicts to break them apart. Can they be cleanly separated or implemented as either independent, dependent, or follow-up pull requests? |
|
I didnt really check 3144 yet, but TaskTimeline feature moves some codeblocks within ChatView that may be relevant when merging |
|
stale |


Context
Tasks can get long, restore points are hard to find, if you lose your place in a long task you waste a lot of time trying to find it. All this takes away time, causes frustration. There are many possible solutions from minimaps to timeline panels, annotated scrollbars, etc. but the best solution is simple text search.
Search is a "need to have" fundamental usability feature for the chat interface.
Implementation
Note I replaced the X button (since the + button has the same function) but we can also hide the icon and rely on keyboard shortcut, move the icon somewhere else.
This PR introduces a comprehensive search functionality within the chat view and resolves minor linting issues.
Key Features & Changes:
In-Chat Search:
TaskHeaderor using theCtrl/Cmd + Fkeyboard shortcut.<mark>tags.Implementation Details:
useChatSearchto encapsulate search logic, state management, navigation, and the core highlighting function.useChatSearchintoChatView, passing down necessary props (searchText,highlightText,itemIndex) to child components.getSearchableTextForChatViewinChatViewto extract rich, searchable text content from various message types and structures. This includes a lookahead mechanism to associate API response text with its corresponding request row for better searchability.ChatView's scrolling logic (handleRowHeightChange,useEffecton message length,toggleRowExpansion) to respect the search state (showSearch,isNavigatingRef) and prevent unwanted auto-scrolling.TaskHeaderto include the search toggle button and manage its state.scrollIntoViewAPI within theuseChatSearchhook for efficient scrolling to matched items.ChatRow,BrowserSessionRow,CheckpointSaved,FollowUpSuggest,CodeAccordian(header): Use thehighlightTextfunction prop directly.MarkdownBlock: Uses a separateapplyHighlightingutility function that traverses the React node tree generated byreact-remark.CodeBlock: Uses a custom Shiki transformer (createSearchHighlightTransformer) that operates on the code's AST during syntax highlighting.