Settings module: Session, Desktop and Panel tabs; the module manager moves in
CI / test (push) Failing after 15s
CI / test (push) Failing after 15s
- The settings popup gets a tab bar, split by where things live: Session (the switches), Desktop
(what is drawn on the desktop: the wallpaper list under a "Wallpaper" heading) and Panel (what
the module manager showed: modules in the panel to remove, modules to add, Browse...).
Left/Right or 1/2/3 switch tabs; it reopens on the tab it was left on. Modules can't be placed
on the desktop yet (every wasm module lives in the panel; the desktop card is built in), so
the Desktop tab has no module section until they can.
- The standalone module-manager module and its world are removed; the settings module imports
`modules`. Saved panels listing "module-manager" get the settings module in its place.
- DesktopShell::open_settings(SettingsTab) opens the settings module on a tab (loading it into the
panel if needed), for the panel menu and "System settings" entries; the wasm picker
("Modules..." in the panel menu) is open_settings(Panel).
- Tests: the native picker test drives the Panel tab, the wallpaper and switch tests go through
the tabs, an open_settings test; the wasm and host-wasm module tests use the settings module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
This commit is contained in:
20 files changed
+316
-917
No files matched your search
@@ -620,21 +620,24 @@ mod tests {
|
||||
assert!(rt.popup(h).is_none());
|
||||
assert!(rt.on_event(h, false, InputEvent::PointerDown(Point { x: 5, y: 5 })));
|
||||
let p = rt.popup(h).expect("popup open");
|
||||
for n in names.iter().chain(walls.iter()).chain(["Wallpaper"].iter()) {
|
||||
for n in names.iter().chain(["Session", "Desktop", "Panel"].iter()) {
|
||||
assert!(texts(&p.ops).contains(&n.to_string()), "{n} listed");
|
||||
}
|
||||
assert!(rt.shared.borrow().requests.is_empty());
|
||||
// First row is on: a click asks to turn it off. Second row is off: a click asks for on.
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 6 + 5 })));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 40 + 13 })));
|
||||
assert!(matches!(rt.shared.borrow_mut().requests.pop_front(), Some(Req::SetSessionSetting(0, false))));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 6 + 30 + 5 })));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 40 + 28 + 13 })));
|
||||
assert!(matches!(rt.shared.borrow_mut().requests.pop_front(), Some(Req::SetSessionSetting(1, true))));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 6 + 2 * 30 + 5 })));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 40 + 2 * 28 + 13 })));
|
||||
assert!(matches!(rt.shared.borrow_mut().requests.pop_front(), Some(Req::SetSessionSetting(2, false))));
|
||||
// Row 3 is the "Wallpaper" heading (nothing); rows 4.. are the wallpapers: Starfield.
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 6 + 3 * 30 + 5 })));
|
||||
// The Desktop tab (second of three 96 px tabs): row 0 is the "Wallpaper" heading
|
||||
// (nothing), rows 1.. the wallpapers: Starfield.
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 6 + 96 + 48, y: 6 + 14 })));
|
||||
assert!(texts(&rt.popup(h).unwrap().ops).contains(&"Starfield".to_string()));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 40 + 13 })));
|
||||
assert!(rt.shared.borrow().requests.is_empty());
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 6 + 6 * 30 + 5 })));
|
||||
assert!(rt.on_event(h, true, InputEvent::PointerDown(Point { x: 20, y: 40 + 3 * 28 + 13 })));
|
||||
assert!(matches!(rt.shared.borrow_mut().requests.pop_front(), Some(Req::SetWallpaper(2))));
|
||||
// The list stays open; Escape closes it without another request.
|
||||
assert!(rt.popup(h).is_some());
|
||||
|
||||
Reference in new issue
Block a user