Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
- Last reviewed commit: 9ef9043599d097a623e46f0e637181c0dca13b3b
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
No actionable comments were generated in the recent review.
External image Recent review info
-
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 5211acf
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ccd53fa0-6680-4cf1-a6f0-4b6256794014
External image Commits
Reviewing files that changed from the base of the PR and between d4971487a068a412a11980715497a9a42850bd27 and 9ef9043599d097a623e46f0e637181c0dca13b3b.
External image Files selected for processing: 2
apps/web/src/components/preview/PreviewView.browser.test.tsxapps/web/src/components/preview/PreviewView.tsx
External image Files skipped from review as they are similar to previous changes: 1
- apps/web/src/components/preview/PreviewView.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Walkthrough
The pull request adds find-in-page to the desktop preview. It connects search controls and shortcut entry points to desktop search operations, reports match counts, and adds page-first handling for the Find shortcut.
Changes: Preview Find-in-Page
Layer / File(s) Summary Find contracts and IPC bridge
packages/contracts/src/ipc.ts,apps/desktop/src/ipc/channels.ts,apps/desktop/src/ipc/methods/preview.ts,apps/desktop/src/preload.tsContracts define search inputs and result events. IPC and preload methods start or stop tab searches and deliver results to the renderer. Search execution and result delivery
apps/desktop/src/preview/Manager.ts,apps/desktop/src/preview/Manager.test.tsThe manager calls Electron find-in-page operations and publishes match updates to subscribers. Tests cover search options, result events, and stopping a search. Page-first shortcut routing
apps/desktop/src/preview/GuestProtocol.ts,apps/desktop/src/preview/PickPreload.ts,apps/desktop/src/preview/Manager.ts,apps/desktop/src/preview/Manager.test.ts,packages/contracts/src/keybindings.ts,packages/shared/src/keybindings.ts,apps/web/src/shortcuts/chatRouteCommands.ts,apps/web/src/components/ReopenClosedViewShortcut.tsx,apps/web/src/components/settings/KeybindingsSettings.logic.tsThe guest preload reports eligible shortcuts that the page did not prevent. The manager routes configured page-first commands based on focus and shortcut mapping. The preview.findcommand is added to keybindings and action dispatch.Find entry points and preview controls
apps/web/src/components/CommandPalette.tsx,apps/web/src/components/preview/PreviewFindBar.tsx,apps/web/src/components/preview/PreviewView.tsx,apps/web/src/components/preview/PreviewMoreMenu.tsx,apps/web/src/components/preview/previewActionBus.ts,apps/web/src/components/preview/PreviewView.browser.test.tsxThe command palette and preview menu expose Find. The preview view controls availability, focus, menu actions, and find-bar rendering. The bar searches, navigates matches, displays counts, and stops searches when cleared or unmounted. The browser test checks that switching tabs does not reopen the bar. Priority: External image Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature · Severity of issue fixed: Low
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant PreviewFindBar 3 participant DesktopPreviewBridge 4 participant PreviewIPC 5 participant PreviewManager 6 participant ElectronWebContents 7 PreviewFindBar->>DesktopPreviewBridge: findInPage(tabId, text, options) 8 DesktopPreviewBridge->>PreviewIPC: invoke findInPage 9 PreviewIPC->>PreviewManager: delegate validated search 10 PreviewManager->>ElectronWebContents: findInPage(text, options) 11 ElectronWebContents-->>PreviewManager: found-in-page result update 12 PreviewManager-->>PreviewIPC: publish match counts 13 PreviewIPC-->>DesktopPreviewBridge: send find-result event 14 DesktopPreviewBridge-->>PreviewFindBar: notify result listener Possibly related issues
- pingdotgg/t3code#22952: The issue describes Cmd+F doing nothing in the integrated browser. This pull request adds a Find bar, search navigation, and Cmd+F/Ctrl+F entry points.
Possibly related PRs
- pingdotgg/t3code#25250: Changes shortcut handling for focused desktop browser pages, which is also used by this pull request’s
preview.findshortcut path.
Suggested reviewers:
juliusmarminge,t3dotgg
Merge Risk: External image Moderate · up to 9ef90
Several Find entry paths can fail or display stale results in normal desktop use, so these issues should be resolved before merging.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description covers the problem, implementation, scope, verification, manual checks, limitations, screenshots, and recording. However, the Scope and approval section states that issue #22952is not…Add a link to the triaged issue or maintainer approval comment. If this is an approval-exempt obvious bug fix, explicitly explain why the change qualifies under that exemption. Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely describes the primary change: enabling Cmd+F to search pages in the integrated browser. Linked Issues check Passed Issue #22952requires that Cmd+F (Ctrl+F on Windows/Linux) open a find bar and highlight page matches in the integrated browser. The browser ⋮ menu must also offer find. The PR meets these requirement…Out of Scope Changes check Passed Each change connects to #22952or supports its implementation. Contracts, IPC channels, preload bridge, and PreviewManager find methods implement the search path. The guest preload shortcut report and…Full details: Linked Issues check
Explanation
Issue
#22952requires that Cmd+F (Ctrl+F on Windows/Linux) open a find bar and highlight page matches in the integrated browser. The browser ⋮ menu must also offer find. The PR meets these requirements: (1) Desktop: PreviewManager.findInPage maps to Electron webContents.findInPage with findNext set from newSession. stopFindInPage calls stopFindInPage('clearSelection'). The found-in-page listener forwards every update to subscribers. These run through new IPC channels, DesktopPreviewBridge methods, and contract types. (2) Web UI: PreviewFindBar searches as the user types, shows active/total counts, supports next, previous, and Escape, and stops the search on close or unmount. (3) Shortcut: the preview.find command is in STATIC_KEYBINDING_COMMANDS with default mod+f when previewFocus. The guest preload (PickPreload.ts) reports unhandled keys. The host opens find on a reported key, or claims the key first when a subframe has focus. (4) Menu: PreviewMoreMenu shows a 'Find on page' item when actions.find is set, and PreviewView wires it. Unit tests in Manager.test.ts cover option mapping, result forwarding, selection clearing, and shortcut routing for macOS, Linux, and Windows. The reviewed diff of Manager.ts matches these claims. Remaining uncertainty: Windows and Linux behavior and the page-owned Cmd+F case are not checked in a real app. The issue does not require those checks, and unit tests cover the routing logic.
Full details: Out of Scope Changes check
Explanation
Each change connects to
#22952or supports its implementation. Contracts, IPC channels, preload bridge, and PreviewManager find methods implement the search path. The guest preload shortcut report and host routing implement the shortcut requirement. The find bar, ⋮ menu item, command palette action, and preview.find keybinding implement the entry points. The KeybindingsSettings label and ReopenClosedViewShortcut forwarding register the new command. The shared helper in Manager.ts that filters non-macOS Ctrl+Alt punctuation keys was extracted from existing logic. The reviewed diff shows the same filter applied to existing forwarded shortcuts, so this refactor does not change their behavior. Page-first priority applies only to preview.find (PAGE_FIRST_FORWARDED_COMMANDS). Focus-after-navigation in PreviewView supports the issue's reproduction, which requires a click into the page before Cmd+F works. The F-key pattern in PickPreload.ts is not described in the PR description. Its only effect in the reviewed code is to forward keys that match a page-first command, and preview.find is the only such command, so it is connected to find-shortcut handling. No change is shown to be unrelated to the issue.
Full details: Description check
Explanation
The description covers the problem, implementation, scope, verification, manual checks, limitations, screenshots, and recording. However, the Scope and approval section states that issue
#22952is not triaged and does not provide explicit maintainer approval or a sufficiently clear exemption rationale under the repository template.Resolution
Add a link to the triaged issue or maintainer approval comment. If this is an approval-exempt obvious bug fix, explicitly explain why the change qualifies under that exemption.
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.