29 Commits
Author SHA1 Message Date
nandiandClaude Sonnet 5.5 ada9850b8d Fix the memory leak that filled RAM and swap; launch monitor, memory log
wasmhost leaked the arguments of every host call. wt_stub.c handed them to
the MoonBit dispatcher expecting it to own them, but the compiler borrowed
the parameter, so nothing released them (about 600 kB/s in a test with one
busy terminal; a long session reached over 16 GB resident plus swap).
MoonBit now allocates the buffer and C copies into it.

Also:
- Unannotated pointer FFI parameters default to #owned, and none of these C
  functions released theirs, including the native KMS present (a whole frame
  each). Annotated #borrow; the wasmhost build now fails on that warning,
  which --warn-list -a had hidden.
- Watched launches forked the whole compositor, and each monitor kept a
  snapshot of its heap for the app's lifetime. It now posix_spawns a fresh
  copy of the binary that takes over before main.
- The host logs memory, window buffers and images once a minute.
- chandra-session keeps the previous log as session.log.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hj5m35Lj6Rt9vwwLGZ
2026-11-26 17:10:47 -08:00
Claude 27252a97ab Emoji picker (Super+.): search, tabs, skin tones, recents, text-input-v3 insertion
CI / test (push) Canceled after 0s
Compositor-drawn Win+. style picker. The focused app keeps keyboard focus so
its text-input-v3 field stays enabled; the emoji goes in with commit_string,
or onto the clipboard with a visible notice when the app has no text field.
Shortcut lives in the shortcut table (rebindable in Settings > Shortcuts).

- compositor/wayland/text_input.mbt: zwp_text_input_manager_v3 (global 12)
- compositor/emoji: Emoji 18.0 + CLDR 49 data (Unicode License), search,
  picker model, CBDT/CBLC + GSUB reader for Noto Color Emoji
- Chandra's own pinned bitmap Noto Color Emoji (scripts/fetch-emoji-font.sh,
  just emoji-font); Fedora's COLRv1 copy can't be drawn. Missing font shows
  an error panel.
- raster WIT: emoji-font, emoji-has, emoji-image; served by wasmhost
- state.edn :emoji {:recent [...] :skin-tone n}
- tests incl. a fake text-input client; docs/emoji-picker.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkABDGJixotaqFv2X2
2026-11-26 07:00:22 +00:00
Claude 77fcc4db1c Screenshot editor: annotate, blur, pixelate, redact and crop before saving
CI / test (push) Canceled after 12m58s
Every screenshot now opens in an editor after KDE Spectacle's annotation mode:
Arrow, Line, Rectangle, Ellipse, Pen, Highlighter, Text, Number markers, Blur,
Pixelate, Redact and Crop, 8 colours, 3 sizes, undo/redo. Enter saves and
copies, Ctrl+C copies only, Esc discards.

- Drawn by the compositor (shot_editor.mbt), keyboard owned by it while up.
- Annotations are drawn into the picture's pixels at full size (annotate.mbt),
  so what is shown is what is saved. Blur = 6x6 block average + 3 box-blur
  passes; redact is opaque; both touch only their box (pixel tests).
- The picture goes to the renderer as <=2 MB strips: one 8 MB image-pixels
  call exhausts wasmtime's hostcall fuel and killed the wasm host.
- Frame callbacks are held while the overlay/editor freeze the screen, so apps
  behind stop drawing (0% CPU vs 52% with a full-screen animating app).
