Repository navigation
fix(models): do not open the keyboard when the model picker opens on mobile - #1012
Merged
Merged
Conversation
…mobile The filter input autofocused on open. On phones that raises the on-screen keyboard, which shrinks the viewport and pushes the model list off-screen before the user has decided to filter. Keep autofocus on desktop, where it lets you type right away; on mobile, tap to filter. Reported in #901 and #960. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ
This was referenced Oct 15, 2026
Closed
agegr
added a commit
that referenced
this pull request
Oct 20, 2026
* fix(chat): focus the fresh composer after a new session (#1313) Every new session (Ctrl+Alt+N, the sidebar's New, a group's +, the header's +) goes through handleNewSession, which bumps sessionKey and remounts the composer; nothing focused it, so the first thing typed went nowhere until the composer was clicked. The fresh composer now takes the caret once it renders: the request rides a requestAnimationFrame past the sessionKey remount and calls the new ChatInputHandle.focus(). A move from the new-session bar still keeps the bar's control (newSessionBarFocusRef), and a phone stays as it was, where focus would raise the software keyboard uninvited, the picker's filter's rule since #1012. * fix(chat): leave the focus in an open dialog on a new session Ctrl+Alt+N still starts a new session while Settings (or a folder picker) is open, and the caret request then pulled the focus out of the aria-modal dialog into the composer behind it. The request now leaves focus that sits inside an [aria-modal='true'] element alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(chat): put the caret after a draft that comes back with a new session A draft parked in a cwd returns when a new session starts there again. Focusing the remounted textarea left the caret at its start, so the next keystrokes went in front of the draft. ChatInputHandle.focus() now moves the caret to the end, as the composer's other focus paths do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(demo): focus the fresh composer after a new session (#1313) The demo's copies of AppShell and ChatInput get the same caret request: ChatInputHandle.focus() and the desktop-only, dialog-respecting requestAnimationFrame in handleNewSession. The demo has no new-session bar, so there is no bar focus request to defer to. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: LVsarff <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
…mobile (agegr#1012) The filter input autofocused on open. On phones that raises the on-screen keyboard, which shrinks the viewport and pushes the model list off-screen before the user has decided to filter. Keep autofocus on desktop, where it lets you type right away; on mobile, tap to filter. Reported in agegr#901 and agegr#960. Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ Co-authored-by: Claude <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
…gegr#1317) * fix(chat): focus the fresh composer after a new session (agegr#1313) Every new session (Ctrl+Alt+N, the sidebar's New, a group's +, the header's +) goes through handleNewSession, which bumps sessionKey and remounts the composer; nothing focused it, so the first thing typed went nowhere until the composer was clicked. The fresh composer now takes the caret once it renders: the request rides a requestAnimationFrame past the sessionKey remount and calls the new ChatInputHandle.focus(). A move from the new-session bar still keeps the bar's control (newSessionBarFocusRef), and a phone stays as it was, where focus would raise the software keyboard uninvited, the picker's filter's rule since agegr#1012. * fix(chat): leave the focus in an open dialog on a new session Ctrl+Alt+N still starts a new session while Settings (or a folder picker) is open, and the caret request then pulled the focus out of the aria-modal dialog into the composer behind it. The request now leaves focus that sits inside an [aria-modal='true'] element alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(chat): put the caret after a draft that comes back with a new session A draft parked in a cwd returns when a new session starts there again. Focusing the remounted textarea left the caret at its start, so the next keystrokes went in front of the draft. ChatInputHandle.focus() now moves the caret to the end, as the composer's other focus paths do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(demo): focus the fresh composer after a new session (agegr#1313) The demo's copies of AppShell and ChatInput get the same caret request: ChatInputHandle.focus() and the desktop-only, dialog-respecting requestAnimationFrame in handleNewSession. The demo has no new-session bar, so there is no bar focus request to defer to. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: LVsarff <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…mobile (agegr#1012) The filter input autofocused on open. On phones that raises the on-screen keyboard, which shrinks the viewport and pushes the model list off-screen before the user has decided to filter. Keep autofocus on desktop, where it lets you type right away; on mobile, tap to filter. Reported in agegr#901 and agegr#960. Claude-Session: https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ Co-authored-by: Claude <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…gegr#1317) * fix(chat): focus the fresh composer after a new session (agegr#1313) Every new session (Ctrl+Alt+N, the sidebar's New, a group's +, the header's +) goes through handleNewSession, which bumps sessionKey and remounts the composer; nothing focused it, so the first thing typed went nowhere until the composer was clicked. The fresh composer now takes the caret once it renders: the request rides a requestAnimationFrame past the sessionKey remount and calls the new ChatInputHandle.focus(). A move from the new-session bar still keeps the bar's control (newSessionBarFocusRef), and a phone stays as it was, where focus would raise the software keyboard uninvited, the picker's filter's rule since agegr#1012. * fix(chat): leave the focus in an open dialog on a new session Ctrl+Alt+N still starts a new session while Settings (or a folder picker) is open, and the caret request then pulled the focus out of the aria-modal dialog into the composer behind it. The request now leaves focus that sits inside an [aria-modal='true'] element alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(chat): put the caret after a draft that comes back with a new session A draft parked in a cwd returns when a new session starts there again. Focusing the remounted textarea left the caret at its start, so the next keystrokes went in front of the draft. ChatInputHandle.focus() now moves the caret to the end, as the composer's other focus paths do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(demo): focus the fresh composer after a new session (agegr#1313) The demo's copies of AppShell and ChatInput get the same caret request: ChatInputHandle.focus() and the desktop-only, dialog-respecting requestAnimationFrame in handleNewSession. The demo has no new-session bar, so there is no bar focus request to defer to. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: LVsarff <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported in both #901 and #960, whose broader changes were declined.
Problem
The model picker's filter input has
autoFocus. On phones, opening the picker therefore raises the on-screen keyboard. The keyboard shrinks the viewport and pushes the model list off-screen before the user has even decided to filter.Fix
Use
autoFocus={!isMobile}. Desktop keeps type-to-filter right away; on mobile, the user taps the field to filter. Thedemo/copy is left alone, since it's synced separately.Verification
components/ModelSelector.test.mjs.tsc --noEmit,eslint, andnpm test(1354/1354) pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ
Generated by Claude Code