# feat\(web\): add in-thread find · PR \#7434 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/7434)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: closed

Source repository: Unavailable fork

Source branch: codex/find-in-thread

Target branch: main

Head commit: 1e856b41bd1e387aede255e685313d27a300226b

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/7434)

[Commits](https://git.cafe/pingdotgg/t3code/pull/7434/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/7434/diffs?format=markdown)

## Description

---

Users currently cannot find text in the open thread from the desktop app because Cmd/Ctrl+F has no in-app target.

This was sloppified by GPT-5.6 Sol Medium. I (a real human) also built and used the desktop and web apps, then tested the UI to make sure it worked well.

This adds a compact, responsive find bar directly to the existing virtualized message timeline. It stays anchored to the top right within narrow chat columns by shrinking the text field while preserving every control. It searches every user prompt and assistant response, including inline and fenced code snippets, and expands a collapsed long prompt when navigating to a match inside it. Search is case-insensitive by default, with a compact **Aa** toggle and a clear primary-color active state for exact-case matching. It counts each occurrence, scrolls to matching virtualized rows, highlights every rendered match, and gives the active match a stronger highlight and underline.

The bar supports Cmd/Ctrl+F, Enter, Shift+Enter, Escape, previous/next controls, and Cmd/Ctrl+G or Shift+Cmd/Ctrl+G while focus is outside the search field. Cmd/Ctrl+G reopens a closed bar with its retained query and immediately navigates to the next match; adding Shift navigates to the previous match. Escape closes the bar even after focus has moved elsewhere in the chat. Pressing Cmd/Ctrl+F again refocuses an open bar; in a regular browser, pressing it again while that input is already focused falls through to the browser's native find. Terminal focus keeps ownership of its shortcuts.

The implementation remains client-only, with no contract or server changes and no state outside the timeline.

### Web dependencies

These three additions are kept because search counts need to be derived from visible Markdown text rather than raw Markdown syntax:

- `unified`: creates and reuses the Markdown processing pipeline.
- `remark-parse`: parses message Markdown into an mdast tree, so syntax and hidden link destinations are not counted as visible matches.
- `mdast-util-to-string`: extracts the visible text from that tree, including inline/fenced code while excluding image alt text, so occurrence counts line up with rendered highlights.

`remark-gfm` was already a web dependency; the search parser reuses it so GitHub-flavored Markdown is interpreted consistently with `ChatMarkdown`.

Validation:

- `vp test run apps/web/src/components/chat/MessagesTimeline.logic.test.ts` (35 tests, including exact-case matching)
- `pnpm --filter @t3tools/web typecheck`
- targeted `vp lint` on the changed web files
- real browser pass: all matches remain highlighted; Enter changes 1/2 → 2/2 with a stronger active result; Cmd+G and Shift+Cmd+G navigate; Cmd+F refocuses the open custom input; a second Cmd+F while it is focused opens Chrome's native find

Screenshots:

Before:

![Current chat without in-thread search](https://github.com/user-attachments/assets/61f93e4d-c99f-417a-a24e-47f1ef521a81)

After — the active `browser` result is highlighted:

![Cmd+F find bar with browser highlighted](https://github.com/user-attachments/assets/2d3d6817-f3f2-4ee4-af98-86a5d65be7bf)

Context: #1486, #4599

Built with Codex (GPT-5).

