Open the project chooser without the keyboard on phones - #493
Merged
Merged
Conversation
The mobile Threads page "+" button opens the command palette as a project chooser when more than one project exists. The palette always focused its search input, which raised the software keyboard over a list that is meant to be tapped. WindowState now records whether the palette should focus its query: open_palette keeps the keyboard for the search pill, and the new open_palette_without_keyboard leaves the search input unfocused and gives focus to the palette overlay so Escape and Back still close it. start_thread uses the latter on mobile builds only; a narrow desktop window keeps typing into the chooser. project_choice_reuses_drafts_and_focuses_only_on_desktop now asserts the query focus after opening the chooser: focused off-phone, unfocused on a phone, with the palette owning focus in both cases.
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.
Behaviour
On a phone, the Threads page "+" button opens the command palette as a project chooser when more than one project exists. The palette always focused its search input on open, which raised the software keyboard over a list that is meant to be tapped. The chooser now opens with the search input unfocused on mobile builds; the palette overlay takes focus instead so Back/Escape still close it. The search pill keeps raising the keyboard, and a narrow desktop window keeps typing into the chooser.
Changes
WindowStaterecords whether the palette should focus its query on open (open_palettevs the newopen_palette_without_keyboard). This is the one owner of "how the palette opens"; the shell's frame-of-open focus step reads it.CommandPalette::focusbecameopen(focus_query, ..): the reset (empty query, first row) is unchanged; only where focus goes differs.AppShell::start_threadpicks the keyboard-less variant on mobile builds.Tests
project_choice_reuses_drafts_and_focuses_only_on_desktopnow asserts, after opening the chooser, that the query input is focused exactly when the build is not mobile, and that the palette owns focus in both cases. The added assertion fails without the fix (project chooser raises the keyboard only off-phone).Checks run
cargo fmt --all --checkcargo clippy -p tcode-ui --all-targets --locked -- -D warningscargo nextest run -p tcode-uifor the palette and shell focus testsNot run locally: full workspace tests, iOS/Android/Web checks (CI covers them; the change is confined to
crates/ui). Not exercised on a device.