Settings > Panel: a cleaner module selector with reordering
CI / test (push) Failing after 17s

The Panel tab was one flat list: every panel module with an "x" that removed
it on any click, then every module on disk again with cryptic "x1" counts and
a Browse row that looked selected.

- "In the panel, left to right": the modules in panel order, each with
  move up / move down / remove buttons. Clicking the row itself does nothing,
  so a stray click no longer removes a module. Backspace/Delete removes the
  highlighted one, PageUp/PageDown move it.
- "Add to the panel": grouped (Apps and windows, System, Clocks, Other),
  each with a one-line description and an Add button. A module already in the
  panel is left out, except clocks, which offer "Add another". With nothing
  left: "Everything is in the panel".
- "Browse for a module file..." is a secondary outlined button.
- Section headings are larger and full contrast; the popup is 320 wide and
  now fits a 720-high screen with the default panel.

Reordering goes through a new modules.move-instance(slot, delta) capability
call, plumbed through both hosts: wasmer stub request 17, host-wasm, the
plasmoids host WIT (move-instance(instance-move)) and wasmhost. The shell's
move_slot clamps to the ends and saves panel.edn, so the saved format is
unchanged. DesktopShell::slot_popup_texts lets tests find popup rows by text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhRDWZf5WcmrNwnFe3
This commit is contained in:
Claude committed 2026-11-25 20:35:54 +00:00
1 parent c1936299cb
commit 8ecdef17d4
16 files changed
+514 -98

No files matched your search

+3
View File
@@ -253,6 +253,9 @@ impl chandra::host::plasmoids::Host for State {
Req::SetInspector(b) => R::SetInspector(b),
Req::LoadModule(s) => R::LoadModule(s),
Req::UnloadInstance(s) => R::UnloadInstance(s),
Req::MoveInstance(slot, delta) => {
R::MoveInstance(chandra::host::plasmoids::InstanceMove { slot, delta })
}
Req::Browse => R::Browse,
Req::Logout => R::Logout,
Req::SetWallpaper(n) => R::SetWallpaper(n),
+5
View File
@@ -42,6 +42,8 @@ pub enum Req {
SetInspector(bool),
LoadModule(String),
UnloadInstance(String),
/// Move a panel instance `delta` places (negative: towards the start).
MoveInstance(String, i32),
Browse,
Logout,
SetWallpaper(i32),
@@ -300,6 +302,9 @@ impl d::modules::Host for PState {
fn unload_instance(&mut self, slot: String) {
self.shared.borrow_mut().requests.push_back(Req::UnloadInstance(slot));
}
fn move_instance(&mut self, slot: String, delta: i32) {
self.shared.borrow_mut().requests.push_back(Req::MoveInstance(slot, delta));
}
fn browse(&mut self) {
self.shared.borrow_mut().requests.push_back(Req::Browse);
}