Skip to content

fix(models): do not open the keyboard when the model picker opens on mobile - #1012

Merged
agegr merged 1 commit into
mainfrom
claude/mobile-model-filter-focus
Sep 30, 2026
Merged

agegr merged 1 commit into
mainfrom
claude/mobile-model-filter-focus

Conversation

@agegr

@agegr agegr commented Sep 30, 2026

Copy link
Copy Markdown
Owner

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. The demo/ copy is left alone, since it's synced separately.

Verification

  • A new components/ModelSelector.test.mjs.
  • tsc --noEmit, eslint, and npm test (1354/1354) pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q8e4GL1QSNFveKtnFfP3FZ


Generated by Claude Code

…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
@agegr
agegr merged commit 92ae057 into main Sep 30, 2026
2 checks passed
@agegr
agegr deleted the claude/mobile-model-filter-focus branch October 1, 2026 13:28
Kano-u pushed a commit to Kano-u/pi-web that referenced this pull request Oct 2, 2026
…gr#976 agegr#974 agegr#989 agegr#990 agegr#991)

这 8 个提交与我们的分叉没有文本冲突,直接并入:
- agegr#1011 回合答案出现后折叠过程详情
- agegr#1012 移动端打开模型选择器不弹键盘
- agegr#972/agegr#976 行内链接在 CJK 标点处停止、行内公式与货币格式
- agegr#974 首条消息前即报告 system prompt
- agegr#989/agegr#990/agegr#991 子代理:收集标记按 run 计、重启后的中断报告、续跑背景报告标注
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants