Skip to content

feat(chat): in-conversation message search (Ctrl+F) - #1052

Open
ana52070 wants to merge 1 commit into
spacering-net:mainfrom
ana52070:feat/in-chat-search
Open

ana52070 wants to merge 1 commit into
spacering-net:mainfrom
ana52070:feat/in-chat-search

Conversation

@ana52070

Copy link
Copy Markdown
Contributor

What was wrong / Motivation

In long conversations, especially those with virtualized message lists and unloaded history pages, users previously had no built-in way to search and locate specific turns or keywords across the current session.

The browser's native find-in-page (Ctrl+F / ⌘+F) only operates on whatever DOM nodes happen to be mounted at that moment, completely missing turns that haven't been scrolled into view or loaded from storage yet. Furthermore, it did not provide turn-aware navigation or automatic fetching of older message chunks.

The change

  • Added a dedicated, collapsible Conversation Find Bar to the chat view, triggered by the standard shortcut Ctrl+F / ⌘+F (configurable under shortcut settings).
  • Comprehensive backend search: searches through all conversation content (including user messages, assistant replies, tool calls, tool results, thinking blocks, image prompt revisions, and error messages) using UTF-8 safe boundary snippets.
  • Deep historical navigation & auto-paging: navigating across matches automatically calls loadOlderTurnsThrough to page in unloaded turns, scrolling straight to the target turn even across virtualization boundaries.
  • Native-style text highlighting: utilizes the browser's standard CSS Custom Highlight API (::highlight(search-match) in yellow, ::highlight(search-match-active) in orange) to highlight exact matched words cleanly without altering the DOM.
  • Support for active / streaming turns and drafts: handles draft conversations (searching in-memory thread items) and live in-progress streaming replies.
  • Multi-language support: localized strings across all 10 supported languages (English, Simplified/Traditional Chinese, Japanese, Korean, German, Spanish, French, Portuguese, Arabic).

Before & After

Before (native browser search / unrendered history omitted) After (in-conversation search with match counter & highlighting)
Before After

Tests

  • Added comprehensive unit tests in src/components/chat/conversation-find-bar.test.tsx verifying:
    • Find bar open/close and keyboard focus handling.
    • Backend search invocation and next/previous match navigation.
    • Dynamic loading of older turns via loadOlderTurnsThrough.
    • In-memory thread search for draft conversations (id=0).
  • Registered and verified keyboard shortcut definitions and bindings in src/lib/keyboard-shortcuts.test.ts.
  • Verified Rust backend commands and web endpoints route through search_conversation_messages_core.

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.

1 participant