Skip to content

Open the project chooser without the keyboard on phones - #493

Merged
Tryanks merged 1 commit into
mainfrom
mobile-new-thread-no-focus
Sep 21, 2026
Merged

Tryanks merged 1 commit into
mainfrom
mobile-new-thread-no-focus

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 21, 2026

Copy link
Copy Markdown
Owner

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

  • WindowState records whether the palette should focus its query on open (open_palette vs the new open_palette_without_keyboard). This is the one owner of "how the palette opens"; the shell's frame-of-open focus step reads it.
  • CommandPalette::focus became open(focus_query, ..): the reset (empty query, first row) is unchanged; only where focus goes differs.
  • AppShell::start_thread picks the keyboard-less variant on mobile builds.

Tests

project_choice_reuses_drafts_and_focuses_only_on_desktop now 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 --check
  • cargo clippy -p tcode-ui --all-targets --locked -- -D warnings
  • cargo nextest run -p tcode-ui for the palette and shell focus tests

Not run locally: full workspace tests, iOS/Android/Web checks (CI covers them; the change is confined to crates/ui). Not exercised on a device.

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.
@Tryanks
Tryanks merged commit 385f391 into main Sep 21, 2026
7 checks passed
@Tryanks
Tryanks deleted the mobile-new-thread-no-focus branch September 21, 2026 06:51
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