From 47adb87c2a40ab5c6ca7685d82e714bc927cca63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 15:51:28 +0300 Subject: [PATCH] test(app): the dock keeps a decoder refusal where it drops a seat The dock's metadata line drops the decoder seat (`HW`, `SW`, ...) from the row detail -- the transport line and the Properties side both still say it, so the row says what the file *is*. That filter is what decides whether a refusal survives to the row, and it was inline, so nothing could say. `without_seats` is the same expression, named: a whole part is dropped only when it is exactly a seat's word, so a file the decoder refused reaches the dock whole. Witness drives the real predicate over a real refusal, and fails when the split is mutated off the separator. --- crates/app/src/tests/layout.rs | 71 ++++-- crates/app/src/ui/dock_stance.rs | 378 ++++++++++++++++++++----------- 2 files changed, 297 insertions(+), 152 deletions(-) diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 3620196..ebe162a 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -351,7 +351,7 @@ fn a_lane_row_is_a_fixed_header_and_a_bed_that_can_be_hit() { /// strip's row at the zoom boundary without the strip to show for it. #[test] fn the_scroll_strip_row_comes_and_goes_with_the_zoom() { - use crate::{lanes_h, split_size, timeline_fixed_h, timeline_h, Split, SCROLL_HIT}; + use crate::{SCROLL_HIT, Split, lanes_h, split_size, timeline_fixed_h, timeline_h}; use gpui::{px, size}; // The strip's row, and only the strip's row, is what the two faces differ @@ -398,8 +398,8 @@ fn the_scroll_strip_row_comes_and_goes_with_the_zoom() { /// on the track, the time axis's own thumb turned through a right angle. #[test] fn the_lane_thumb_is_the_visible_share_of_the_stack() { - use crate::lanes_thumb; use crate::SCROLL_THUMB_MIN; + use crate::lanes_thumb; // Whole stack on screen: the track fills and there is nothing to scroll. assert_eq!(lanes_thumb(200., 104., 200., 0.), (0., 200.)); @@ -1301,7 +1301,7 @@ fn the_darkroom_subtitle_palette_drags_tracks_to_subtitle_lanes() { /// arrival order, at the end. #[test] fn a_file_subtitle_group_follows_its_own_row() { - use crate::ui::dock_stance::{source_list_order, Slot}; + use crate::ui::dock_stance::{Slot, source_list_order}; let film = PathBuf::from("/films/a.mkv"); let other = PathBuf::from("/rec/b.mp4"); let loose = PathBuf::from("/subs/late.srt"); @@ -1798,8 +1798,8 @@ fn darkroom_lane_header_verbs_are_targeted_and_visible() { fn a_dragged_divider_stops_before_either_panel_disappears() { use crate::ui::theme::INSPECTOR_MIN_W; use crate::{ - inspector_w, library_w, split_drag_size, split_size, timeline_fixed_h, timeline_h, Split, - SIDE_MAX_FRAC, SPLIT_W, TIMELINE_MAX_SHARE, TOOLBAR_H, + SIDE_MAX_FRAC, SPLIT_W, Split, TIMELINE_MAX_SHARE, TOOLBAR_H, inspector_w, library_w, + split_drag_size, split_size, timeline_fixed_h, timeline_h, }; use gpui::{point, px, size}; @@ -1919,7 +1919,7 @@ fn a_dragged_divider_stops_before_either_panel_disappears() { fn the_darkroom_seams_stop_before_either_side_disappears() { use crate::ui::theme::INSPECTOR_MIN_W; use crate::{ - split_bounds, split_drag_size, split_size, Split, BENCH_MIN_H, SIDE_MAX_FRAC, SPLIT_W, + BENCH_MIN_H, SIDE_MAX_FRAC, SPLIT_W, Split, split_bounds, split_drag_size, split_size, }; use gpui::{point, px, size}; @@ -1978,9 +1978,9 @@ fn the_darkroom_seams_stop_before_either_side_disappears() { /// ~2px at the old `BENCH_MIN_H = 80.`). #[test] fn both_default_lanes_fit_the_bench_at_its_floor() { - use crate::ui::bench_stance::{row_h, LANE_MIN_H, ROW_GAP, RULER_H}; - use crate::ui::stance::BENCH_CHROME_H; use crate::BENCH_MIN_H; + use crate::ui::bench_stance::{LANE_MIN_H, ROW_GAP, RULER_H, row_h}; + use crate::ui::stance::BENCH_CHROME_H; let box_h = BENCH_MIN_H - BENCH_CHROME_H; let avail = box_h - RULER_H - ROW_GAP; @@ -2020,9 +2020,9 @@ fn both_default_lanes_fit_the_bench_at_its_floor() { /// painted bounds back, so it stays geometry-only, same as its neighbours. #[test] fn the_whole_bench_stack_fits_its_own_floor_with_the_ledger_seam_clear() { + use crate::BENCH_MIN_H; use crate::ui::bench_stance::{LANE_MIN_H, ROW_GAP, RULER_H}; use crate::ui::stance::BENCH_CHROME_H; - use crate::BENCH_MIN_H; const BENCH_BORDER_T: f32 = 1.; const BENCH_PY_TOP: f32 = 4.; @@ -2092,9 +2092,9 @@ fn a_lane_row_fits_what_its_own_head_draws() { #[test] fn a_saved_seam_survives_a_reload() { use crate::{ - load_stance_splits_from, save_stance_splits_to, Split, Splits, BENCH_MIN_H, SIDE_MAX_FRAC, + BENCH_MIN_H, SIDE_MAX_FRAC, Split, Splits, load_stance_splits_from, save_stance_splits_to, }; - use gpui::{px, size, Pixels, Size}; + use gpui::{Pixels, Size, px, size}; let dir = engine::scratch::Scratch::dir("edith-stance-splits"); let path = dir.join("stance-splits"); @@ -2137,7 +2137,7 @@ fn a_saved_seam_survives_a_reload() { /// drag that never started (`None`) owes nothing. #[test] fn only_the_persisted_seams_owe_a_save_when_a_drag_loses_the_window() { - use crate::{player::timeline_edit::split_drag_owes_save, Split}; + use crate::{Split, player::timeline_edit::split_drag_owes_save}; assert!(split_drag_owes_save(Some(Split::Dock))); assert!(split_drag_owes_save(Some(Split::Bench))); @@ -2151,8 +2151,8 @@ fn only_the_persisted_seams_owe_a_save_when_a_drag_loses_the_window() { /// `load_stance_splits`'s doc comment promises. #[test] fn a_missing_stance_splits_file_leaves_every_region_at_its_default() { - use crate::{load_stance_splits_from, Split}; - use gpui::{px, size, Pixels, Size}; + use crate::{Split, load_stance_splits_from}; + use gpui::{Pixels, Size, px, size}; let dir = engine::scratch::Scratch::dir("edith-stance-splits-missing"); let window: Size = size(px(1280.), px(720.)); @@ -2993,7 +2993,7 @@ fn the_bench_answers_a_wheel_notch_anywhere_over_it() { /// kept beside the first ([`Splits::clear`]). #[test] fn a_double_pressed_divider_forgets_the_size_it_was_dragged_to() { - use crate::layout::{split_size, Split, Splits}; + use crate::layout::{Split, Splits, split_size}; use gpui::{px, size}; let window = size(px(1280.), px(720.)); @@ -3083,7 +3083,7 @@ fn the_bench_seam_reaches_no_further_than_every_other_seam() { /// `bench=105` at the floor, `bench=1164` at the ceiling. #[test] fn the_bench_seam_stops_at_its_floor_and_its_ceiling() { - use crate::{split_bounds, split_size, Split, BENCH_MIN_H}; + use crate::{BENCH_MIN_H, Split, split_bounds, split_size}; use gpui::{px, size}; let window = size(px(2560.), px(1440.)); @@ -3197,6 +3197,41 @@ fn a_source_row_shows_its_name_before_anything_else() { ); } +/// The dock's metadata line drops the decoder *seat* and nothing else. A file +/// the decoder refused has no seat to drop: its detail is the refusal, and it +/// is the only thing the line has to say. +#[test] +fn the_dock_keeps_a_refusal_where_it_drops_a_seat() { + use crate::ui::dock_stance::without_seats; + use engine::decode::Backend; + + let seats = [ + Backend::Opening, + Backend::Hardware, + Backend::Software, + Backend::Still, + Backend::Gap, + ] + .map(Backend::label); + assert_eq!( + without_seats("h264 · HW", &seats), + "h264", + "the seat is how this machine reads it, and the row says what the file is" + ); + let refusal = "no Segment element: not a Matroska file"; + assert_eq!( + without_seats(refusal, &seats), + refusal, + "a refusal is not a seat, and reaches the row whole" + ); + // The halves keep their separator either way: a stream detail beside a + // refusal is still two things said in order. + assert_eq!( + without_seats(&format!("{refusal} · stereo · 48 kHz"), &seats), + format!("{refusal} · stereo · 48 kHz") + ); +} + /// A room key pressed while the ring sits in the dock has to reach the room. /// Two ways it did not: the dock's own handler could stop a key it does not /// answer, and the body the dock mounts could leave the focused @@ -3400,8 +3435,8 @@ fn the_ledger_carries_the_rooms_four_verbs_and_no_rail_remains() { /// deletion. #[test] fn select_all_left_the_ruler_for_the_rulers_own_menu() { - use crate::menus::BENCH_ITEMS; use crate::ActionId; + use crate::menus::BENCH_ITEMS; let bench = src_text("ui/bench_stance.rs"); for gone in ["bench-select-all", "select_all_band", "SELECT_ALL_PAD"] { assert!(!bench.contains(gone), "the ruler still carries {gone}"); @@ -3873,7 +3908,7 @@ fn the_export_section_is_four_rows_and_no_fifth() { /// cannot write, because [`Player::set_format`] would only refuse it back. #[test] fn the_picture_row_cycles_codec_and_container_together_and_skips_a_refusal() { - use crate::ui::settings_stance::{next_picture, picture_label, PICTURE_CYCLE}; + use crate::ui::settings_stance::{PICTURE_CYCLE, next_picture, picture_label}; assert_eq!( PICTURE_CYCLE, [ diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index 4a0e869..0be77ad 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -185,7 +185,11 @@ fn dock_tab( } cx.notify(); })) - .tooltip(crate::ui::widgets::tip_hover(&format!("Show {}", label_text.to_lowercase()), "", None)) + .tooltip(crate::ui::widgets::tip_hover( + &format!("Show {}", label_text.to_lowercase()), + "", + None, + )) .children(hitmap::control(id, label_text, true)) .child( div() @@ -232,6 +236,25 @@ fn usage_line(player: &Player, source_idx: usize, placed: usize) -> String { lanes.join(" ") } +/// A row's detail line with the decoder seats taken out of it, which is what +/// the dock draws: the seat is how this machine happens to read the file and +/// the transport line and the Properties side both still say it, so the row +/// says what the file *is* instead. +/// +/// Only a whole part is dropped, and a part is a seat only when it is exactly +/// a seat's word. That is what keeps a refusal: the row's detail for a file +/// the decoder would not take is the refusal itself +/// ([`crate::Decoder::Refused`]), and no seat is ever named by a sentence -- +/// so the one line that has to say why the file will not play reaches the +/// dock whole. +pub(crate) fn without_seats(detail: &str, seats: &[&str]) -> String { + detail + .split(" · ") + .filter(|part| !seats.contains(part)) + .collect::>() + .join(" · ") +} + /// The file's name without its extension -- what the editor calls the film, /// not what the filesystem calls the bytes (cleanse round 2). A row that /// names several streams of one file keeps the stream half it was given @@ -281,12 +304,7 @@ fn source_row( Backend::Gap, ] .map(Backend::label); - let detail = row - .detail - .split(" · ") - .filter(|part| !seats.contains(part)) - .collect::>() - .join(" · "); + let detail = without_seats(&row.detail, &seats); let under: String = match &row.unusable { Some(why) => why.clone(), None => join_detail( @@ -690,15 +708,15 @@ fn subtitle_tab_rows( .on_drag(SubPick(track), { let me = cx.entity(); move |_, _, _, cx| { - // A fresh gesture inherits nothing: `Player::drag_lane` - // and `Player::drag_x` are the *last live sample* of the - // drag being made, and a drag whose first sample lands - // outside every row would otherwise be let go onto the - // lane the previous one ended over. - me.update(cx, |this, _| { - this.drag_lane = None; - this.drag_x = None; - }); + // A fresh gesture inherits nothing: `Player::drag_lane` + // and `Player::drag_x` are the *last live sample* of the + // drag being made, and a drag whose first sample lands + // outside every row would otherwise be let go onto the + // lane the previous one ended over. + me.update(cx, |this, _| { + this.drag_lane = None; + this.drag_x = None; + }); cx.new(|_| Tip(ghost.clone())) } }) @@ -707,7 +725,11 @@ fn subtitle_tab_rows( cx.notify(); })) }) - .tooltip(crate::ui::widgets::tip_hover("Subtitle track", "drag to a lane", None)) + .tooltip(crate::ui::widgets::tip_hover( + "Subtitle track", + "drag to a lane", + None, + )) .children(hitmap::dynamic( move || { ( @@ -777,7 +799,11 @@ fn subtitle_tab_rows( cx.stop_propagation(); this.remove_subtitle_track(track, cx); })) - .tooltip(crate::ui::widgets::tip_hover("Remove subtitle track", "", None)) + .tooltip(crate::ui::widgets::tip_hover( + "Remove subtitle track", + "", + None, + )) .children(hitmap::dynamic( move || { ( @@ -794,78 +820,79 @@ fn subtitle_tab_rows( let has_header = !nested || track_count > 3; let folded = has_header && (nested != player.sub_folded.contains(&group_path)); let header = div() - .id(("dock-subtitle-group", group_ord)) - .flex_none() - .flex() - .items_center() - .gap(px(6.)) - .px(px(8.)) - // Stepped in under its parent when it has one, the - // same outline the track rows below it read as. - .when(nested, |d| d.pl(px(22.))) - .py(px(4.)) - .rounded(px(3.)) - .cursor_pointer() - .hover(|s| s.bg(rgb(DARK_RAISED()))) - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { - if !this.sub_folded.remove(&fold_path) { - this.sub_folded.insert(fold_path.clone()); - } - cx.notify(); - })) - .tooltip(crate::ui::widgets::tip_hover("Fold this source", "click", None)) - .children(hitmap::dynamic( - move || { - ( - format!("subtitle-group.{group_ord}.fold"), - "Toggle subtitle group".into(), - ) - }, - true, - )) - // Bare, the glyph inherited the panel's dim ink and - // vanished ("the little arrow on left side is hard - // to see", user 2026-08-27) -- it reads at the same - // ink as the name it folds. - .child( - div() - .flex_none() - .w(px(10.)) - .text_color(rgb(INK1())) - .child(if folded { "▸" } else { "▾" }), - ) - .when_some(tint, |d, tint| { - d.child( - div() - .flex_none() - .w(px(8.)) - .h(px(8.)) - .rounded(px(4.)) - .bg(rgb(tint)), - ) - }) - .child( - div() - .flex_1() - .min_w(px(0.)) - .truncate() - .type_style(mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM)) - .text_color(rgb(INK1())) - .child(group.name), + .id(("dock-subtitle-group", group_ord)) + .flex_none() + .flex() + .items_center() + .gap(px(6.)) + .px(px(8.)) + // Stepped in under its parent when it has one, the + // same outline the track rows below it read as. + .when(nested, |d| d.pl(px(22.))) + .py(px(4.)) + .rounded(px(3.)) + .cursor_pointer() + .hover(|s| s.bg(rgb(DARK_RAISED()))) + .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { + if !this.sub_folded.remove(&fold_path) { + this.sub_folded.insert(fold_path.clone()); + } + cx.notify(); + })) + .tooltip(crate::ui::widgets::tip_hover( + "Fold this source", + "click", + None, + )) + .children(hitmap::dynamic( + move || { + ( + format!("subtitle-group.{group_ord}.fold"), + "Toggle subtitle group".into(), ) - .child( - div() - .flex_none() - .type_style(mono( - type_scale::CHORD_METADATA_MIN_PX, - FontWeight::MEDIUM, - )) - .text_color(rgb(INK3())) - .child(format!( - "{track_count} track{}", - if track_count == 1 { "" } else { "s" } - )), - ); + }, + true, + )) + // Bare, the glyph inherited the panel's dim ink and + // vanished ("the little arrow on left side is hard + // to see", user 2026-08-27) -- it reads at the same + // ink as the name it folds. + .child( + div() + .flex_none() + .w(px(10.)) + .text_color(rgb(INK1())) + .child(if folded { "▸" } else { "▾" }), + ) + .when_some(tint, |d, tint| { + d.child( + div() + .flex_none() + .w(px(8.)) + .h(px(8.)) + .rounded(px(4.)) + .bg(rgb(tint)), + ) + }) + .child( + div() + .flex_1() + .min_w(px(0.)) + .truncate() + .type_style(mono(type_scale::LABEL_ROW_PX, FontWeight::MEDIUM)) + .text_color(rgb(INK1())) + .child(group.name), + ) + .child( + div() + .flex_none() + .type_style(mono(type_scale::CHORD_METADATA_MIN_PX, FontWeight::MEDIUM)) + .text_color(rgb(INK3())) + .child(format!( + "{track_count} track{}", + if track_count == 1 { "" } else { "s" } + )), + ); ( group_path, track_count, @@ -1033,7 +1060,11 @@ fn sources_tab( this.dock_filter_edit = true; cx.notify(); })) - .tooltip(crate::ui::widgets::tip_hover("Filter sources", "type to narrow", None)) + .tooltip(crate::ui::widgets::tip_hover( + "Filter sources", + "type to narrow", + None, + )) .children(hitmap::control("dock.filter", "Filter sources", true)) // The glass alone at rest: the word "filter" beside it was // the box telling the editor what a filter box is (DESIGN §8). @@ -1160,7 +1191,11 @@ fn transition_row(player: &Player, cx: &mut Context) -> Option) -> impl .flex() .items_center() .child(chip("dock-viz-colour", "Colour", VizSlot::Main, true)) - .child(chip("dock-viz-strand", "Strand", VizSlot::Strand, strand_live)) + .child(chip( + "dock-viz-strand", + "Strand", + VizSlot::Strand, + strand_live, + )) } /// The picked slot's colour as text, and the way in: a click opens the type-in @@ -1395,7 +1435,11 @@ fn viz_hex_row(player: &Player, paint: u64, cx: &mut Context) -> impl In .text_size(row.size) .text_color(rgb(INK2())) .cursor_pointer() - .tooltip(crate::ui::widgets::tip_hover("Colour", "click to type", None)) + .tooltip(crate::ui::widgets::tip_hover( + "Colour", + "click to type", + None, + )) .children(hitmap::control( "dock-viz-hex-field", "Colour hex, type-in", @@ -1424,7 +1468,11 @@ fn viz_color_wheel(player: &Player, paint: u64, cx: &mut Context) -> imp .h(px(112.)) .relative() .cursor_pointer() - .tooltip(crate::ui::widgets::tip_hover("Colour wheel", "drag to pick", None)) + .tooltip(crate::ui::widgets::tip_hover( + "Colour wheel", + "drag to pick", + None, + )) .children(hitmap::control("dock-viz-hs", "Colour wheel", true)) .child(bounds_probe(player.viz_wheel.clone())) .child( @@ -1448,10 +1496,22 @@ fn viz_color_wheel(player: &Player, paint: u64, cx: &mut Context) -> imp let hue = i as f32 / wedges as f32 * 360.; let (r, g, b) = engine::decode::viz_hsv_rgb(hue, sat, 0.84); let color = (u32::from(r) << 16) | (u32::from(g) << 8) | u32::from(b); - let p00 = point(px(cx + radius * s0 * a0.sin()), px(cy - radius * s0 * a0.cos())); - let p01 = point(px(cx + radius * s0 * a1.sin()), px(cy - radius * s0 * a1.cos())); - let p11 = point(px(cx + radius * s1 * a1.sin()), px(cy - radius * s1 * a1.cos())); - let p10 = point(px(cx + radius * s1 * a0.sin()), px(cy - radius * s1 * a0.cos())); + let p00 = point( + px(cx + radius * s0 * a0.sin()), + px(cy - radius * s0 * a0.cos()), + ); + let p01 = point( + px(cx + radius * s0 * a1.sin()), + px(cy - radius * s0 * a1.cos()), + ); + let p11 = point( + px(cx + radius * s1 * a1.sin()), + px(cy - radius * s1 * a1.cos()), + ); + let p10 = point( + px(cx + radius * s1 * a0.sin()), + px(cy - radius * s1 * a0.cos()), + ); let mut path = PathBuilder::fill(); path.add_polygon(&[p00, p01, p11, p10], false); if let Ok(path) = path.build() { @@ -1523,9 +1583,20 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context) -> imp .text_color(rgb(INK2())) .child("Strands"), ) - .child(viz_step("dock-viz-strands-minus", "Fewer strands", "−", cx, |this, cx| { - this.set_viz_strands(engine::decode::viz_strands_of(this.viz_paint()).saturating_sub(1).max(1), cx); - })) + .child(viz_step( + "dock-viz-strands-minus", + "Fewer strands", + "−", + cx, + |this, cx| { + this.set_viz_strands( + engine::decode::viz_strands_of(this.viz_paint()) + .saturating_sub(1) + .max(1), + cx, + ); + }, + )) .child( div() .font(style.font.clone()) @@ -1533,9 +1604,20 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context) -> imp .text_color(rgb(INK1())) .child(format!("{strands}")), ) - .child(viz_step("dock-viz-strands-plus", "More strands", "+", cx, |this, cx| { - this.set_viz_strands(engine::decode::viz_strands_of(this.viz_paint()).saturating_add(1).min(32), cx); - })), + .child(viz_step( + "dock-viz-strands-plus", + "More strands", + "+", + cx, + |this, cx| { + this.set_viz_strands( + engine::decode::viz_strands_of(this.viz_paint()) + .saturating_add(1) + .min(32), + cx, + ); + }, + )), ) .child( div() @@ -1550,9 +1632,18 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context) -> imp .text_color(rgb(INK2())) .child("Glow"), ) - .child(viz_step("dock-viz-glow-minus", "Less glow", "−", cx, |this, cx| { - this.set_viz_glow(engine::decode::viz_glow_of(this.viz_paint()).saturating_sub(1), cx); - })) + .child(viz_step( + "dock-viz-glow-minus", + "Less glow", + "−", + cx, + |this, cx| { + this.set_viz_glow( + engine::decode::viz_glow_of(this.viz_paint()).saturating_sub(1), + cx, + ); + }, + )) .child( div() .font(style.font.clone()) @@ -1560,9 +1651,20 @@ fn viz_paint_knobs(player: &Player, paint: u64, cx: &mut Context) -> imp .text_color(rgb(INK1())) .child(format!("{glow}")), ) - .child(viz_step("dock-viz-glow-plus", "More glow", "+", cx, |this, cx| { - this.set_viz_glow(engine::decode::viz_glow_of(this.viz_paint()).saturating_add(1).min(16), cx); - })), + .child(viz_step( + "dock-viz-glow-plus", + "More glow", + "+", + cx, + |this, cx| { + this.set_viz_glow( + engine::decode::viz_glow_of(this.viz_paint()) + .saturating_add(1) + .min(16), + cx, + ); + }, + )), ) } @@ -1806,36 +1908,44 @@ fn keys_tab(player: &Player, cx: &mut Context) -> impl IntoElement { .font(style.font.clone()) .text_size(style.size) .text_color(rgb(INK1())) - .tooltip(crate::ui::widgets::tip_hover("Filter keys", "click to type", None)) + .tooltip(crate::ui::widgets::tip_hover( + "Filter keys", + "click to type", + None, + )) .children(hitmap::control("dock.keys-filter", "Filter keys", true)) .child(match player.keys_filter.is_empty() { true => "⌕".to_string(), false => format!("⌕ {filter_text}"), }) }) - .children(keys_rows_matching(&player.keys_filter, &player.keymap).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()) - } - })) + .children( + keys_rows_matching(&player.keys_filter, &player.keymap) + .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: