shell: add widget: entries to the builtin's [bar.slots] (Phase 3b)

Reproduces breadbar's now-removed fixed Lua-widget interleave
(right-of-workspaces, left/right-of-clock, left-of-stats) as explicit
widget: slot entries, so the builtin theme still renders pixel-identical
to today's bar under breadbar's new theme-driven widget placement.
`tray` deliberately has no slot entry anywhere — it stays in the
control-panel popover regardless of [bar.slots].

Updates the one test asserting the builtin's slot contents.
This commit is contained in:
Breadway 2026-08-24 18:23:31 +08:00
parent 96aa6a513b
commit 92d3362a6b
2 changed files with 18 additions and 5 deletions

View file

@ -57,9 +57,16 @@ keyboard = "none"
layer = "top" layer = "top"
[bar.slots] [bar.slots]
left = ["workspaces"] # The `widget:*` entries reproduce breadbar's pre-Phase-3b fixed Lua-widget
centre = ["media", "clock"] # interleave exactly (main.rs's now-removed widget_right_of_workspaces /
right = ["volume", "wifi", "battery", "control"] # widget_left_of_clock / widget_right_of_clock / widget_left_of_stats), so
# this manifest still renders pixel-identically to today's bar. `tray`
# deliberately has NO slot entry anywhere — it lives in the control-panel
# popover, not the bar, and is keyed directly by breadbar regardless of
# `[bar.slots]`.
left = ["workspaces", "widget:right_of_workspaces"]
centre = ["media", "widget:left_of_clock", "clock", "widget:right_of_clock"]
right = ["widget:left_of_stats", "volume", "wifi", "battery", "control"]
drawer = [] drawer = []
[modules.workspaces] [modules.workspaces]

View file

@ -550,8 +550,14 @@ mod tests {
#[test] #[test]
fn builtin_slots_and_modules_are_trail_and_flip() { fn builtin_slots_and_modules_are_trail_and_flip() {
let theme = resolve_builtin(); let theme = resolve_builtin();
assert_eq!(theme.slots().left, vec!["workspaces"]); assert_eq!(
assert_eq!(theme.slots().centre, vec!["media", "clock"]); theme.slots().left,
vec!["workspaces", "widget:right_of_workspaces"]
);
assert_eq!(
theme.slots().centre,
vec!["media", "widget:left_of_clock", "clock", "widget:right_of_clock"]
);
assert!(matches!( assert!(matches!(
theme.modules().workspaces.style, theme.modules().workspaces.style,
WorkspaceStyle::Trail WorkspaceStyle::Trail