Merge branch 'worktree-agent-ae2606773b822491f'
Browse files at this commit1 changed file +32 -22
- crates/app/src/ui/dock_stance.rs +32 -22
crates/app/src/ui/dock_stance.rsmodified+32 -22
| @@ -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({ |
| 947 | - div() | 964 | + let current = player.dock_sort; |
| 948 | - .flex_none() | ||
| 949 | - .flex() | ||
| 950 | - .gap(px(4.)) | ||
| 951 | - .children(DockSort::ALL.map(|sort| { | ||
| 952 | - let on = sort == player.dock_sort; | ||
| 953 | let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); | 965 | let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM); |
| 954 | div() | 966 | div() |
| 955 | - .id(("dock-sort", sort as usize)) | 967 | + .id("dock-sort-cycle") |
| 956 | .flex_none() | 968 | .flex_none() |
| 957 | .px(px(6.)) | 969 | .px(px(6.)) |
| 958 | .py(px(2.)) | 970 | .py(px(2.)) |
| 959 | .rounded(px(3.)) | 971 | .rounded(px(3.)) |
| 960 | .font(style.font) | 972 | .font(style.font) |
| 961 | .text_size(style.size) | 973 | .text_size(style.size) |
| 962 | - .when(on, |d| d.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) | 974 | + .text_color(rgb(INK2())) |
| 963 | - .when(!on, |d| d.text_color(rgb(INK3()))) | ||
| 964 | .cursor_pointer() | 975 | .cursor_pointer() |
| 965 | - .hover(|s| s.bg(rgb(DARK_RAISED()))) | 976 | + .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) |
| 966 | - .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { | 977 | + .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { |
| 967 | - this.dock_sort = sort; | 978 | + this.dock_sort = this.dock_sort.next(); |
| 968 | cx.notify(); | 979 | cx.notify(); |
| 969 | })) | 980 | })) |
| 970 | .children(hitmap::dynamic( | 981 | .children(hitmap::dynamic( |
| 971 | move || { | 982 | move || { |
| 972 | ( | 983 | ( |
| 973 | - format!("dock.sort.{}", sort.label()), | 984 | + "dock.sort.cycle".to_string(), |
| 974 | - format!("Sort {}", sort.label()), | 985 | + format!("Sort: {} — click to cycle", current.label()), |
| 975 | ) | 986 | ) |
| 976 | }, | 987 | }, |
| 977 | true, | 988 | true, |
| 978 | )) | 989 | )) |
| 979 | - .child(sort.label()) | 990 | + .child(format!("↕ {}", current.label())) |
| 980 | - })), | 991 | + }) |
| 981 | - ) | ||
| 982 | .child( | 992 | .child( |
| 983 | div() | 993 | div() |
| 984 | .id("dock-source-rows") | 994 | .id("dock-source-rows") |