- wasmhost: error buffer 16 KB so trap causes aren't cut off; image-pixels
  limit 1024 -> 16384 a side (both hosts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hh3TaFJh7nhCxAjV4Q
2026-11-26 05:37:03 +00:00
Claude 41c6ec1135 Remove the Rust host (host-wasm)
CI / test (push) Canceled after 0s
The MoonBit host (wasmhost/, build/wasmhost) is the only host now. Gone:
host-wasm/ (Rust on the wasmtime crate, ~5,700 lines incl. Cargo.lock),
the run-rust, run-drm-rust and host-wasm recipes, and `just install --rust`
(both the recipe and session/install.py now stop with an error naming the
removal instead of quietly ignoring the flag). remote-build.sh builds and
pulls build/wasmhost. README, wasmhost/README and docs no longer describe a
second host, apart from short history notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiBxpbLoeUM9xfZayq
2026-11-26 04:19:19 +00:00
Claude f556df2f4b Gamerig Library: gamerig's game library as a Chandra desktop module
CI / test (push) Successful in 2m25s
- New desktop module gamerig-library (components/gamerig-library, logic in lib/gamelib): the
  layout of gamerig's web library (desktop/ui) in draw ops. Top bar with the Gamerig mark, app
  count and search; sidebar with categories and counts, running apps (switch to, stop) and rig
  status (GPU, display, audio); card grid with featured games two columns wide, icon tiles,
  category and status badges, description, install hint, Launch / Big Picture / Switch to / Stop.
  Typing filters, arrows + Enter launch, the wheel scrolls. Colours: follow desktop, dark, light.
- New game-library capability: tables 26-28 (status, games, launch modes), request 45, in the
  wasmer/wasmtime stub, the MoonBit wasmhost and the Rust host-wasm.
- compositor/shell/gamelib.mbt polls GET $GAMERIG_DESKTOP_API/api/state (default
  http://127.0.0.1:8091) every 2 s with curl on a socket and POSTs launch/stop/focus; a file://
  base reads a state file (tests).
- --desktop NAME picks what fills the desktop at start. scripts/gamerig-kiosk.sh now runs a
  hybrid kiosk with the library as the desktop (CHANDRA_KIOSK_MODE=strict for the old one).
- Tests: lib/gamelib, compositor/host/gamelib_test.mbt, a host-wasm test; docs/gamerig-library.md
  with a screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 02:57:07 +00:00
Claude d521d0d840 Kiosk mode: --kiosk CMD runs one fullscreen app, locked down, restarted when it exits
CI / test (push) Successful in 4m10s
No panel, no compositor shortcuts or desktop menus, the focused window
fullscreen (dialogs float), CMD restarted with backoff. Ctrl+Alt+Shift+Escape
or chandra-ctl kiosk lock|unlock|status for admin work. --app-id sets the X11
WM_CLASS / Wayland app id of Chandra's own window. scripts/gamerig-kiosk.sh
runs Chandra as a gamerig rig's library window on its NVIDIA Xorg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 02:22:03 +00:00
Claude 71f0b858d6 Smoother animations without a GPU: faster rasteriser, frame pacing, software/hardware mode
CI / test (push) Failing after 3m2s
Measured headless at 1920x1080 with CHANDRA_FRAME_TRACE (new: one log line per drawn frame):
- Overview open: 46 -> 62 fps, worst frame gap 69 -> 36 ms, raster 14 -> 5 ms a frame.
- Live Starfield: 19 -> 30 fps (its target), raster 49 -> 13 ms, CPU 97% -> 46%.

Rasteriser (MoonBit host; circles and previews also in the Rust host):
- Blending works on two channels at a time in 16-bit lanes with an exact /255: same pixels,
  about 3x quicker on big translucent fills (the overview's dim, the starfield's nebulae).
- Filled circles are drawn as row spans, rings skip their empty middle (a sqrt per pixel of the
  bounding box before). Same pixels; a Rust test checks it against the old loop.
- Window previews gliding in the overview are sampled straight from the preview at each frame's
  size instead of filtered and cached at a size used once; the MoonBit host also gets the
  one-large-size cache and 4096 px draw limit the Rust host had (it kept every size and didn't
  draw previews past 1024 px).
- Image scaling sums each output row's columns once, with 32-bit sums and division.

Frame pacing: frames are drawn only when the output can take them (no page flip in flight on
KMS; the previous frame shown nested and on X11), with a frame every 250 ms for an output that
never gets ready. The KMS loop runs at 125 Hz, so animations used to rasterise frames that were
never shown.

Software or hardware mode (compositor/shell/render_mode.mbt, docs/rendering.md): detected from
the DRM render nodes' drivers (and NVIDIA's proprietary driver, LIBGL_ALWAYS_SOFTWARE),
overridden by CHANDRA_RENDER=software|hardware or Settings > Session "Lighter animations"
(state.edn :render, saved only when it differs from what was detected). Software mode remakes
changing previews every 200 ms instead of 100 ms and caps desktop modules at ~30 fps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkTQp5uN5FtwpzrXUA
2026-11-26 01:55:50 +00:00
Claude 01bd8281d5 Dock: plain icons always come before the task pills
CI / test (push) Failing after 2m33s
With window titles on, a pinned app that was running drew as a pill in its
pin slot, so idle pinned icons ended up between pills. Now the dock shows
the pinned apps that aren't running first, then every task: running pinned
apps in pin order, then the other running apps. The divider sits between
the two groups. Squeezing the pills to icons keeps the order; with titles
off the plain pinned order stays. Move left / right in the menu follow the
pin list, not the shown position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
2026-11-26 01:53:43 +00:00
Claude 3e35c4dfa5 One install recipe: just install installs everything
CI / test (push) Successful in 2m25s
just install now builds as you, then asks for root once and installs the
whole thing: the login session (wasm compositor on the MoonBit host,
modules, chandra-ctl, KDE colors, portal) and face unlock (helper, PAM
module, config, models). The alternatives are flags instead of recipes:
--link (was install-dev), --rust (install-rust), --native
(install-native), --pam (install-face --pam), --no-face, --no-models.
The PAM module is compiled as you into build/, so root only copies it;
without a compiler or libpam headers face unlock is skipped with a warning.
just uninstall removes face unlock too (--purge: enrolled faces).

Removed: install-dev, install-rust, install-native, install-face,
uninstall-face and the old install-session* / uninstall-session aliases.
New docs/install.md; README, docs and installer hints updated. Also drops
a committed __pycache__ file and ignores __pycache__/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkA52AocBmJHipFRqb
2026-11-26 01:38:58 +00:00
Claude e6be3825d0 X11 backend: run Chandra on Xorg (NVIDIA's proprietary driver)
CI / test (push) Successful in 2m28s
--x11 shows the desktop on the X server in $DISPLAY: a resizable window
under a window manager (--fullscreen asks it for fullscreen), or the whole
screen when no window manager runs, following xrandr resizes.

compositor/x11 is a pure X11 wire-protocol client (no libX11/xcb), so it
runs in the wasm compositor on both hosts and in the native build. Frames
go through MIT-SHM 1.2 (ShmAttachFd of the host frame memfd, paced by
ShmCompletion), with a core PutImage fallback. The keymap given to clients
is the X server's own (xkbcomp -xkb $DISPLAY -); X auto-repeat is dropped,
modifier/lock state comes from X's modifier map; MIT-MAGIC-COOKIE-1 auth.

chandra-session --x11 (and the new "Chandra (X11)" xsessions entry) runs
it as the login session; --login-session gives an X11 session what --drm
implied (power actions, polkit agent, system theme). just run-x11.
Docs: docs/x11.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhLFs4VtHV26G1iyeo
2026-11-26 01:37:49 +00:00
Claude 932fca627e Face unlock: a Howdy-style PAM module, shown in the password dialog and set up in Settings
CI / test (push) Successful in 2m6s
- face/pam_chandra_face.so (`-auth sufficient`): runs `chandra-face compare` as root with a clean
  environment, forwards what it says as PAM_TEXT_INFO / PAM_ERROR_MSG, and maps its exit status
  to success / auth error / unavailable, so the password always still works. Skips remote
  sessions (PAM_RHOST, SSH_CONNECTION), a closed lid and users without faces; refuses a helper
  that isn't root's; kills one that hangs (timeout + 6 s).
- face/chandra-face (Python + OpenCV): YuNet finds the face, SFace embeds it, cosine similarity
  against the enrolled embeddings (threshold 0.42, two matching frames, dark IR warm-up frames
  skipped, optional require_ir). enroll / list / remove / clear / test / status / pam
  enable|disable / fetch-models (sha256-pinned opencv_zoo models). Embeddings only, in
  /var/lib/chandra-face/USER/faces.json (root, 0600); labels in faces.list (0644). Store, config
  and models must be root's and not writable by others. Root commands re-run through run0 (or
  pkexec), so polkit asks first. Settings in /etc/chandra/face.conf.
- `just install-face [--pam]`, `just uninstall-face [--purge]` (face/install.py; uninstall takes
  the module out of every PAM service first). `pam enable` inserts before the first auth or
  @include line (Debian's sudo has only @include common-auth), keeping a .bak.
- Password dialog: a face row ("Looking for your face…" with a sweeping ring, "Face
  recognized", or why not, "Type your password instead"); typing and Enter during the scan go in
  when PAM asks for the password. Howdy's pam_howdy.so messages are understood too.
- Settings > Session > Face unlock: "Use my face for passwords" (polkit-1 + sudo), the enrolled
  faces (Remove takes a second click), "Add a face…", and the tool's progress. New `face-unlock`
  capability: tables 24 (status) and 25 (faces), request 44, in the wasmer/wasmtime stub, the Rust
  host, the MoonBit wasmhost and chandra:host/plasmoids. compositor/shell/face.mbt runs the tool
  on a socket so the compositor never waits.
- Tests: face/test_face.py (fake camera of PGM frames + fake recognizer; --pam builds the module
  and runs it through pamtester), dialog states and message parsing (polkit_test), the dialog via
  a mock helper (auth_test, shots 14/15), Settings against a fake chandra-face (face_test).
  scripts/test.sh runs them (compositor/polkit was missing from its native list), CI installs
  libpam0g-dev + pamtester. Also regenerated two stale desktop-module bindings (doc comments).
- docs/face-unlock.md, including the limits of 2D face recognition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
2026-11-26 01:19:29 +00:00
Claude 0f71779819 Desktop modules: a wasm module can fill the desktop, with Icon Desktop and Live Starfield
CI / test (push) Failing after 30s
A module that exports chandra:desktop/desktop-module (wit/desktop.wit) owns the desktop behind
the windows instead of a box in the panel: same sandbox, draw ops and capabilities, drawn at the
output's full size and re-rendered on resize. It gets pointer and scroll events only on the empty
desktop (windows, panel, popups and menus always win; a drag stays with the module until
release), keys only while the desktop has focus, and can draw over the wallpaper or replace it.
Its tick() asks for animation frames only while something moves; the main loop sleeps until the
next one (wake_timeout), and frames pause while a window covers the desktop, so an idle desktop
module costs nothing.

Settings > Desktop gets "On the desktop": Wallpaper only, Clock card (default) or any installed
desktop module, saved in state.edn as :desktop, loaded at login and reloaded by chandra-ctl
reload. Right-click the empty desktop for Module settings and System settings. Hidden settings
(empty label) are persisted by the shell, which is how Icon Desktop keeps icon positions.

Samples: Icon Desktop (click to launch, drag to arrange, keyboard navigation, count and size
settings) and Live Starfield (pointer steers, click or Space warps, wheel sets speed). Served by
all hosts: compositor/wasm (native + MoonBit wasmhost) and Rust host-wasm. Docs in
docs/desktop-modules.md; tests in compositor/host/desktop_test.mbt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgf1SwPMHVfLUbJKsB
2026-11-26 00:30:32 +00:00
Claude 30f5e88639 Overview (Exposé): every window side by side when the launcher opens, or alone on Super+W
CI / test (push) Successful in 1m35s
Opening the launcher (Super tap or its panel button) now also shows every window of the
workspace scaled down beside it, over the dimmed wallpaper, like GNOME's Activities overview:
a natural layout (rows, one scale, aspect ratios kept, never enlarged), minimized windows
dimmed, windows gliding in and out over 220 ms. Hover lights a window and shows a close
button; click brings it forward and closes the overview and launcher; middle-click closes the
window; Escape or a click on empty space closes it. Typing in the launcher's search fades the
windows whose title and app id don't match.

- compositor/host/overview.mbt: layout, area beside the launcher, hit testing, easing,
  input and draw ops; previews reuse the Alt+Tab thumbnails (10 fps refresh, nothing redrawn
  once settled).
- New shortcut "overview" (Super+W) in the shortcut table, rebindable in Settings > Shortcuts.
- chandra-ctl / control socket: "shortcut ID" runs any shortcut by id.
- Both renderers keep only one large scaled copy per image (a gliding preview is drawn at a
  new size every frame) and draw images up to 4096 px.
- Tests: layout packing and aspect ratio, balance, hit testing, animation, Super tap + click,
  Super+W + Escape/empty click, search filter, middle click, inspector, control command;
  screenshots of 1/4/9 windows in dark and light.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgo3PfGPY8wwv21ZZS
2026-11-26 00:24:16 +00:00
Claude 2a67bc83d4 docs: feasibility of Chandra as the gamerig kiosk shell
CI / test (push) Failing after 17s
What gamerig's rig-side shell does today (headless NVIDIA Xorg, Openbox,
WebKit library window, Selkies X11 capture/input), what Chandra has, the gap
list with effort and risk, size estimate, staged plan with a dmabuf go/no-go
spike first, and the physical thin-client reading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
2026-11-26 00:11:43 +00:00
Claude 6253371cb3 Dock and task manager are one module: titled window pills, pins, Super+1..9
CI / test (push) Failing after 30s
The panel had a task list and, beside it, a dock showing the same running
apps again. They are now one module, the dock, in the task list's place:

- Pinned apps, then running ones; an app with windows is a pill with its
  window's title (or name and window count) while there is room, an icon
  when the panel is crowded ("Show window titles" in Dock settings).
- Its right-click menu has the task list's window commands (Minimize /
  Restore, Maximize) for a single window, or the app's windows by title.
- It stretches like the task list did; new panels get it instead of
  tasks. A saved panel's "tasks" becomes the dock (one dock, where the
  task list was); pins are the dock's own setting, so they carry over.
