1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! **A modal owns the frame while it is up** (DESIGN §11, bl-d921) — the one
//! home of that invariant for yog's modals: §3.1's `new workspace` name form
//! and the two §3.6 delete confirmations (workspace, and one conversation
//! deep, bl-f17a).
//!
//! Coverage-excluded glue like the rest of `shell/*`. The two halves it wires
//! are tested elsewhere: the keyboard half is the pure
//! [`Held::Modal`](crate::keymap::Held::Modal) plane in `src/keymap`, and both
//! halves are driven end to end by the acceptance harness
//! (`shell::acceptance::modal`).
//!
//! **The pointer half is a hit test, not a picture.** egui 0.29 has no
//! `egui::Modal`, so the backdrop is a screen-sized [`egui::Area`] in
//! `Order::Middle` — above the panels' `Order::Background`, below the dialog
//! windows that are shown after it. egui's hit test picks the *topmost layer*
//! under the pointer and discards every widget below it, so a click at the left
//! panel's Config entry lands on the backdrop's layer and reaches nothing.
//! `interactable(false)` is load-bearing twice over: it makes the backdrop's
//! own widget sense hover rather than click (so the click is swallowed, not
//! delivered), and it keeps the backdrop out of `Areas::layer_id_at` — which is
//! what stops a press on it from calling `move_to_top` and hoisting the
//! backdrop *above* the dialog it is meant to sit under.
use cratetheme;
use ShellState;
/// Is a modal up? The §11 keyboard plane and the backdrop read this one
/// predicate, so the two halves of "owns the frame" can never disagree.
pub
/// Dismiss whichever modal owns the frame — Escape's whole meaning on the
/// [`Held::Modal`](crate::keymap::Held::Modal) plane. The draft dies with it
/// (§5.3: unsubmitted input is RAM, and this is the operator saying no), and
/// the keyboard goes back to the composer (§11 focus discipline). Written as
/// both modals' default rather than a branch on which one is up: there is no
/// state to preserve either way, so "clear the transients" is the whole verb.
pub
/// The scrim that makes everything beneath a modal inert — painted only while
/// one is up, immediately before the dialogs so it lands under them.
pub