Collapse Sources dock chrome — one sort cycle chip, no header counters
Browse files at this commitbcc4dda02369ed9dfcd59b700181d8c019fde0a4Parent: 067620b- ui
- collapse Sources dock chrome — one sort cycle chip, no header counters
1 changed file +48 -38
- crates/app/src/ui/dock_stance.rs +48 -38
crates/app/src/ui/dock_stance.rsmodified+48 -38
| @@ -95,6 +95,15 @@ impl DockSort { | |||
| 95 | DockSort::Unused => "Unused", | 95 | DockSort::Unused => "Unused", |
| 96 | } | 96 | } |
| 97 | } | 97 | } |
| 98 | + | ||
| 99 | + /// The next chip in the cycle, wrapping back to `Recent` -- the whole | ||
| 100 | + /// row collapsed to one ghost control that cycles on click instead of | ||
| 101 | + /// four chips fighting for the same line (user 2026-08-27: "too much | ||
| 102 | + /// chrome"). | ||
| 103 | + fn next(self) -> DockSort { | ||
| 104 | + let idx = Self::ALL.iter().position(|s| *s == self).unwrap_or(0); | ||
| 105 | + Self::ALL[(idx + 1) % Self::ALL.len()] | ||
| 106 | + } | ||
| 98 | } | 107 | } |
| 99 | 108 | ||
| 100 | /// A ghost verb (DESIGN §4): borderless glyph/label in `ink2`, its chord in | 109 | /// A ghost verb (DESIGN §4): borderless glyph/label in `ink2`, its chord in |
| @@ -880,10 +889,18 @@ fn sources_tab( | |||
| 880 | .gap(px(6.)) | 889 | .gap(px(6.)) |
| 881 | .p(px(8.)) | 890 | .p(px(8.)) |
| 882 | .overflow_y_scroll() | 891 | .overflow_y_scroll() |
| 883 | - .child(section_head(format!( | 892 | + .child({ |
| 884 | - "{} · {total} · {unused_count} UNUSED", | 893 | + let style = head(); |
| 885 | - player.library_tab.label().to_uppercase() | 894 | + let hint: SharedString = format!("{total} total · {unused_count} unused").into(); |
| 886 | - ))) | 895 | + div() |
| 896 | + .id("dock-header") | ||
| 897 | + .flex_none() | ||
| 898 | + .font(style.font) | ||
| 899 | + .text_size(style.size) | ||
| 900 | + .text_color(rgb(INK3())) | ||
| 901 | + .tooltip(move |_, cx| cx.new(|_| Tip(hint.clone())).into()) | ||
| 902 | + .child(player.library_tab.label().to_uppercase()) | ||
| 903 | + }) | ||
| 887 | .child({ | 904 | .child({ |
| 888 | let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM); | 905 | let style = mono(type_scale::CHORD_METADATA_MAX_PX, FontWeight::MEDIUM); |
| 889 | div() | 906 | div() |
| @@ -943,42 +960,35 @@ fn sources_tab( | |||
| 943 | .child(tab.label()) | 960 | .child(tab.label()) |
| 944 | })), | 961 | })), |
| 945 | ) | 962 | ) |
| 946 | - .child( | 963 | + .child({ |
| 964 | + let current = player.dock_sort; | ||
| 965 | + let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | ||
| 947 | div() | 966 | div() |
| 967 | + .id("dock-sort-cycle") | ||
| 948 | .flex_none() | 968 | .flex_none() |
| 949 | - .flex() | 969 | + .px(px(6.)) |
| 950 | - .gap(px(4.)) | 970 | + .py(px(2.)) |
| 951 | - .children(DockSort::ALL.map(|sort| { | 971 | + .rounded(px(3.)) |
| 952 | - let on = sort == player.dock_sort; | 972 | + .font(style.font) |
| 953 | - let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | 973 | + .text_size(style.size) |
| 954 | - div() | 974 | + .text_color(rgb(INK2())) |
| 955 | - .id(("dock-sort", sort as usize)) | 975 | + .cursor_pointer() |
| 956 | - .flex_none() | 976 | + .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) |
| 957 | - .px(px(6.)) | 977 | + .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { |
| 958 | - .py(px(2.)) | 978 | + this.dock_sort = this.dock_sort.next(); |
| 959 | - .rounded(px(3.)) | 979 | + cx.notify(); |
| 960 | - .font(style.font) | 980 | + })) |
| 961 | - .text_size(style.size) | 981 | + .children(hitmap::dynamic( |
| 962 | - .when(on, |d| d.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) | 982 | + move || { |
| 963 | - .when(!on, |d| d.text_color(rgb(INK3()))) | 983 | + ( |
| 964 | - .cursor_pointer() | 984 | + "dock.sort.cycle".to_string(), |
| 965 | - .hover(|s| s.bg(rgb(DARK_RAISED()))) | 985 | + format!("Sort: {} — click to cycle", current.label()), |
| 966 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | 986 | + ) |
| 967 | - this.dock_sort = sort; | 987 | + }, |
| 968 | - cx.notify(); | 988 | + true, |
| 969 | - })) | 989 | + )) |
| 970 | - .children(hitmap::dynamic( | 990 | + .child(format!("↕ {}", current.label())) |
| 971 | - move || { | 991 | + }) |
| 972 | - ( | ||
| 973 | - format!("dock.sort.{}", sort.label()), | ||
| 974 | - format!("Sort {}", sort.label()), | ||
| 975 | - ) | ||
| 976 | - }, | ||
| 977 | - true, | ||
| 978 | - )) | ||
| 979 | - .child(sort.label()) | ||
| 980 | - })), | ||
| 981 | - ) | ||
| 982 | .child( | 992 | .child( |
| 983 | div() | 993 | div() |
| 984 | .id("dock-source-rows") | 994 | .id("dock-source-rows") |