- An empty dock shows a "+ Add apps" tile that opens the Applications
  menu, where right-clicking an app offers Open and Pin to dock (adding a
  dock to the panel if there is none).
- Super+1 .. Super+9 open the dock's first nine apps like a click
  (shortcut "dock-apps", rebindable in Settings > Shortcuts).
- "New window" / "Open" only for apps the catalog can start.

The tasks component, lib/panel's pill geometry and the taskbar-widget
world are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
2026-11-26 00:08:05 +00:00
Claude 4437a3a576 Rename just install-session to just install
CI / test (push) Failing after 16s
install-session(-dev/-rust/-native) become install(-dev/-rust/-native) and
uninstall-session becomes uninstall, so installing is just `just install`.
The old names stay as hidden recipes that print a one-line note and run the
new one. Docs, scripts and comments now point at the new names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hj5zRiffcgWaggHdjv
2026-11-25 22:17:05 +00:00
Claude c45e0ef431 Dock: pinned and running apps with real icons, window dots, hover names and a per-app menu
CI / test (push) Failing after 17s
The dock showed the first eight catalog apps as letter tiles, and that list reshuffled after
every launch (the catalog puts recent apps first). Now:

- Pinned apps first, in the order you set, then the other running apps after a thin divider
  (like macOS). Windows find their app by desktop id, case, the last dotted part, or the app's
  name (xterm -> debian-xterm.desktop "XTerm"); windows without an app id stay out.
