Skip to content

fix(web): Cmd/Ctrl+F opens the browser find bar while a pull request is maximized - #41622

Open
only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-column-find-when-maximized
Open

only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-column-find-when-maximized

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

With a pull request's detail panel maximized, pressing Cmd/Ctrl+F in a web browser did nothing, whether focus was on the panel's controls or inside the pull request. Two handlers took the key:

  • The pull request list stays mounted behind the maximized panel (inert, zero width). Its window shortcut still called preventDefault() on Cmd/Ctrl+F and then tried to focus a search field that can't be reached.
  • With focus anywhere in the right panel, mod+f resolves to preview.find, and the chat-route command claimed the key before checking whether anything would answer it. On the Pull requests page there is no thread, so the panel find action never fires, but the browser's find was blocked anyway.

Fix

  • PullRequestsColumn only listens for Cmd/Ctrl+F while the list is shown. The listener comes back when the panel is restored.
  • preview.find leaves the key unclaimed when the route can't run panel find: there is no route environment, or the viewer lacks preview access. Where it can run, nothing changes: the Files search and the in-app browser still answer Cmd/Ctrl+F from the right panel. The zoom keys got a similar gate in fix(web): zoom shortcuts zoom the app from the PR, Diff and Files panes #39207; find can't use the same "browser focused" check, because the Files panel also answers find from anywhere in the right panel.

Side effects, both in the same direction. With the panel not maximized and focus in the pull request, Cmd/Ctrl+F now focuses the list search, the same as with focus elsewhere on the page. On a thread where the viewer lacks preview access, the browser's own find now opens instead of nothing.

Desktop has no find bar for the app window, so there the key is simply no longer swallowed. Mobile has no equivalent shortcut.

Testing

An AI agent ran each check below:

  • PullRequestsColumn.browser.test.tsx mounts the list unmaximized, maximizes it, then restores it. It fails on main, and also fails with maximizedAway dropped from the effect deps. It passes here.
  • chatRouteCommands.test.ts: preview.find on /pull-requests returns unclaimed and dispatches nothing. Fails on main, passes here; the existing draft-thread dispatch case is unchanged.
  • vp run check:changed passes.
  • Real app, web dev server with a public fixture repository and an isolated home, Chromium. Each check opens the pull request, maximizes the panel with a mouse click and presses Ctrl+F twice: once with focus on the panel's Restore button, then after clicking into the description. On main both presses were consumed, by the list and by preview.find. Here, neither was. On a draft thread with Files open, Ctrl+F from the panel's tab strip still focused the Files search.

Not checked: the desktop in-app browser's find. That path needs a thread route with preview access, and the code for it is unchanged.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +2 test cases (browser +1, unit +1, server 0).

New browser test files: apps/web/src/components/pullRequest/PullRequestsColumn.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The find shortcut now skips maximized-away pull request columns. On chat routes without a route environment or preview-operation permission, preview.find returns false without claiming the event or dispatching a preview action. Tests cover both behaviors.

Changes: Pull request column shortcut

Layer / File(s) Summary
Gate the column find listener
apps/web/src/components/pullRequest/PullRequestsColumn.tsx, apps/web/src/components/pullRequest/PullRequestsColumn.browser.test.tsx
The column skips its keydown listener when maximizedAway is true. The browser test checks that Ctrl+F is not prevented in that state and that the search textbox receives focus when the column is not maximized away.

Chat route shortcut

Layer / File(s) Summary
Guard preview.find by route permission
apps/web/src/shortcuts/chatRouteCommands.ts, apps/web/src/shortcuts/chatRouteCommands.test.ts
preview.find returns false without preventing the event or dispatching a preview action when the route environment or preview-operation permission is absent. The test covers a non-thread chat route.

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 1cc2e

This change lets Cmd/Ctrl+F reach the browser find bar when a pull request is maximized or when preview access is unavailable. The change is narrow and tested, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Cmd/Ctrl+F now reaches the browser find bar while a pull request is maximized. It follows the conventional commit format and matches the changeset, which gates the Pul…
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each is filled in. The Problem and Change sections state the bug and the fix clearly. The…
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: Cmd/Ctrl+F now reaches the browser find bar while a pull request is maximized. It follows the conventional commit format and matches the changeset, which gates the PullRequestsColumn listener and the chat-route preview.find command on the same case.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each is filled in. The Problem and Change sections state the bug and the fix clearly. The Scope section links no issue and gives no reason for omitting one. It names PR #39207 only as a reference, and the bug-fix scope rule is met by describing an obvious bug. The Verification section lists focused tests, the observed results, and what was not checked. The template's agent line is present as the final model-and-harness attribution.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 853bf71 and 1cc2ed8.

Files selected for processing: 1

  • apps/web/src/shortcuts/chatRouteCommands.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Chrome 151 on Linux; light theme; identical synthetic PR data and viewport on both commits. Open the PR detail, maximize it, press Ctrl+F from Restore panel size and then from description text. Type searchable. Restore the panel and press Ctrl+F with focus in the list region.

The scenario runner exited 0: reproduced on base and passed on head. Base prevents both maximized shortcuts; head opens native browser find from both. Restoring the panel preserves list-search focus.

Interaction Before — 1002934541 After — 1cc2ed8768
Maximized controls Before: no find bar After: native find bar
Maximized description Before: no find bar After: native find bar
Restored list Before: list search focused After: list search focused
Recording Before recording After recording

Scenario and synthetic fixture · Native-browser runner configuration

Head regression checks also passed: Ctrl+F focuses Files search in both a draft and an existing thread.

Draft Files search focused
Existing-thread Files search focused

Regression driver

Not shown:

  • Cmd+F on macOS was not exercised; the native-browser proof covers Ctrl+F in Linux Chrome.

@juliusmarminge juliusmarminge added takeover:needs-julius Takeover done; route gate says Julius decides and removed takeover:in-progress A takeover lead is working on this PR labels Nov 23, 2026

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:S 10-29 changed lines (additions + deletions). takeover:needs-julius Takeover done; route gate says Julius decides vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants