Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The branch picker no longer requests composer focus while opening the pull-request dialog. This is a narrowly scoped UI-focus correction with no change to checkout behavior or product defaults. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…icker-keeps-dialog-focus
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
When choosing "Checkout pull request" from the composer branch selector, the background composer steals keyboard focus on the next animation frame instead of keeping focus in the Checkout pull request dialog. Typing then goes into the blurred composer behind the dialog.
Change
Remove
onComposerFocusRequest?.()from thecheckoutPullRequestItemValuebranch ofselectPickerIteminapps/web/src/components/BranchToolbarBranchSelector.tsx, preservingPullRequestThreadDialog'sinitialFocus. Regular branch picks still return focus to the composer. Added a regression test inapps/web/src/components/PullRequestThreadDialog.browser.test.tsx.Scope
Bug fix (background composer steals focus from an open modal dialog). One-line obvious fix; no separate issue needed.
Verification
#123and choose "Checkout pull request" (click orEnter).456: on0fbd3262it lands in the composer; onfefdc493it replaces123in the focused dialog input.Setup: Ubuntu 26.04.1 LTS (Chromium 158, Browser panel), light theme, 1280x800, fresh isolated data per commit, hostname
Test machine.Steps: Draft thread in Demo Repo → branch selector →
#123→ "Checkout pull request" → type456(click andEnterverified; pickingfeaturereturns focus to composer).Dialog stays unfocused at 123; typed 456 lands in composer
Dialog stays focused with typed 456; composer stays empty
Links
apps/web/src/components/BranchToolbarBranchSelector.tsx,apps/web/src/components/PullRequestThreadDialog.browser.test.tsxNot shown
BranchToolbarBranchSelector.tsx)apps/web)Automated test and check results (AI agent on Linux)
0fbd3262:vp test run apps/web/src/components/PullRequestThreadDialog.browser.test.tsx -t "keeps dialog focus"failed atexpect.element(prInput).toHaveFocus()(Expected element with focus: <input placeholder="PR URL, checkout command, or #42" ... />,Received element with focus: <textarea aria-label="Composer" />).fefdc493:vp test run apps/web/src/components/BranchToolbar.logic.test.ts apps/web/src/components/PullRequestThreadDialog.test.ts apps/web/src/components/PullRequestThreadDialog.browser.test.tsx— 3 files passed, 48/48 tests passed (PullRequestThreadDialog.browser.test.tsx3/3 passed in 1.77s).vp run check:changed 0fbd32628b41e1de98f14b2ac178b50409cabc91onfefdc493:format: pass (0.5s)lint: pass (1.0s, 0 warnings, 0 errors)knip 1/2: pass (7.9s)typecheck (2 packages): pass (0.3s)knip 2/2: pass (13.6s)test (1 files): pass (8.1s, 3/3)react compiler (1 files): pass (4.8s, 1/1)upstream/main(d7a8b574):git merge-tree --write-treeexited 0 (19171ddd7e04cb5844173fd6a9a60c0c99a924b0).Generated with Gemini 4 Neon in T3 Code Nightly