- Real icons from the icon theme (the `icons` capability, as in the task manager), with the
  letter tile as fallback. The shell publishes icons for pinned apps that aren't running too.
- A dot under an icon per open window (up to three), a longer accent bar when the app has focus.
- Click: start the app if it isn't running, otherwise bring its newest window forward
  (restoring it if minimized); click a focused app again to step through its windows.
- Hover: the icon grows (neighbours a little) on a light highlight, and the shell draws the app's
  name in a label above it.
- Right-click an icon (drawn by the shell, like the task manager's window menu): Open / New
  window, Pin to dock / Unpin from dock, Move left / Move right, Quit or Close N windows, and
  Dock settings.
- Dock settings (module-config): Icon size (Small/Medium/Large), Magnify icons under the
  pointer, Show running apps that aren't pinned. The pinned list is a hidden setting (empty
  label: the shell's settings menu skips it), saved in state.edn's :module-config. Until it is
  set the dock pins the catalog's first five, and the shell saves that once so launches don't
  move them.
- The panel sizes the dock from its current items (a module's preferred width is read once).

Plumbing: new WIT world dock-widget (app-catalog, app-launch, windows, icons, exports
module-config); no new interfaces, so both hosts load it as is. lib/dock holds the items,
layout, hit-testing, drawing and pin edits, shared by the module and compositor/shell/dock.mbt.
The shell's Launch handling moved into launch_catalog_app so the menu can use it.
Also: DesktopShell::pointer_move delivered every hover move twice (a duplicated block).

Tests: lib/dock (settings round trip, app matching, item order, hit-testing with the divider,
clicks and window cycling, drawing, pin edits), compositor/host input_test (the dock in a real
compositor: saved default pins, growing for running apps, hover label, the menu's rows and
actions, settings menu without the pinned row, focusing by click), dock_test (screenshots in
_build/dock_hover.png and dock_menu.png).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkmB8pJF5ckPeecFxL
2026-11-25 22:15:01 +00:00
Claude bb7c9b947f Settings > Apps: choose the default browser, email, files, terminal, editor, viewers and players
CI / test (push) Failing after 45s
- A sixth Settings tab, Apps (key 6, SettingsTab::Apps; the popup is 390 px wide for it): Web
  browser, Email, File manager, Terminal, Text editor, Image viewer, Video player, Music player,
  PDF and documents, Archive manager. Each row shows the current default with its real icon (the
  icon-theme lookup the task manager uses; a letter tile when there is none). Click a row to list
  the installed apps that can take it, click one to make it the default. A chosen app that has
  been uninstalled since is named in red under its row ("gthumb is not installed any more").
- Installed apps come from the .desktop files in the XDG data dirs (and flatpak's exports), with
  MimeType= and Categories= (desktop_entry_keys, now shared with the launcher's parse_desktop).
  A kind lists the shown apps that handle one of its MIME types; the terminal lists
  TerminalEmulator apps; browsers are only offered as browsers.
- Reading follows the mimeapps.list spec: $XDG_CONFIG_HOME/[chandra-]mimeapps.list, then
  $XDG_CONFIG_DIRS (/etc/xdg), then $XDG_DATA_HOME and $XDG_DATA_DIRS applications/; the first
  installed [Default Applications] entry wins, else [Added Associations], else mimeinfo.cache
  (minus [Removed Associations]), else the first installed app that handles the type. A hidden
  (NoDisplay) default still counts and its name is shown.
- Setting writes [Default Applications] in ~/.config/mimeapps.list for each of the kind's MIME
  types the app handles (always the main one: http/https/text/html for browsers, mailto,
  inode/directory, text/plain, image/png..., video/mp4..., audio/mpeg..., application/pdf...,
  application/zip...), as xdg-mime default / xdg-settings do, without running them. Every other
  section, entry, comment and blank line is kept; the app leaves those types' [Removed
  Associations]; a chandra-mimeapps.list that already names one of those types is updated too.
- The terminal has no MIME type: state.edn :terminal "kitty" (desktop id), also written first in
  ~/.config/xdg-terminals.list (xdg-terminal-exec). Terminal=true apps from the launcher (and
  session restore) now start in it (foot -e, kgx/gnome-terminal/ptyxis --, kitty <cmd>, wezterm
  start --) instead of always foot; with no choice: xdg-terminals.list, then foot, then any
  installed terminal. Terminal apps are listed when any terminal emulator is installed, not only
  foot.
- New `default-apps` capability (categories, apps, set-default, refresh): host tables 11 (sss:
  name current missing) and 12 (issii: category id name icon current), request 19 (category *
  1000 + app, -1 rescans) in the wasmer/wasmtime stub, host-wasm and the MoonBit wasmhost
  (chandra:host/plasmoids default-app(s32)). Nothing is scanned until the tab opens (refresh).
- Tests with a temporary XDG tree: categories and current defaults (user file, system file,
  Added Associations, mimeinfo.cache, missing apps, hidden defaults), writing that keeps other
  entries, desktop-specific files, the terminal list and commands, the Apps tab end to end, and
  the :terminal round trip through state.edn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgywj7RPmFdFhpzGZj
2026-11-25 21:27:30 +00:00
Claude 99c6c66726 Launcher: Reload session, and Log out moves in from its own module
CI / test (push) Failing after 17s
The Application Launcher's menu now ends in a session row: Reload, Log out, Suspend, Restart,
Power off. Log out, Restart and Power off take a second click on the same button (a status line
says "Click Log out again to confirm"); Reload and Suspend act at once.

- Reload calls the new session.reload, which reaches the shell as the ReloadSession request
  (native stub: request 8 with n 1; host plasmoids.wit: reload-session; host-wasm: Req::ReloadSession)
  and runs DesktopShell::reload_modules(""): every panel module again from disk, in place, with
  its settings. Windows and apps keep running. The compositor redraws the whole frame after it.
- Suspend / Restart / Power off use the power capability, the same calls as Settings > Power.
- The standalone logout module is gone (component, world, components.txt). Saved panels drop
  "logout", or get the launcher in its place when they had none; panel.edn is rewritten without
  it. A stale logout.wasm is hidden from Settings > Panel (retired_modules).
- Tests: lib/launcher session row, shell migrate_panel, host input tests for Log out and Reload,
  host-wasm launcher session row; control_test uses inspector.wasm instead of logout.wasm.
- README and docs/reloading.md describe the session row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjKUnSS3D92ThigvJf
2026-11-25 21:01:17 +00:00
Claude 68164ff75e Reload panel modules from outside the session: control socket, chandra-ctl, SIGUSR1
CI / test (push) Failing after 16s
Until now a module reload was only reachable by clicking Settings > Panel inside the session.
Now:

- The compositor listens on $XDG_RUNTIME_DIR/chandra/<wayland socket name>.sock (the login
  session's is wayland-moon-0.sock) with a line protocol: ping, list, reload [NAME], help.
  Replies end with an "ok ..." or "error ..." line. It lives in compositor/host/control.mbt,
  runs from ChandraCompositor::step, and its fds join the idle loop's wait set, so an idle
  desktop still sleeps (measured ~0.4% CPU on wasmhost, ~0.1% on host-wasm) and wakes for a
  command. A path another live compositor answers on is left alone.
- DesktopShell::reload_modules(name) reloads every loaded module (or those whose module id,
  stem, slot or path is NAME) in place via replace_slot: same panel position, saved
  :module-config applied, a module that fails to load stays as it was and the error is
  reported to the caller and shown as a notice. The catalog is rescanned.
- SIGUSR1 to the host reloads every module (result in the log and the notice): new WIT
  function sys.take-sigusr1, implemented in compositor/sys (native build and wasmhost) and
  host-wasm; the handler has no SA_RESTART so it interrupts the idle poll.
- session/chandra-ctl (installed to /usr/local/bin), `just reload [NAME]`, docs/reloading.md,
  README.
- Tests: compositor/host/control_test.mbt (protocol, reload all / by name / by slot, order
  and settings kept, failing module kept, busy socket). Checked headless on both hosts with
  chandra-ctl and kill -USR1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjLJtvYcgW48okL6qQ
2026-11-25 20:57:40 +00:00
Claude 0fc2598d27 Delta drew in a 640x480 corner of a full-size window: ask again when a client keeps another size
CI / test (push) Failing after 17s
GPUI apps (Delta, Zed) answer a configure that takes the maximized state away by going back to
their old floating size, whatever size it asks for. Unmaximized into a tiled slot (or a layout
change while maximized), Delta kept drawing 640x480 and Chandra padded it out with the bottom
right colour to the whole frame, so only the sidebar and toolbar showed.

The server now tracks each toplevel's last configure and the serial the client acked. When a
client commits a buffer of another size after acking the latest configure, the same configure
is sent once more (GPUI, no longer maximized then, takes it). A client that still keeps its own
size gets a ToplevelSizeChosen: a floating window's frame follows it, a tiled, maximized or
fullscreen window keeps the compositor's size. Sizes take set_window_geometry and
set_buffer_scale into account.

CHANDRA_DEBUG_CONFIGURE=1 logs configures, acks and committed buffer sizes to stderr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiKUmCPZNFNiGwd8EW
2026-11-25 20:55:58 +00:00
nandiandClaude Sonnet 5.5 10659e7655 docs: what a running session can reload after an install (panel modules yes, host/compositor no)
CI / test (push) Failing after 17s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjq2YbDd5zJXXKWqSR
2026-11-25 12:43:04 -08:00
Claude 34885bfdda Settings > Shortcuts: rebind the compositor's keyboard shortcuts
CI / test (push) Failing after 18s
- One shortcut table (compositor/shell/shortcuts.mbt): named actions with their default combos,
  the same as before: Super tap launcher, Super+D, Alt+Tab, Super+Shift+S, Super+Shift+Print,
  Print, Super+Print, Super+Ctrl+Print, Super+Shift+R, Super+Alt+R, Super+Ctrl+R. Combos are
  "Super+Ctrl+Alt+Shift+Key" text (parse/print, aliases like Meta, PrtSc, Return); "Super" alone
  is a Super tap. Two shortcuts on one combo conflict and the one listed first wins.
- The compositor looks every non-modifier key press up in the table (compositor/host/
  shortcuts.mbt) instead of the hardcoded checks in showdesktop/screenshot/recorder; the switcher
  reads its combo from it (hold the combo's modifiers, its key steps, Shift reverses, releasing a
  held modifier switches). Matching is now exact on Super/Ctrl/Alt/Shift (caps/num lock ignored),
  so e.g. Super+Shift+D or Ctrl+Print no longer fire Super+D / Print.
- Settings gets a fifth tab, Shortcuts (key 5, SettingsTab::Shortcuts): every shortcut and its
  combo. Click a row (or Enter) and press the new keys: the compositor captures the combo before
  anything else sees it (Escape cancels, Backspace unbinds, a Super tap binds "Super"; window
  switching keeps waiting until the combo has a modifier). Changed rows get a Reset button
  (Backspace/Delete on the highlighted row too), plus "Reset all to defaults"; conflicting combos
  show in red with a line saying which shortcut wins. The popup is 360 px wide for the fifth tab.
- New `shortcuts` capability (shortcuts, capture, cancel-capture, reset, reset-all), served from
  host table 10 and request 18 by the wasmer/wasmtime stub, host-wasm and the MoonBit wasmhost
  (chandra:host/plasmoids `shortcut(s32)`).
- Changes are kept in state.edn as :shortcuts {:show-desktop "Super+Ctrl+D" ...} (only the ones
  that differ; "" unbinds), applied at startup and live.
- There were no window-management or tiling key shortcuts to move into the table.
- Tests: combo parsing/printing, defaults, conflicts, switcher constraint, save/restore pairs,
  rebinding through the compositor, capture (Escape/Backspace/Super tap), the Shortcuts tab
  (capture, conflict line, Reset, Reset all) and the state.edn round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjypNwGHE9WeFvnWLA
2026-11-25 20:41:22 +00:00
Claude c1936299cb README: describe Chandra as it is now
CI / test (push) Failing after 17s
Rewrite the M0-era README for the current project: the rename from
moon-plasma, the MoonBit wasmhost as the default host (Rust host-wasm as
fallback), the just recipes, shortcuts (Super+D, screenshots, recording),
panel modules and Settings, config/state paths, CHANDRA_* variables, and
known gaps. Add a headless desktop frame (docs/screenshots/desktop.png).
TOOLCHAIN.md and ARCHITECTURE.md get notes that they describe M0 and point
to the README for the current state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhZBVRuyDznwycdo4s
2026-11-25 20:31:19 +00:00
Claude c7a6c8376e Merge the 12-hour clock into the Digital Clock
CI / test (push) Failing after 18s
clock-digital12 and clock-digital had become the same module (same lib/clock
code, same right-click settings), differing only in the starting format. Keep
one: the Digital Clock now starts in 12-hour mode with AM/PM, and its
"Time format" setting switches to 24-hour.

- components/clock-digital12 is gone (and from scripts/components.txt);
  lib/clock drops digital12_info/digital12_config.
- The default panel loads clock-digital.
- "clock-digital12" stays an alias (find_module, slot_of, saved panels) and is
  never listed in the module picker, even if an old .wasm is still installed.
- panel.edn gets :version 2. A version-1 panel is migrated once: the old
  12-hour clock becomes the Digital Clock with its settings (state.edn
  :module-config) moved over in 12-hour mode; a panel that had the old
  24-hour Digital Clock keeps 24-hour. The file is rewritten afterwards.
- Tests updated, plus a migration test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgnZsS91fwCreut8FL
2026-11-25 20:29:12 +00:00
Claude 9c0a794c2d run0: install via scripts/as-root, chandra-root for GUI apps as root, session refuses root
CI / test (push) Failing after 16s
- scripts/as-root runs a command as root with run0 (systemd PID 1 + run0 present), else sudo,
  doas or pkexec; resolves the program to an absolute path since run0 doesn't inherit PATH.
  The install-session recipes use it and pass install.py by absolute path.
- session/chandra-root (installed to /usr/local/bin): run a graphical app as root inside
  Chandra, passing WAYLAND_DISPLAY (absolute) and the Wayland toolkit variables through
  run0 --setenv (or sudo/doas/pkexec env).
- chandra-session: refuses to run as root (CHANDRA_ALLOW_ROOT=1 overrides), fills in HOME and
  XDG_RUNTIME_DIR when started without a login environment, logs when the logind session has
  no seat (run0 --user / su / ssh), and starts an installed polkit agent once the socket is up
  so run0/pkexec from the launcher can prompt (CHANDRA_POLKIT_AGENT picks one or 'none').
- install.py: checks for root before --remove too; installs chandra-root.
- docs/run0.md: invocations for installing, starting from a TTY, apps as root, polkit agents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkq6Hq7AXG85g5HyJU
2026-11-25 20:13:55 +00:00
VandClaude Opus 5.5 af774d76fe Rename the project to Chandra
CI / test (push) Failing after 16s
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra
everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the
MoonBit module (chandra/desktop) and generated bindings, the Rust host,
identifiers (ChandraCompositor), the session script (chandra-session) and
desktop entry (chandra.desktop), config and data paths
($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*),
UI strings, docs and tests. The test fixture components are rebuilt against
the renamed WIT.

Saved panel.edn and state.edn are still read from the old
$XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy.

The remote repository keeps its experiments/moon-plasma name for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
2026-11-25 17:12:57 +00:00
nandi 880ecd4102 M0: WIT package, MoonBit components, JS host, docs, CI (#1)
CI / test (push) Successful in 19s
2026-11-24 23:51:26 +00:00
nandi e5548fc067 Initial commit 2026-11-24 23:14:29 +00:00