Skip to content

🤖 feat: add Ctrl+F find in transcript#2562

Open
ammar-agent wants to merge 4 commits intomainfrom
feat/transcript-find-ctrl-f
Open

🤖 feat: add Ctrl+F find in transcript#2562
ammar-agent wants to merge 4 commits intomainfrom
feat/transcript-find-ctrl-f

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Adds Ctrl/Cmd+F "Find in transcript" support to the chat pane, matching the standard in-app find experience. A floating search bar appears over the transcript area, letting users type a query, see match counts, and navigate between matches with Enter/Shift+Enter or arrow buttons.

Background

There was no way to quickly locate specific content within a long chat transcript. Users had to scroll manually, which is especially painful for lengthy agent conversations. This follows the prior art of the "Quote in input" context-menu feature, which already demonstrates scoped transcript text operations.

Implementation

New transcript search utility (src/browser/utils/messages/transcriptSearch.ts):

  • findTranscriptTextMatches() – walks the rendered DOM inside [data-message-content] blocks, performing case-insensitive text search. Excludes interactive elements (buttons, inputs, selects) so only actual message text is matched.
  • focusTranscriptTextMatch() – selects the matched text via the Selection API and scrolls the containing message row into view.

ChatPane integration (src/browser/components/ChatPane.tsx):

  • Floating find bar with search input, match counter (e.g. "3/12"), prev/next/close buttons.
  • Ctrl/Cmd+F opens the bar (capture-phase handler scoped to chat pane focus). If transcript text is currently selected, it pre-fills the query (reuses getTranscriptContextMenuText from the quote feature).
  • Enter → next match, Shift+Enter → previous match, Escape → close bar. Match navigation wraps around.
  • Active match selection disables auto-scroll so streaming won't yank the viewport away.
  • On close, clears the DOM selection within the transcript.

Keybind registry (src/browser/utils/ui/keybinds.ts):

  • FOCUS_TRANSCRIPT_SEARCH: { key: "f", ctrl: true } – shares the same physical shortcut as FOCUS_REVIEW_SEARCH, but they're scoped to different panels (chat pane vs. code review) via focus containment checks.

Settings (KeybindsSection.tsx):

  • "Find in transcript" added to the Chat keybind group.

Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: xhigh • Cost: $0.00

@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb2fd5173a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the locale-safe offset feedback: switched from toLocaleLowerCase + indexOf to RegExp with the i flag so match offsets always refer to the original source text. Added escapeRegExp to safely escape user queries.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cbe00e8a4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

Regarding the RegExp + i flag comment: this is intentional and matches the standard behavior of Ctrl+F in browsers, VS Code, and other text editors. None of them perform locale-specific Unicode casefolding (İ↔i, ß↔ẞ) in their find-in-page.

The previous toLocaleLowerCase + indexOf approach was also not correctly handling these pairs for offset mapping — it was actually broken in the opposite direction (offsets pointing past the text node boundary, causing IndexSizeError). The RegExp approach correctly returns offsets in the original source text, which is the critical invariant for Selection.addRange().

Resolving as intentional — this matches the behavior users expect from Ctrl+F in a typical application.

@ammar-agent
Copy link
Collaborator Author

@codex review

Resolved the Unicode casefolding thread — the RegExp i flag matches standard Ctrl+F behavior in browsers and editors. The previous toLocaleLowerCase approach was broken for offset mapping (the original P2 issue); the current approach returns correct offsets in the source text.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent ammar-agent force-pushed the feat/transcript-find-ctrl-f branch from 7cbe00e to d77a1bb Compare February 24, 2026 14:34
@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32e7545bdd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the initial Enter navigation issue for transcript find and added regression coverage.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Add floating find bar overlay (Search icon, input, match counter, prev/next/close)
- New transcriptSearch utility: findTranscriptTextMatches + focusTranscriptTextMatch
- Scoped to [data-message-content] blocks, ignores buttons/inputs
- Enter/Shift+Enter cycle matches; Escape closes; auto-fills from transcript selection
- FOCUS_TRANSCRIPT_SEARCH keybind (Ctrl/Cmd+F) registered and shown in settings
- Unit tests for search utility (case-insensitive matching, repeated matches, focus)
Addresses Codex review: toLocaleLowerCase can change string length
for certain characters (e.g. Turkish İ → i̇), causing offset
mismatches when mapping back to original text nodes. Using RegExp
with the 'i' flag returns match offsets in the original text.
- only move transcript selection on explicit navigation actions (Enter/Shift+Enter/buttons)
- dismiss transcript find on Enter when query is empty/whitespace and restore transcript focus
- add UI regression coverage for open/focus, typing focus retention, empty-enter dismiss, and Enter navigation

---

_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$5.75`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=5.75 -->
- keep active match index unset while typing so first Enter targets match #1
- avoid single-result no-op by requiring explicit Enter navigation to change index
- extend transcript-find UI regression coverage for first-enter behavior on single and multi-match queries

---

_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$5.75`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=5.75 -->
@ammar-agent ammar-agent force-pushed the feat/transcript-find-ctrl-f branch from b5c7b4c to 3053fea Compare February 24, 2026 16:24
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