From 10659e7655497d6c82c522933d0ff12d119835c5 Mon Sep 17 00:00:00 2001 From: nandi Date: Wed, 25 Nov 2026 12:42:59 -0800 Subject: [PATCH] docs: what a running session can reload after an install (panel modules yes, host/compositor no) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01DPL5hjq2YbDd5zJXXKWqSR --- README.md | 4 ++-- docs/reloading.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 docs/reloading.md diff --git a/README.md b/README.md index d5cb8e9..afb1336 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ interface** with **deny-by-default capabilities**: Design: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) (Plasma to component mapping, permissions, versioning) and [docs/compositor-design.md](docs/compositor-design.md) (the compositor and its hosts). Toolchain notes: [docs/TOOLCHAIN.md](docs/TOOLCHAIN.md). Dark mode and the portal: [docs/dark-mode.md](docs/dark-mode.md). Running as root and run0: -[docs/run0.md](docs/run0.md). +[docs/run0.md](docs/run0.md). Picking up a new build without logging out: [docs/reloading.md](docs/reloading.md). ## How it runs @@ -189,7 +189,7 @@ host/ the original M0 browser/Node host (jco), kept for the comp session/ chandra-session, chandra-root, chandra.desktop, chandra.portal, install.py config/ desktop configs, themes, app list scripts/ setup-toolchain, build-*, gen-bindings, as-root, remote-build, test -docs/ ARCHITECTURE, compositor-design, TOOLCHAIN, run0, dark-mode, screenshots +docs/ ARCHITECTURE, compositor-design, TOOLCHAIN, run0, dark-mode, reloading, screenshots ``` ## License diff --git a/docs/reloading.md b/docs/reloading.md new file mode 100644 index 0000000..1e4c8b1 --- /dev/null +++ b/docs/reloading.md @@ -0,0 +1,37 @@ +# Picking up a new build in a running session + +After `just install-session` the files under `/usr/local` are new, but the running session keeps +what it loaded at startup. What can be swapped without logging out: + +| Part | Reload without logout? | How | +|---|---|---| +| Panel modules (`/usr/local/share/chandra/modules/*.wasm`) | yes | Settings → Panel: remove the module, add it again | +| `compositor.wasm` (shell, WM, portal backend) | no | restart the session | +| `chandra-host` (`wasmhost`) | no | restart the session | +| `config/`, themes, assets | not checked | restart the session to be sure | + +## Panel modules + +Modules are loaded by path. The shell's `load_path` reads the `.wasm` from disk each time, and +the host's `plasmoids` `load`/`unload` instantiate and drop it (`wasmhost/bin/plasmoids.mbt`). +A module asks for this through the `LoadModule` and `UnloadInstance` requests, handled in +`DesktopShell::process_requests` (`compositor/shell/widgets.mbt`). Settings → Panel (the module +selector, with reordering) and the "Add widget" file chooser are the UI for it. The loaded set and +its order are kept in `~/.config/chandra/panel.edn`. + +So after reinstalling, a module that changed is picked up by unloading and loading it again. A +module that imports no new host capability needs nothing else. + +## Not reloadable + +`chandra-host` and `compositor.wasm` are read once when `chandra-session` starts them. There is no +signal handler, reload request or file watcher for them. `docs/ARCHITECTURE.md` says so +("no hot reload on file change"), and the WM hot-swap in `docs/compositor-design.md` (replaying +`list` into a new WM component's `sync-windows`) is a design: nothing triggers it +yet. Changes to the compositor, WM, portal backend or host need a new session: log out and back +in. + +## Status + +Written from reading the code, not from a run: the Panel reload path has not been exercised +against an installed build. Correct this page if it behaves differently.