Skip to content

fix(web): find in thread opens from the thread title menu, so phones can reach it - #22352

Open
mkantautas wants to merge 3 commits into
pingdotgg:mainfrom
mkantautas:fix/thread-find-touch
Open

mkantautas wants to merge 3 commits into
pingdotgg:mainfrom
mkantautas:fix/thread-find-touch

Conversation

@mkantautas

@mkantautas mkantautas commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On a phone, Find in thread cannot be opened. It opens from Cmd+F (chat.find) and from the command palette's "Find in current thread". A phone has no Cmd+F, and the default sidebar has no tap target for the command palette: its Search field filters threads. The find bar, its search and its match navigation all work on touch once open; nothing on screen opens it.

Reproduce: open the web client on an iPhone, open a thread, look for a way to search inside it.

Change

The menu that opens from the thread title in the chat header (useThreadActionMenu) gets "Find in thread" as its first item when the open thread supports find (serverConfig.threadFind, the same condition the find bar uses). Choosing it calls the same open function as chat.find. The item is read-only, so connections without operate scope keep it. The sidebar's thread menu does not show it, since find works on the open thread only. The web context-menu fallback gets the text-search icon the command palette already uses for this action.

Scope and approval

A very small, focused fix for an obvious bug: a shipped feature has no way to open it on touch devices. The fix adds one entry point to a menu every client already has and reuses the existing find bar. No find behavior, setting or default changes. Desktop users see the same item in that menu, next to their Cmd+F.

Verification

  • iPhone 17 simulator, iOS 26.3, Mobile Safari, with real touches through XCUITest, against vp run dev on this branch, using a thread whose words were replaced with filler text.
  • Before (main): tapping the thread title opens the menu without any find action.
  • After: the menu starts with Find in thread. Tapping it opens the find bar with the cursor in the field and the keyboard up. Typing "pretium" showed 169 matches, and the previous-match arrow moved to 168/169 and scrolled to it.

Before (main):

Thread title menu on main: New thread on main, Pin, Settle, Snooze, Rename and so on, no find

After: the menu, then the find bar opened from it.

Thread title menu with Find in thread first; next frame the find bar shows pretium with 168/169

Recording: after.mp4

  • Synced with main by merges, without rebasing: 5ffe045 on 2026-10-22 and eabcfa2 on 2026-10-25. On the current head, useThreadActionMenu.test.ts and threadActionMenu.logic.test.ts pass (10 tests), and with main's application code the find test fails. vp run check:changed passes (format, lint, knip, web typecheck, 159 tests in 7 files). In the 2026-10-22 merge, upstream perf(web): streamed reply text no longer re-renders ChatView #23117 had removed the find bar's content option, and upstream refactor(web): chat shortcuts live with the hooks that own their actions #23097 had removed openThreadFindStable; the merge restores it for the header menu's callback. In the 2026-10-25 merge, upstream feat: share a thread with a guest who watches live and sends messages you approve #24104 had added canShareWithGuest next to this PR's onFind in the header menu's hook input; the merge keeps both. Apart from those two lines, the application changes are identical to the original head. Local checks used Node 26.12.1 and pnpm 12.14.0, the repo's pins. The simulator evidence above is from the original head and was not rerun for these syncs.
  • Not checked: the desktop app's native menu (it renders the same item list; icons are not shown there) and Android.

Model: Claude Opus 5.5 (xhigh). Harness: Claude Code in T3 Code.

Rebase on 2026-10-21: GPT-6 Astra (xhigh), Codex harness in T3 Code.

Syncs with main on 2026-10-22 and 2026-10-25: Claude Opus 5.5 (xhigh), Claude Code in T3 Code. Review: GPT-6 Astra (xhigh), Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 20, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ee43c9b

Macroscope's review found this PR approvable — This is a narrowly scoped web bug fix that makes the existing thread-search bar reachable from the thread title menu on touch devices. It preserves the existing feature gate, adds no new schema or deployment behavior, and keeps sidebar menus unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d074c09 and 477ac8b.

Files selected for processing: 7
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/chat/ChatHeader.tsx
  • apps/web/src/components/threadActionMenu.logic.ts
  • apps/web/src/contextMenuFallback.ts
  • apps/web/src/hooks/useThreadActionMenu.test.ts
  • apps/web/src/hooks/useThreadActionMenu.ts
Files skipped from review as they are similar to previous changes: 1
  • apps/web/src/contextMenuFallback.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The chat UI adds a “Find in thread” menu action. The action and ThreadFindCanvas are available only for eligible server threads that are not showing a paint-only timeline.

Changes: Thread Find Action

Layer / File(s) Summary
Add Find in thread menu action
apps/web/src/components/threadActionMenu.logic.ts, apps/web/src/hooks/useThreadActionMenu.ts, apps/web/src/contextMenuFallback.ts, apps/web/src/hooks/useThreadActionMenu.test.ts, apps/web/src/components/threadActionMenu.logic.test.ts
The action-menu logic adds a “Find in thread” action that does not require operate permission. The hook exposes the action when an onFind callback is provided and invokes it when selected. The fallback icon and tests are updated.
Enable find for eligible chat threads
apps/web/src/components/ChatView.tsx, apps/web/src/components/chat/ChatHeader.tsx, apps/web/src/components/Sidebar.tsx
ChatView passes a find callback to ChatHeader and uses a shared eligibility condition for ThreadFindCanvas. Sidebar thread menus set canFind to false.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ChatView
  participant ChatHeader
  participant useThreadActionMenu
  participant User
  participant ThreadFindCanvas
  ChatView->>ChatHeader: Pass onFindInThread when threadFindEnabled
  ChatView->>ThreadFindCanvas: Use threadFindEnabled for availability
  ChatHeader->>useThreadActionMenu: Pass onFind callback
  User->>useThreadActionMenu: Select find action
  useThreadActionMenu->>useThreadActionMenu: Invoke onFind callback
Loading

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, maria-rcks

Merge Risk: Minimal · up to 477ac

The thread-find action is consistently gated and dispatched, with no actionable merge-blocking risk identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the main change: Find in thread opens from the thread title menu so phones can reach it. The changeset adds a "Find in thread" item to the chat header thread menu, which matches. The t…
Description check Passed The description follows the template. The Problem section gives the cause (no touch entry point for Find in thread) and reproduction steps. The Change section explains the menu item, the read-only beh…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Find in thread opens from the thread title menu so phones can reach it. The changeset adds a "Find in thread" item to the chat header thread menu, which matches. The title uses the conventional commit form and fits the scope of the change.

Full details: Description check

Explanation

The description follows the template. The Problem section gives the cause (no touch entry point for Find in thread) and reproduction steps. The Change section explains the menu item, the read-only behavior, and the sidebar exclusion. The Scope and approval section explains why the fix qualifies as a very small, focused bug fix without a prior issue. The Verification section gives concrete simulator steps, before and after results, screenshots, a recording, and the checks run, and it notes what was not checked. The model/harness attribution is present at the end. No required section is missing.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…can reach it

Find in thread opened only from Cmd+F and the command palette. A phone has
no Cmd+F, and the default sidebar has no tap target for the palette, so on a
touch screen find could not be opened at all. The menu that opens from the
thread title now starts with Find in thread when the server supports it.
Conflicts:
	apps/web/src/components/ChatView.tsx
…h-20261025

# Conflicts:
#	apps/web/src/components/chat/ChatHeader.tsx
#	apps/web/src/hooks/useThreadActionMenu.test.ts
#	apps/web/src/hooks/useThreadActionMenu.ts

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

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant