# Dashboard redesign: one fixed screen for the tablet ## Goal The Dashboard tab becomes a single screen sized for the tablet in landscape, with no scrolling, no dragging, no resizing and no folding. It shows the PC's state at a glance, the things that are always useful (music, spending), the things that are busy right now, and a row of one-tap actions. The layout was settled on the tablet with a throwaway mockup, now deleted. ## Layout Below the tab bar (unchanged, with a wider gap under it), three bands fill the rest of the viewport height: | band | height | content | |--------|---------------|-------------------------------------------| | top | 25% | identity line, two rows of chips | | middle | the remainder | music and spending; the running row | | bottom | 10% | action icons, centred | ### Top band - **Identity line**: the distro logo (Nerd Font, by `os-release` `ID`, Tux otherwise), `NAME VERSION_ID` in bold, the codename and `Linux `, and `up `. - **System chips** (row 1): CPU, memory, GPU, network. Each chip has an icon instead of a text label. - CPU: the processor name small above the big `%`, temperature on the right. The background is a filled trend line of the last 120 samples (two minutes at 1 s), scaled to at least 25%. - Memory: big used GiB, `/ total GiB` on the right, a fill bar behind. - GPU: the card name small above the big temperature, VRAM used/total on the right, a VRAM fill bar behind. - Network: big `↓down ↑up`; two overlaid trend lines (down in the accent colour, up neutral) on a shared scale. - **Other chips** (row 2): Claude context, Claude 5h, Claude 7d, tablet battery, tablet Wi-Fi. - Claude chips: the Claude logo, the big percent, then a small label (`context`, `5h`, `7d`); the percent as a fill bar behind. - Battery: a battery glyph whose fill (empty, 1/4, 1/2, 3/4, full) or bolt (charging or full) shows the state, and the big percent; no status text. - Wi-Fi: the wifi glyph, big `dBm`, the band on the right; the signal as a fill bar behind. - A chip needing attention gets an accent border: CPU or GPU at 85 °C or more, any Claude figure at 80% or more, the battery under 20% while not charging. The trend history lives in the page; the server is unchanged for it. ### Middle band Two rows. 1. **Always on**: music on the left (1 part), spending on the right (1.4 parts). - Music is the existing panel, compacted: 52 px art, no album line, smaller buttons, the volume slider and level kept. It stays even with nothing playing. - Spending, opencode: the latest session's model; session and total cost with tokens and calls under each; a stacked bar of total cost by model, the top 3 plus `other`, and a one-line legend with each one's cost. - Spending, Local Agent (desktop-assistant): while its total cost is 0 (a local or free model), one row: the title, the model, then `session` and `total` token counts on the right. Once it has cost, it uses the opencode layout. 2. **Running row**: one to three modules that are busy, in equal columns (one full width, two halves, three thirds), in a fixed order: printer, build VM, OBS. With nothing busy the row is not there and the always-on row takes the height. ### Running slots A module is busy when: - `k1c`: `state` is `printing` or `paused`. - `sbbuilder`: a job's status is one of the panel's active statuses. - `obs`: `recording` or `streaming`. Each busy module draws a compact slot from its own state fields only: - **Printer**: printer icon, file name, big percent; time left, layer `n/total` and extruder/bed temperatures on the second line; a progress bar; the emergency stop as the existing press-and-hold button. - **Build VM**: gears icon, the running job's kind, the queued count; a moving bar (no known progress). - **OBS**: a red dot, `Recording` or `Streaming` (and `paused`), the scene, the elapsed time big; no bar. A line that does not fit its slot scrolls: it waits, slides to its end at about 30 px/s, waits and slides back, with faded edges. Lines that fit stay still. Slot sizing uses a CSS container query on the slot's width, so a full-width slot can show more (the printer's slicer thumbnail and speed) without the page counting modules. Tapping a slot opens that module's tab when it has one (K1C, OBS); the Build VM has no tab, and its tap does nothing. ### Bottom band Icon-only buttons, centred, one per configured action. The list is `[dashboard] actions` (default `["screenshot", "lock"]`), validated against the actions deck-it knows; an unknown id is a config error, as for launchers. - `screenshot` runs `qar-scrotmenu.sh` on the PC: the same menu as SUPER+SHIFT+S, so full screen, region or window is chosen at the PC. - `lock` runs `lock.sh` on the PC. ### Hyprland's border colours There are no borders around widgets. The window border is hinted at in two places, with the three hues `/theme.css` already carries from `~/.cache/udt/udt-border.lua` (`--udt-border-1..3`): - **In the data**: the CPU trend line and the network download line, and the running slots' progress bars, are drawn with the border gradient instead of the flat accent colour. Upload, fill bars and the spending bar keep their colours. - **Around the action icons**: each icon button has the rotating gradient border the old cards had (a 2 px masked `::before`, the angle animated over 3 s, Hyprland's speed). ## The tablet follows the PC's lock A watcher thread in the server checks `pidof hyprlock` every 2 s. When hyprlock appears, it sends `input keyevent KEYCODE_SLEEP` to the tablet; when it goes away, `KEYCODE_WAKEUP`. It follows every lock, not only the dashboard button: SUPER+L and hypridle lock the tablet too. The tablet is the device found the same way as the `tablet` module (the one whose adb reverse carries the dashboard socket); with no tablet attached the watcher does nothing. If the tablet has a lock screen of its own, waking shows it. The page's Screen Wake Lock is released by Android when the screen goes off, and the existing visibility handling takes it again on wake. ## Configuration and keystone - `config.toml` gains `[dashboard] actions = ["screenshot", "lock"]`. - `deckit/config.py` validates the list against the known ids. - Keystone's deck-it page gains a "Dashboard actions" section: a checkbox per id in the defaults' list (`deck-it defaults`), writing the sparse `[dashboard] actions` list in the defaults' order. The JSON shape of `deck-it defaults` gains the table and keeps everything else. ## Code - `deckit/modules/actions.py` (new): state lists the configured actions (`id`, glyph, label); one action per id, running its fixed command; starts the lock watcher. The adb device lookup is shared with `tablet.py`. - `static/dashboard.js` (new): the three bands; it polls `stats`, `tablet`, `llm`, `music`, `k1c`, `sbbuilder`, `obs` and `actions`, and only those enabled in `/api/modules`. A disabled module's chip, card or slot is left out. - Panels with a running slot (`k1c.js`, `sbbuilder.js`, `obs.js`) export `busy(state)` and `slot(state, el)`; their tabs are unchanged. - `static/app.js`: the Dashboard tab mounts `dashboard.js`. Gridstack, the saved card layout, folding and the panel card chrome go. A module whose panel has no `tab` is no longer mounted as a card. - Removed: `static/vendor/gridstack/`, the gridstack tags in `index.html`, the card and grid CSS (the rotating-gradient rule moves to the action buttons), the stats, tablet and llm panel files (their data is drawn by `dashboard.js`), and `sbbuilder.js`'s full card (its idle package, disk and sync figures leave the tablet; the slot replaces it). - Docs: AGENTS.md and README describe the new dashboard, the actions module and the lock watcher. ## Errors - A module that is off or unreachable: its chip shows `—`, its card or slot is left out; the LLM dashboard off leaves the spending card with the existing offline card. - An action whose command is missing fails like a launcher: the button flashes, the server logs the error. - adb failures in the watcher are ignored and retried on the next change. ## Testing - Python: `actions` state and ids, the commands each action runs (injected runner), the watcher's transitions (fake `pidof` and adb: sleep once on lock, wake once on unlock, nothing while unchanged or without a tablet), and config validation of `[dashboard] actions`. - Node (`tests/test_dashboard.mjs`, run by `tests/test_js.py`): the pure helpers: the trend path, the spending split (top 3 plus other), the battery glyph choice and the busy checks. - On the tablet: screenshots of 0, 1, 2 and 3 busy modules, a long line scrolling, screenshot and lock from the buttons, and the tablet sleeping and waking with SUPER+L. ## Not in scope - The OBS preview tab. - A layout editor; the layout is fixed. - Portrait orientation.