Repository navigation
fix(web): closing a composer menu on a touch tablet no longer opens the keyboard - #36325
Conversation
…ablet focuses the composer Failing reproduction for #26447. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he keyboard Composer menus return focus to the editor when they close. On a touch device that focus lands inside the tap's user activation, so Chrome on Android raised the on-screen keyboard, for example after tapping outside the model picker once its Permissions menu had been opened. useComposerMenuProps now leaves finalFocus unset on a coarse pointer, so the menu returns focus to its own trigger, matching the coarse-pointer check ChatView already applies to thread open and window focus. Fixes #26447 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Composer menus on touch devices retain their normal focus return instead of focusing the editor and opening the keyboard. The change is confined to transient UI focus, with desktop behavior preserved. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…he keyboard (pingdotgg#36325) (cherry picked from commit fa6326b)
Interim: no change was required this round and nothing was pushed; the branch is still at a77f632. PR #36325 is open on that head with its checks queued or in progress (no failures, no Macroscope or CodeRabbit findings yet). I called watch_pull_request for it and ended the turn; the watch is still on, so this is not the final result. The fix itself is unchanged: useComposerMenuProps() in apps/web/src/components/chat/composerEventScope.ts leaves finalFocus unset on a coarse pointer, so composer menus return focus to their own trigger instead of calling focusAtEnd() on the composer during the closing tap.
Fixes #26447
Reproduction on main
Commit origin/main 9efd960. Started
T3CODE_DEV_SEED=0 vp run devon a fresh database, added a git project and two Replay (dev) threads via the server CLI, paired a Playwright Chromium context emulating an Android tablet in the desktop layout (1163x720, hasTouch, isMobile so (pointer: coarse) matches, Android Chrome UA) and logged every focus() call with navigator.userActivation.isActive and a stack. Results: (1) tapping a sidebar thread 3 times: composer NOT focused (activeElement stays the sidebar row card); already fixed by #29496. (2) opening the model picker: its search input gets focus (reporter flags this as possibly intended). (3) tapping outside the picker: no composer focus. (4) picking an access mode (Supervised) in the picker footer's Permissions menu: no composer focus. (5) picking a Codex effort level: no composer focus. (6) open the model picker, open its footer Permissions menu (Full access chip), tap outside: the composer editor (data-testid=composer-editor) receives focus() with userActivation.isActive=true, so on a real Android tablet Chrome would raise the on-screen keyboard. The stack goes from Base UI FloatingFocusManager getReturnElement to useComposerMenuProps().finalFocus (composerEventScope.ts) to ChatComposer focusAtEnd to the Tiptap EditorView.focus. Not checked on a real device's keyboard (emulation only).Evidence
Real web app, Chromium Android tablet emulation, 1163×720, touch enabled, coarse pointer, light theme, fresh synthetic Replay data on each commit. Open the model picker → open footer Permissions → click outside → wait for dismissal. The overlay observes focus without changing its behavior.
Scenario source · Tablet runner setup
scenarios:prove exited 0: failsOnBase=true, passesOnHead=true. Actual Android keyboard visibility remains unverified.
Not shown:
Tests
None this round. Read the PR state and check runs over REST: PR open, mergeable_state blocked, checks queued or in progress, 'Open PR limit', 'Prepare PR size config' and 'Agent context budget' passed.
Not in this change
Who did the work
Run by the t3code factory in T3 Code.