Skip to content

Open the model picker without the keyboard on phones - #504

Merged
Tryanks merged 1 commit into
mainfrom
ui/model-picker-mobile-focus
Sep 22, 2026
Merged

Tryanks merged 1 commit into
mainfrom
ui/model-picker-mobile-focus

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 22, 2026

Copy link
Copy Markdown
Owner

The model picker's popover tracked the search input's focus handle, and
PopoverState focuses the tracked handle the moment it opens, so on a phone
the sheet came up with the software keyboard over the list it means to be
tapped. The tracked focus is now attached only off-phone: a desktop window
of any width still types into the search as the picker opens, while a
mobile build lets the popover keep its own focus, so Escape and Back
still close it and a tap on the search field asks for the keyboard.

The composer's own focus checks read !compact && !is_mobile. Compact is
already is_mobile && narrow, so the width half was redundant and read as
if the window width took part in the keyboard decision. They now check the
build alone, and ChatView::focus_composer no longer pre-empts the composer
with its own compact check.

model_picker_focuses_its_search_only_off_phone opens the picker in a wide
desktop window, a narrow desktop window and on a phone: the search is
focused in the first two and unfocused on the phone, and Escape closes the
picker in all three.

The model picker's popover tracked the search input's focus handle, and
PopoverState focuses the tracked handle the moment it opens, so on a phone
the sheet came up with the software keyboard over the list it means to be
tapped. The tracked focus is now attached only off-phone: a desktop window
of any width still types into the search as the picker opens, while a
mobile build lets the popover keep its own focus, so Escape and Back
still close it and a tap on the search field asks for the keyboard.

The composer's own focus checks read `!compact && !is_mobile`. Compact is
already `is_mobile && narrow`, so the width half was redundant and read as
if the window width took part in the keyboard decision. They now check the
build alone, and ChatView::focus_composer no longer pre-empts the composer
with its own compact check.

model_picker_focuses_its_search_only_off_phone opens the picker in a wide
desktop window, a narrow desktop window and on a phone: the search is
focused in the first two and unfocused on the phone, and Escape closes the
picker in all three.
@Tryanks
Tryanks merged commit 07b8e56 into main Sep 22, 2026
7 checks passed
@Tryanks
Tryanks deleted the ui/model-picker-mobile-focus branch September 22, 2026 18:15
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.

1 participant