diff --git a/crates/app/src/tests/cards.rs b/crates/app/src/tests/cards.rs index ae26023..cf1bec1 100644 --- a/crates/app/src/tests/cards.rs +++ b/crates/app/src/tests/cards.rs @@ -31,7 +31,17 @@ fn no_overlaid_state_in_the_stance_goes_modal_without_painting_something() { let guard_at = stance .find("if this.card_open()\n || this.context_menu.is_some()") .expect("the stance's modal guard"); - let guard = &stance[guard_at..guard_at + 1600]; + // Wide enough to span the whole guard block -- escape's + // `escape_closes_overlay` branch and its commentary sit above the + // any-key clears, and a scan window that ends before them read as the + // clears having been deleted (2026-08-27). + let guard = &stance[guard_at..guard_at + 3000]; + assert!( + guard.contains("escape_closes_overlay"), + "the modal guard's escape branch no longer routes through \ + Player::escape_closes_overlay -- the focus rings' own escape \ + branches call that same door, and the two must not diverge" + ); for field in [ "this.context_menu = None", "this.library_menu = None", diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index a181d49..45026c7 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2213,18 +2213,25 @@ fn the_darkroom_path_never_lets_a_notice_surface_reach_the_picture() { /// DESIGN §5/§11 check 6, the fourth occlusion defect (notice bar, export /// card, preview badge, now menus): every floating menu that can open above -/// the picture -- the clip context menu, the picker, the library menu -- must -/// size its scrolling list against `stance::menu_floor`'s room, not the raw -/// window. Sizing against the whole viewport is exactly the bug that shipped: -/// a menu taller than the bench/ledger/dock footprint got clamped by -/// `menu_at`'s own bottom-edge fit back up over the picture, because nothing -/// had told the list it only had the footprint to grow into. This pins the -/// general rule so the next surface someone floats -- a fourth menu, a fifth +/// the picture -- the clip context menu, the picker -- must size its +/// scrolling list against `stance::menu_floor`'s room, not the raw window. +/// Sizing against the whole viewport is exactly the bug that shipped: a menu +/// taller than the bench/ledger/dock footprint got clamped by `menu_at`'s +/// own bottom-edge fit back up over the picture, because nothing had told +/// the list it only had the footprint to grow into. This pins the general +/// rule so the next surface someone floats -- a fourth menu, a fifth /// occlusion -- cannot silently reintroduce `menu_rows_h(rows.len(), /// viewport)` in its place. +/// +/// The library menu is the deliberate exception (user 2026-08-27, "right +/// clicking a library media opens a menu in somewhere nonsense"): it anchors +/// to a pointer that is always inside the dock, where no picture exists to +/// protect, and `menu_floor`'s clamp teleported it down to the picture floor +/// -- so `ui/library.rs` must open at the pointer through `menu_at` alone, +/// and this guard pins that it never routes back through `menu_floor`. #[test] fn every_darkroom_menu_sizes_its_list_against_the_floor_room_not_the_raw_viewport() { - for file in ["ui/overlays.rs", "ui/library.rs"] { + for file in ["ui/overlays.rs"] { let text = src_text(file); assert!( !text.contains("menu_rows_h(rows.len(), viewport)"), @@ -2245,6 +2252,18 @@ fn every_darkroom_menu_sizes_its_list_against_the_floor_room_not_the_raw_viewpor "{file} no longer opens any menu -- update this guard" ); } + let library = src_text("ui/library.rs"); + assert!( + !library.contains("menu_floor("), + "ui/library.rs routes its menu through menu_floor's picture-floor \ + clamp again -- a right-click high in the dock teleports back down \ + to the picture floor (the 'menu in somewhere nonsense' defect)" + ); + assert!( + library.contains("menu_at(menu.at, viewport"), + "ui/library.rs no longer anchors its menu to the pointer through \ + menu_at -- update this guard" + ); } /// The settings page's own organising rule: PROJECT rows open only the diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index 0c17c91..6ce483f 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -626,10 +626,26 @@ fn source_row( /// dialect from Media/Audio. Hands back the track count for the tab header's /// own count line, same as `rows.len()` does for the other two tabs. fn subtitle_tab_rows(player: &Player, cx: &mut Context) -> (usize, Vec) { - let groups = match player.session.as_ref() { + let mut groups = match player.session.as_ref() { Some(session) => subtitle_rows(session.subtitles()), None => Vec::new(), }; + // The same search box the other two tabs answer to -- a visible filter + // that a whole tab ignored would be a dead control. It matches a track's + // label or its file's name; a group with no surviving track leaves with + // its rows. + let filter = player.dock_filter.to_lowercase(); + if !filter.is_empty() { + for group in &mut groups { + if group.name.to_lowercase().contains(&filter) { + continue; + } + group + .rows + .retain(|row| row.label.to_lowercase().contains(&filter)); + } + groups.retain(|group| !group.rows.is_empty()); + } // Which lane(s) actually hold each track's captions right now -- the // row's second line answers "is it showing?", so it has to read the // timeline, not stay the literal "not placed" it was born saying (the