From c5971dfa4ef1aa076c1ca5ca1105e219c3ab32ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 9 Sep 2026 20:51:59 +0300 Subject: [PATCH] =?UTF-8?q?wip(keys):=20dock=20KEYS=20tab=20+=20single=20?= =?UTF-8?q?=3F=20=E2=80=94=20capped=20mid-work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DESIGN.md | 17 ++- crates/app/src/main.rs | 2 +- crates/app/src/player/actions.rs | 9 +- crates/app/src/player/cards.rs | 7 +- crates/app/src/tests/cards.rs | 8 +- crates/app/src/tests/editing.rs | 1 - crates/app/src/tests/layout.rs | 59 ++++++-- crates/app/src/ui/dock_stance.rs | 103 ++++++++++++- crates/app/src/ui/stance.rs | 240 +++++-------------------------- 9 files changed, 208 insertions(+), 238 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index c825bda..7e1b27c 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -223,7 +223,22 @@ string over ~4 words that instructs rather than reports state is a defect. control it already has no visual presence beside (marks and clipboard on the time band's cut readout row; lift/detach/group/regroup as bench lane-head ghosts; fit/resolution/zoom on the screen's own corner; subtitle/silence/project verbs into the dock next to the tab they already - belong to) — at which point the plate deletes and `?` held becomes pure dim, no list. + belong to) — at which point the list deletes and `?` becomes pure dim, no list. + + **Amendment (2026-09-09), explicit per this section's own rule:** the plate is deleted. The + user asked why the spine ended in `?` over `?` and said of the plate it opened "it's not good, + I mean probably location problem" — a surface that appears out of nowhere over the bench, holds + the keyboard, and covers work. The list is now the **dock's third tab, `KEYS`, beside SOURCES + and CLIP**: stable geography, occluding nothing, scrolling like its neighbours, with the same + registry-driven rows (`keys_rows`, section head per `keymap::Category`, label left, mono chord + `ink3` right) and no heading prose, since the tab strip itself is the way back. An action the + room would refuse right now greys to `ink4` like any refused verb (§8) rather than vanishing. + `?` swings the dock to that tab and a second `?` (or `escape`, or a press on another tab) + swings it back — a toggle, not a hold and not a modal: nothing about the KEYS tab owns the + keyboard, so the film keeps playing and every other stroke keeps meaning what the spine says it + means. The spine's `?` glyph wears no chord badge, because its chord *is* its glyph. The + ceiling above is unchanged: the 56 homeless actions still owe a geographic home, and this tab + is what they read from until they get one. ## 10. The joy layer diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 9366adf..f2561c6 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -68,7 +68,7 @@ use engine::transform::TransformParams; use engine::{Clip, Codec, ExportHandle, Frame, MediaBitrate, PlaybackSession}; use gpui::{ AnyElement, App, Application, Bounds, ClickEvent, Context, Corners, CursorStyle, Div, - DragMoveEvent, FocusHandle, KeyDownEvent, KeyUpEvent, MouseButton, MouseDownEvent, + DragMoveEvent, FocusHandle, KeyDownEvent, MouseButton, MouseDownEvent, MouseExitEvent, MouseMoveEvent, MouseUpEvent, PathBuilder, Pixels, Point, RenderImage, ScrollDelta, ScrollHandle, ScrollWheelEvent, SharedString, Size, Stateful, TextAlign, TitlebarOptions, Window, WindowBounds, WindowOptions, canvas, div, point, prelude::*, px, diff --git a/crates/app/src/player/actions.rs b/crates/app/src/player/actions.rs index fc1c4ac..452dc74 100644 --- a/crates/app/src/player/actions.rs +++ b/crates/app/src/player/actions.rs @@ -257,9 +257,10 @@ impl Player { cx.notify(); } - /// The actions card, from its key, from the panel button, or from its own - /// row: open, scrolled to the top -- a card that opens where the last - /// look left it would hide most of the list for a reason nobody remembers. + /// The keys list, from its key, from the spine's `?`, from the dock's own + /// KEYS tab or from a menu row: the dock swings to that tab, scrolled to + /// the top -- a list that opens where the last look left it would hide + /// most of itself for a reason nobody remembers. pub(crate) fn show_actions(&mut self, cx: &mut Context) { self.keys_open = true; self.scroll_keys(None); @@ -445,7 +446,7 @@ impl Player { // below, which otherwise repeats nothing. if self.budget_edit.is_some() { Repeat::Card - } else if self.keys_open || self.export_open || self.exporting().is_some() { + } else if self.export_open || self.exporting().is_some() { Repeat::Nothing } else if self.eq_open.is_some() || self.color_open.is_some() diff --git a/crates/app/src/player/cards.rs b/crates/app/src/player/cards.rs index 5f267d8..85dd593 100644 --- a/crates/app/src/player/cards.rs +++ b/crates/app/src/player/cards.rs @@ -1325,8 +1325,11 @@ impl Player { /// a keystroke reach `enable()`/`act()` and be answered -- Yes, or a /// spoken `No` -- instead of being swallowed before either is asked. pub(crate) fn card_open(&self) -> bool { - self.keys_open - || self.settings_open + // Not `keys_open`: since 2026-09-09 that is the dock's KEYS *tab* + // showing, a region like any other, not a surface sitting on the + // keyboard -- every stroke still means what the spine says it means + // while the list is up. + self.settings_open || self.export_open || self.eq_open.is_some() || self.color_open.is_some() diff --git a/crates/app/src/tests/cards.rs b/crates/app/src/tests/cards.rs index e23a5cd..08b9dea 100644 --- a/crates/app/src/tests/cards.rs +++ b/crates/app/src/tests/cards.rs @@ -85,15 +85,13 @@ fn every_modal_field_has_a_mounted_surface_somewhere_in_the_darkroom() { ); // The mounted-surface function each field's own card draws, by the // convention the param cards already follow (`x_open` -> `x_card(` -- - // `Player::eq_card`/`color_card`/... in `ui/cards.rs`). `keys_open` and - // `export_open`/`exporting` don't follow that convention (the keys - // overlay isn't a "card", export pairs with the running-export sheet), - // so they're named explicitly. Anything else unmapped panics loudly -- + // `Player::eq_card`/`color_card`/... in `ui/cards.rs`). + // `export_open`/`exporting` don't follow that convention (export pairs + // with the running-export sheet), so they're named explicitly. Anything else unmapped panics loudly -- // the point is that a ninth card has to earn a line here, not just a // mount, or this test cannot see it. let mount_for = |field: &str| -> &'static str { match field { - "keys_open" => "keys_overlay(", "export_open" => "export_card(", "exporting" => "export_progress_card(", "eq_open" => "eq_card(", diff --git a/crates/app/src/tests/editing.rs b/crates/app/src/tests/editing.rs index 2480851..1be6954 100644 --- a/crates/app/src/tests/editing.rs +++ b/crates/app/src/tests/editing.rs @@ -1367,7 +1367,6 @@ fn every_action_is_reachable_without_the_keyboard() { #[test] fn every_card_closes_without_the_keyboard() { for card in [ - "keys_overlay", "export_card", "eq_card", "color_card", diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 373915f..ccc58d8 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2954,29 +2954,60 @@ fn every_paired_spine_glyph_is_drawn_at_the_narrow_size() { ); } -/// DESIGN §8 (no instructional copy) and §9: the keys plate's heading is one -/// noun, its way out is a chord like every other row, and its bottom edge is -/// inside the window -- the shipped plate said `ALL COMMANDS · HOLD ? · -/// RELEASE TO CLOSE` while sitting there latched after a click, with its last -/// rows cut off below y=720. +/// DESIGN §9 as amended 2026-09-09: the keys list is the dock's third tab, +/// not a plate over the bench. The overlay the user asked about ("clicking +/// them opens a menu ... probably location problem") is gone with its scrim, +/// the tab strip lists all three tabs, and the rows still come off +/// `keys_rows` with the refused ones greyed rather than hidden (§8). #[test] -fn the_keys_plate_says_one_noun_and_ends_inside_the_window() { - let src = src_text("ui/stance.rs"); - let lower = src.to_lowercase(); +fn the_keys_list_is_a_dock_tab_and_the_plate_is_gone() { + let stance = src_text("ui/stance.rs"); + assert!( + !stance.contains("keys_overlay") && !stance.contains("stance-keys-overlay"), + "the keys plate is still mounted over the bench" + ); + let dock = src_text("ui/dock_stance.rs"); + for (id, label) in [ + ("dock-tab-src", "SOURCES"), + ("dock-tab-clip", "CLIP"), + ("dock-tab-keys", "KEYS"), + ] { + assert!( + dock.contains(&format!("dock_tab(\"{id}\", \"{label}\"")), + "the dock's tab strip lost {label}" + ); + } + assert!( + dock.contains("fn keys_tab(") && dock.contains("keys_rows()"), + "the KEYS tab draws something other than the action registry" + ); assert!( - !lower.contains("hold ? · release to close") && !lower.contains("all commands"), - "the keys plate still tells the hand what to do" + dock.contains("Enable::Yes => INK2(),") && dock.contains("_ => INK4(),"), + "a refused action's row no longer greys to ink4 (DESIGN §8)" ); assert!( - src.contains("section_head(\"keys\")") && src.contains(".child(\"esc\")"), - "the keys plate lost its noun or its escape chord" + dock[dock.find("fn keys_tab(").unwrap()..].contains(".overflow_y_scroll()"), + "the KEYS tab does not scroll like its neighbours" ); + // The Sources filter box belongs to Sources: it is built inside + // `sources_tab`, never in the shared frame `render` draws. + let frame = &dock[dock.find("pub(crate) fn render(").unwrap()..]; assert!( - src.contains(".h(px((bench_h + LEDGER_H - 16.).max(0.)))"), - "the keys plate is no longer capped inside the bench+ledger footprint" + !frame.contains("dock-filter"), + "the Sources filter box leaked into the shared dock frame" ); } +/// The user's screenshot: the spine ended with `?` over `?`. A ghost whose +/// primary chord IS its glyph wears no badge; every other one still does. +#[test] +fn the_spine_question_mark_wears_no_second_question_mark() { + let src = src_text("ui/stance.rs"); + assert!( + src.contains(".when(player.keymap.chord(action) != glyph, |el| {"), + "the spine ghost draws its chord badge even when the badge repeats the glyph" + ); +} /// The ruler's right edge was soup: `bench-select-all` sits `right(4.)` over /// the tick band while tick suppression only guarded the LEFT plate, so the diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index 1bcd98d..f56956c 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -199,8 +199,15 @@ fn dock_tab( .when(active, |d| d.border_t_1().border_color(rgb(INK1()))) .cursor_pointer() .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { - this.dock_src_active = label_text == "SOURCES"; - save(this.dock_src_active); + // KEYS is a *look*, not a place the room reopens in: it rides + // `keys_open` and is never written to the dock-tab file, so the + // pair underneath it (`dock_src_active`) is still what a press on + // KEYS comes back to. + this.keys_open = label_text == "KEYS"; + if !this.keys_open { + this.dock_src_active = label_text == "SOURCES"; + save(this.dock_src_active); + } cx.notify(); })) .children(hitmap::control(id, label_text, true)) @@ -1424,6 +1431,85 @@ fn clip_tab( ) } +/// The KEYS tab (DESIGN §9, amended 2026-09-09): every bound command, +/// sectioned by [`keymap::Category`] exactly as [`keys_rows`] files them -- +/// reusing that registry-driven order is what makes an action added anywhere +/// land here without a second list to forget. It lives in the dock beside +/// SOURCES and CLIP rather than on a plate over the bench: stable geography, +/// occludes nothing, scrolls like its neighbours, and the tab strip itself is +/// the way back, so there is no heading prose and no `esc` hint to write. +/// +/// An action the room would refuse right now greys to `ink4`, the same ink a +/// refused verb wears (DESIGN §8) -- never hidden: the list is the full truth +/// about the keyboard, including the strokes that would answer `No` today. +fn keys_tab(player: &Player) -> impl IntoElement { + let row_label = label(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM); + let row_chord = mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM); + let pair = move |text: String, chord: String, ink: u32| { + div() + .flex_none() + .flex() + .justify_between() + .gap(px(12.)) + .child( + div() + // The label gives way, never the chord: a long parenthetical + // ("Previous sync point (a cut here is copied...)") pushed + // the chord column clean off the dock's right edge until + // this row took `min_w(0)` + ellipsis, the same shape a + // source row's name already uses. + .flex_1() + .min_w(px(0.)) + .truncate() + .font(row_label.font.clone()) + .text_size(row_label.size) + .text_color(rgb(ink)) + .child(text), + ) + .child( + div() + .flex_none() + .font(row_chord.font.clone()) + .text_size(row_chord.size) + .text_color(rgb(if ink == INK4() { INK4() } else { INK3() })) + .child(chord), + ) + .into_any_element() + }; + div() + .id("dock-keys-rows") + .flex_1() + .min_h(px(0.)) + .flex() + .flex_col() + .gap(px(3.)) + .p(px(8.)) + .overflow_y_scroll() + .children(keys_rows().into_iter().map(|row| match row { + KeyRow::Head(category) => div() + .flex_none() + .pt(px(4.)) + .child(section_head(category.label().to_uppercase())) + .into_any_element(), + // The full-truth surface: every chord the action answers to + // (`display`), not the badge's primary-only compact form. + KeyRow::Act(action) => pair( + action.label().to_string(), + player.keymap.display(action), + match player.enable(action, None) { + Enable::Yes => INK2(), + _ => INK4(), + }, + ), + // A fixed stroke is the window's, not an action the room can + // refuse, so it never greys. + KeyRow::Fixed(i) => { + let f = &keymap::FIXED[i]; + pair(f.label.to_string(), f.chord.to_string(), INK2()) + } + })) +} + /// The dock's content, under `stance.rs::dock()`'s tab-bar-and-body frame: /// the tab row, then whichever tab is showing. /// @@ -1442,7 +1528,8 @@ pub(crate) fn render( window: &mut Window, cx: &mut Context, ) -> impl IntoElement { - let src_active = player.dock_src_active; + let keys = player.keys_open; + let src_active = player.dock_src_active && !keys; div() .id("stance-dock-body") .flex_1() @@ -1459,11 +1546,13 @@ pub(crate) fn render( .border_b_1() .border_color(rgb(DARK_HAIRLINE())) .child(dock_tab("dock-tab-src", "SOURCES", src_active, cx)) - .child(dock_tab("dock-tab-clip", "CLIP", !src_active, cx)), + .child(dock_tab("dock-tab-clip", "CLIP", !src_active && !keys, cx)) + .child(dock_tab("dock-tab-keys", "KEYS", keys, cx)), ) - .child(match src_active { - true => sources_tab(player, window, cx).into_any_element(), - false => clip_tab(player, width, window_size, window, cx).into_any_element(), + .child(match (keys, src_active) { + (true, _) => keys_tab(player).into_any_element(), + (false, true) => sources_tab(player, window, cx).into_any_element(), + (false, false) => clip_tab(player, width, window_size, window, cx).into_any_element(), }) } diff --git a/crates/app/src/ui/stance.rs b/crates/app/src/ui/stance.rs index 20b470f..da94a51 100644 --- a/crates/app/src/ui/stance.rs +++ b/crates/app/src/ui/stance.rs @@ -449,195 +449,32 @@ fn ghost( )) .text_color(rgb(INK2())) .child(glyph.to_string()) - // Every command wears its chord (DESIGN §4) -- including the one - // whose glyph IS its stroke: `?` reads as `?` over a dimmer `?`, - // the same glyph-over-chord anatomy every other spine ghost draws, - // rather than as the one control on the rail with nothing under it. - .child( - div() - .type_style(type_scale::mono( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK3())) - // FAULT 1: the badge shows the primary chord, compact -- - // same rule as every glyph in `spine_stance`. - .child(player.keymap.chord(action)), - ) -} - -/// The keys overlay (DESIGN §9, §12 step 7): every bound command, sectioned -/// by [`keymap::Category`] exactly as the legacy actions card files them -/// ([`keys_rows`]) -- reusing that registry-driven order is what makes an -/// action added anywhere land here without a second list to forget. Held -/// open by `?` -- [`crate::ui::stance::render`]'s own `on_key_down` opens it -/// on the press (bypassing the modal `overlaid()` guard, which would -/// otherwise swallow the second `?` down while the first is still up) and -/// its `on_key_up` closes it on release, so this is the room dimming one -/// fill step for as long as the key is held, never a latch (DESIGN §9: -/// hold-to-peek, click also dismisses). The scrim also closes on a press, -/// same contract every other card's scrim answers, so a hand that lets go -/// of `?` before reading the list still has a door out without touching the -/// keyboard again. -/// -/// corner-cut, named explicitly in DESIGN §9's own 2026-08-20 amendment -/// rather than silently shipped against the section's original text: it -/// wants chords surfaced *in place beside their controls* across every -/// region, and this is one scrolling list plate instead, anchored over the -/// bench/ledger footprint so it never reaches the screen (§11.6 holds). -/// Ceiling: DESIGN §12 step 7's full geographic pass (each region draws its -/// own rows while held) -- §9's amendment names the 56 actions still -/// without a home. -fn keys_overlay(player: &Player, bench_h: f32, cx: &mut Context) -> impl IntoElement { - div() - .id("stance-keys-overlay") - .absolute() - .bottom_0() - .left_0() - .right_0() - // The live `bench_h` the caller already measures for `bench`, - // not the fixed `BENCH_H` default: a hand-dragged - // bench taller than the default left this scrim short of the real - // footprint, so the overlay stopped mid-bench instead of covering it. - .h(px(bench_h + LEDGER_H)) - .bg(rgba(SCRIM())) - .flex() - // The plate's inset lives on the scrim, not on the plate's own - // margins: a margin under a fixed `h()` left the list flush with the - // window's bottom edge and its last rows cut over the ledger. Padding - // here takes the room off the footprint before the plate is measured. - .pl(px(12.)) - .pt(px(8.)) - .pb(px(8.)) - // Bottom-left, not centred: the `?` control that opens this lives at - // the foot of the spine ([`spine`]'s last child), and this overlay - // mounts inside the *centre* column next to it -- anchoring the list - // to this column's own bottom-left edge puts it flush against the - // spine side, beside the control that opened it, instead of adrift - // in the middle of the bench/ledger footprint (user report). - .items_end() - // Click also dismisses (DESIGN §9): the hold-`?`-release above is - // the fast door, this is the same scrim-press-closes contract every - // other card's scrim answers, so a hand that let go of `?` before - // reading the list still has a way to shut it without the keyboard. - .on_mouse_down( - MouseButton::Left, - cx.listener(|this, _: &MouseDownEvent, _, cx| { - this.close_card(); - cx.notify(); - cx.stop_propagation(); - }), - ) - .child( - div() - .id("stance-keys-list") - // Capped to the bench+ledger footprint less the scrim's own - // inset, so the bottom border is on screen and the rows - // scroll inside it (DESIGN §9). - .h(px((bench_h + LEDGER_H - 16.).max(0.))) - .w(px(460.)) - .overflow_y_scroll() - .p(px(10.)) - .rounded(px(4.)) - .bg(rgb(DARK_PANEL())) - .border_1() - .border_color(rgba(DARK_SEAM())) - .on_mouse_down(MouseButton::Left, swallow) - .flex() - .flex_col() - .gap(px(3.)) - // DESIGN §8, no instructional copy: the heading is the - // single noun, and the way out is a chord on the right like - // every other row here -- not a sentence that lied anyway - // (a click-opened plate does not close on a release). - .child( - div() - .flex_none() - .flex() - .justify_between() - .gap(px(12.)) - .child(section_head("keys")) - .child( - div() - .type_style(type_scale::mono( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK3())) - .child("esc"), - ), - ) - .children(keys_rows().into_iter().map(|row| { - match row { - KeyRow::Head(category) => div() - .flex_none() - .pt(px(4.)) - .type_style(type_scale::head()) - .text_color(rgb(INK3())) - .child(category.label().to_uppercase()) - .into_any_element(), - KeyRow::Act(action) => div() - .flex() - .justify_between() - .gap(px(12.)) - .child( - div() - .type_style(type_scale::label( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK2())) - .child(action.label()), - ) - .child( - div() - .type_style(type_scale::mono( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK3())) - // The keys overlay is the full-truth surface - // (FAULT 1): every chord an action answers to, - // not the badge's primary-only compact form. - .child(player.keymap.display(action)), - ) - .into_any_element(), - KeyRow::Fixed(i) => { - let f = &keymap::FIXED[i]; - div() - .flex() - .justify_between() - .gap(px(12.)) - .child( - div() - .type_style(type_scale::label( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK2())) - .child(f.label), - ) - .child( - div() - .type_style(type_scale::mono( - type_scale::CHORD_METADATA_MIN_PX, - gpui::FontWeight::MEDIUM, - )) - .text_color(rgb(INK3())) - .child(f.chord.clone()), - ) - .into_any_element() - } - } - })), - ) + // Every command wears its chord (DESIGN §4) -- except the one whose + // glyph already IS its stroke: `?` over `?` read as two question + // marks on the rail and the user asked why ("why two ? exists"). + // A badge that only repeats the glyph says nothing, so it is not + // drawn; every other ghost still wears its chord under it. + .when(player.keymap.chord(action) != glyph, |el| { + el.child( + div() + .type_style(type_scale::mono( + type_scale::CHORD_METADATA_MIN_PX, + gpui::FontWeight::MEDIUM, + )) + .text_color(rgb(INK3())) + // FAULT 1: the badge shows the primary chord, compact -- + // same rule as every glyph in `spine_stance`. + .child(player.keymap.chord(action)), + ) + }) } /// The spine: 56px, left, full height. Frame only -- grouped rows, task /// frequency, glyph-over-chord grammar and every click all live in /// [`crate::ui::spine_stance`] now (MOCK-SPEC.md "Spine"); this fn keeps /// the panel's own surface and the `?` row, which stays part of the frame -/// since it opens [`keys_overlay`] right here rather than through `act`. +/// since it swings the dock to its KEYS tab right here rather than through +/// `act`. fn spine(player: &Player, cx: &mut Context) -> impl IntoElement { div() .id("stance-spine") @@ -983,18 +820,28 @@ pub(crate) fn render( Player::discard_sidecar(&sidecar); } } - // DESIGN §9: "`?` held ... surfaces chords ... release restores. - // No modal cheat-sheet." Opened here, ahead of the modal guard - // below (which would otherwise swallow a second `?` down once - // `keys_open` is already true) -- `on_key_up` is the only thing - // that closes it, so there is no latch to fall through to. + // DESIGN §9 as amended 2026-09-09: `?` swings the dock to its + // KEYS tab and a second `?` swings it back -- no plate, no hold, + // no modal cheat-sheet. Asked ahead of the modal guard below so + // the stroke is heard whatever else is up, and toggling here + // rather than latching is what makes the same key the way out. if key == "?" && !ctrl { - if !this.keys_open { - this.show_actions(cx); + match this.keys_open { + true => this.keys_open = false, + false => this.show_actions(cx), } cx.notify(); return; } + // The other way back to the tab underneath (the tab strip being + // the third): only when no card is up, so escape still shuts a + // card first -- the KEYS tab is a dock tab now, not an overlay, + // and nothing about it owns the keyboard. + if key == "escape" && this.keys_open && !this.card_open() { + this.keys_open = false; + cx.notify(); + return; + } // The dock's Sources filter (MOCK-SPEC "Dock" §2), the same door // legacy `render.rs` gives it: owns the keyboard only while it // was clicked into (`dock_stance.rs` sets `dock_filter_edit` on @@ -1113,16 +960,6 @@ pub(crate) fn render( this.act(action, window, cx); } })) - // The release half of the `?` hold above: whatever opened it, this is - // the one thing that closes it -- there is nothing else in the - // darkroom that sets `keys_open` true, so this cannot close a card - // `?` did not open. - .on_key_up(cx.listener(|this, event: &KeyUpEvent, _, cx| { - if event.keystroke.key.as_str() == "?" { - this.keys_open = false; - cx.notify(); - } - })) // The seam drag is tracked on the root, same reason the legacy // ruler-scrub is (render.rs): the pointer outruns the 6px divider // hitbox on the first move, so only the whole-window root keeps @@ -1171,9 +1008,6 @@ pub(crate) fn render( .child(divider(Split::Bench, player.split_drag == Some(Split::Bench), cx)) .child(bench(player, bench_h, window, cx)) .child(ledger(player, position)) - .when(player.keys_open, |el| { - el.child(keys_overlay(player, bench_h, cx)) - }) .when(player.settings_open, |el| { el.child(settings_stance::render(player, window_size, cx)) })