voelin-gpui: Escape closes the password prompt wherever in it the last click was

The prompt closed on Escape only while its field had the focus: the field's
own Escape has nothing to undo and passes the key on, and a listener on the
prompt took it. A click on the card off the field (its heading, the disabled
Join) moves the focus away from the field, and with nothing in the prompt
focusable the window's root took it (MainView's focus handle), so the prompt's
key context was off the dispatch path and Escape did nothing.

Escape is now a key binding of the prompt's key context (bound by
shell::bind_keys beside gpui_kit::init, in run() and in the tests), which
dispatches CancelChannelPassword, and the prompt's scrim holds a focus handle
of its own, so a click anywhere in the card leaves the context on the path.
The field's Escape still passes the key on and the binding closes the prompt;
the listener on the field's action is gone (with it the binding would close
twice). A test clicks the card's corner and the disabled Join and presses
Escape: it failed before (the prompt stayed), and the existing prompt test,
which presses Escape in the field, still passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-28 08:01:54 +03:00
1 parent c044f7279a
commit 244226d15c
5 files changed
+85 -13

No files matched your search

+15 -2
View File
@@ -1481,7 +1481,8 @@ What is on screen:
password was not given this connection asks for it (a card over the window,
Enter joins); a password the server refuses asks again, in words. As in the
Slint dialog, Join is off and Enter does nothing while the field is empty
(the prompt stays), and Escape closes it without joining.
(the prompt stays), and Escape closes it without joining, wherever in the
prompt the last click was (below).
#### Per-area signals and cached panes
@@ -1863,7 +1864,19 @@ the slices that meet it; none of it is a defect of what exists today.
start and takes the focus back when the element that had it is gone
(`on_focus_lost`: the form closed, a button replaced by another). A later
window (the Stream Studio's) does the same, and a new page's buttons dispatch
actions the root handles rather than listeners of their own.
actions the root handles rather than listeners of their own. A key that
belongs to an overlay needs the overlay on that path. The root's handle takes
the focus on every mouse down inside the window (GPUI transfers it to the
element under the pointer that has a handle, the root being under all of
them), and the overlay is a child of the root, not an ancestor of the root's
handle: a click on the overlay that no handle inside it takes leaves the
focus on the root, and the overlay's key context is off the path. The
password prompt therefore holds a focus handle of its own on its scrim (the
card is on it), and Escape is a key binding of its key context
(`shell::bind_keys`, called beside `gpui_kit::init`), not a listener on the
field's `Escape`: with the field focused its Escape passes the key on and the
binding closes the prompt, with anything else in the prompt focused the
binding is the only one there.
- **The hotkey portal calls `tokio::spawn`** (`voelin-platform`,
`hotkey/portal.rs`, `PortalBackend::new`): it panics where no tokio runtime
is current, and a GPUI foreground task has none. The GPUI front end starts