Skip to content

fix(desktop): the New tab keeps the keyboard when the keys land back on the window - #2442

Open
jlong wants to merge 1 commit into
mainfrom
jlong/desktop-a-new-tab-opened-from-the-palette-s-switch-project-takes-no-keys
Open

jlong wants to merge 1 commit into
mainfrom
jlong/desktop-a-new-tab-opened-from-the-palette-s-switch-project-takes-no-keys

Conversation

@jlong

@jlong jlong commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Summary

Found in the dl-parity walk on Omarchy: Switch Project… from the palette added a New tab showing the launch screen, but ↑/↓, Return and Esc did nothing until the screen was clicked. The tab bar's + didn't have this problem.

Now, whenever the New tab shows with nothing over it and the keys sit on the window itself (or nowhere), the window hands them to the launch screen.

Technical details

  • ShelbiWindow::keep_new_tab_keys (desktop/src/app.rs) runs where the New tab's launch screen is placed in the window's render. It only moves focus off the window root, never off a focused child: the launch screen's own Connect dialog keeps its keys.
  • It does nothing while the palette, the tab menu or a modal dialog is up, because those hold focus on the window on purpose.
  • Why a guard and not a fix to the palette path: in the test window, the palette path already gives the launch screen the keys. That holds for a typed query plus Return, with real dispatch and the command tap off. So I couldn't reproduce the exact focus steal seen on Wayland. The guard covers any path that leaves the keys on the window, which is the "dead until clicked" state the bug describes. Worth checking on a real Omarchy window (see QA).

QA checklist

  • On Omarchy: open a project, run Switch Project… from the palette, and check that ↑/↓ move the launch screen's selection and Return opens the selected project without clicking first.
  • Esc / ⌘W behave as before on the New tab.
  • The palette opened over the New tab still takes typing, and the launch screen behind it doesn't move.
  • The tab menu on the New tab still closes with Esc.
  • The + still opens a New tab that takes keys.
  • cargo test in desktop/: switch_project_from_the_palette_gives_the_new_tab_the_keys and keys_left_on_the_window_go_back_to_the_new_tab pass. The second fails without the guard.

🤖 Generated with Claude Code


Auto-opened by Shelbi — review at: /home/jlong/.shelbi/projects/shelbi/tasks/desktop-a-new-tab-opened-from-the-palette-s-switch-project-takes-no-keys.md

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
shelbi Ready Ready Preview Nov 27, 2026 2:42am UTC

Request Review

…on the window

Switch Project… from the palette opened a New tab whose launch screen
took no keys until clicked; the tab bar's + did. The window now hands
the keyboard to the launch screen whenever the New tab shows with
nothing over it and focus sits on the window itself (or nowhere).

Decisions:
- A render-time guard (`keep_new_tab_keys`) rather than another focus
  call in the palette path. The palette path in the test window
  (typed query + Return, real dispatch with the tap off) already lands
  the keys on the launch screen, so the exact steal on Omarchy/Wayland
  wasn't reproducible here; the guard covers any path that leaves the
  keys on the window, which is what "dead until clicked" means.
- The guard stands aside while the palette, the tab menu or a modal
  dialog is up, since those deliberately hold focus on the window. It
  only ever moves focus off the window root, never off a focused child
  (the launch screen's own Connect dialog keeps its keys).
- Tests: the palette's Switch Project… end to end, and the keys put
  back on the window while the New tab shows (fails without the guard),
  plus the palette over the New tab keeping its keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jlong
jlong force-pushed the jlong/desktop-a-new-tab-opened-from-the-palette-s-switch-project-takes-no-keys branch from c76bb29 to de7600f Compare November 27, 2026 02:41

This branch was successfully deployed

1 active deployment
Preview — de7600f9 Deployed Nov 27, 2026 by vercel[bot]
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