Skip to content

Find in thread (⌘F) and message search in the command palette - #1080

Open
NoboKik wants to merge 3 commits into
zeronsh:mainfrom
NoboKik:feat/find-in-thread
Open

NoboKik wants to merge 3 commits into
zeronsh:mainfrom
NoboKik:feat/find-in-thread

Conversation

@NoboKik

@NoboKik NoboKik commented Oct 27, 2026 •

Copy link
Copy Markdown

⌘F opens a find field in the chat's top-right corner. Matches are highlighted in both your messages and the agent's, and ↑/↓ or Enter steps through every occurrence. The ⌘K palette gets a Messages tab (⌘3) that searches the text of every chat. Opening a result opens that chat with the same words already in its find field.

How

  • Engine (crates/engine/src/transcript_search.rs): a new SearchTranscripts RPC backed by a SQLite FTS5 index beside the profile store, with one row per user or assistant message. Reasoning and tool output aren't indexed. Each search first refreshes chats whose snapshot changed, within a 1s budget, and drops deleted chats. Every query word must match as a literal prefix, so FTS operators in user text stay inert. Hits carry the chat id, a snippet and from_user.
  • Sync (crates/sync/src/store.rs): snapshot saved_at lookups for the refresh, kept outside the numbered migrations.
  • Find in thread (crates/ui/src/find.rs, transcript.rs):
    • Matches are counted per rendered row (user text, or the row's markdown block) and stepped per occurrence.
    • The painters highlight matches under the text in markdown paragraphs, lists, tables and code lines, and in user bubbles. The current match is stronger.
    • The field takes the session cards' slot (same width and card styling), and the cards stack below it while it's open.
    • The shortcut is rebindable (find_in_thread, default mod-f). It only fires on a chat, so it doesn't clash with ⌘F in settings search (Settings search: find any setting from the sidebar, with ⌘F #1018).
  • Palette (crates/ui/src/shell/command_palette.rs):
    • Messages sits third, after Threads. All shows a short "In messages" section after Threads.
    • Rows show the title, project · device, time, You:/Agent: and the snippet with the matched words bold.
    • Threads matches titles only.

Screenshots

Find in thread (⌘F) Message search (⌘K → Messages)

Tests

  • cargo test -p zeron-engine --test transcript_search passes. The new test covers user and assistant text being found, reasoning staying out, every word having to match, hostile FTS input, delete, restart, and rebuilding after the index file is removed.
  • cargo check -p zeron-ui passes.
  • Tried by hand in a Linux release build: find highlights both kinds of message, the counter steps per occurrence, and palette results open the chat with the find field filled.

Not verified

  • macOS, Windows, mobile.
  • Opening a palette result jumps to the chat's first match, not necessarily the message that was clicked. Restoring a saved scroll position might also override the jump.
  • Paragraphs whose links get shortened on screen can mark the wrong match as current.
  • The index rebuilds from scratch on the first search after upgrading (schema v2).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

NoboKik and others added 3 commits October 27, 2026 13:54
A SQLite FTS5 index beside the profile store, one row per user or
assistant message (reasoning and tool output stay out). It refreshes from
snapshot freshness on each search, within a time budget, and drops
deleted chats. Every query word must match as a literal prefix. Hits
carry the chat, a snippet and whether the user wrote the message.

The snapshot freshness index lives outside the numbered sync migrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Find in thread:
- A find field in the chat's top-right corner, styled like the session
  cards, which stack below it while it is open.
- Matches are washed inline in assistant markdown (paragraphs, lists,
  tables, code) and user bubbles; the current one is stronger.
- The counter and Enter / Shift+Enter step per occurrence, scrolling to
  its row.

Palette:
- A Messages tab (third, after Threads) and an "In messages" section in
  All, fed by SearchTranscripts. Rows show the title, project and
  device, time, You: or Agent:, and the snippet with matched words bold.
- Opening a result opens the chat with the same words in its find bar.
- Threads matches chat titles only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NoboKik

NoboKik commented Oct 27, 2026

Copy link
Copy Markdown
Author

This branch has not been deployed

No deployments
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