# Dashboard reconstruction plan

2026-10-16 · source implementation only; publishing remains with the user.

Contract: [styleguide](dashboard-styleguide.md). Execution ledger: [TODO](dashboard-TODO.md).

## Discovery and constraints

The daemon renders one HTML application in `packages/cli/src/api/web-ui.ts`, one stylesheet in `web-instrument-style.ts`, and a separate media controller in `web-media-runtime.ts`. Nine canonical routes share shell, dialogs and operational components. Rebuild these shared components and each route's composition rather than layering a second stylesheet over the old UI.

Existing media APIs provide generation, catalog, store inspection/relocation, gallery and authenticated files. They do not provide browser weight management or saved-media deletion. Tool prepare/pull operations often load CUDA and therefore cannot serve a Download weights action. Shared caches and generated gallery copies have different ownership. The plan includes real backend operations and isolated lifecycle tests.

Preserve unrelated work, publish artifacts, package versions, running daemon and user data. No real model downloads, GPU loads, inference or user-media deletions are needed to implement or validate this change. Keep service-specific voice management truthful.

## Sequence and ownership

1. Establish and commit design contract, this plan and durable checklist before implementation.
2. Reconstruct shared tokens, typography, shell, headings, section/field/module/dialog primitives. Bundle Departure Mono with license. Restyle static and dynamic page compositions together.
3. Add guarded media management service and routes: weight inventory, network-only download jobs/status, guarded deletion, exact saved-gallery deletion. Persist download state and interrupted recovery. Use injectable adapters and temporary fixtures for tests.
4. Reconstruct the generative composer: selected-model trigger; reusable model-module modal with nested detail, download/status/delete actions; clear storage and automatic-download information; optional generation parameters; separate analysis workspace; result/library deletion controls.
5. Apply the design to all nine routes and nested Voice/settings components. Preserve IDs/controllers where needed to keep transport and workflow behavior intact. Remove obsolete inline presentational overrides in changed surfaces.
6. Run scoped backend/runtime/style/route suites and mandatory transport tests. Extend real Chromium fixture coverage for models, deletion, all media modes, nested forms, navigation, themes, responsiveness and keyboard behavior. Inspect screenshots and correct composition issues.
7. Commit verified coherent changes, fetch/push `origin/main`, and update the ledger with test receipts and any honest limitations. User publishes; do not replace or restart their installed daemon.

Work areas can proceed in parallel after the design contract: shared UI/style; backend media management; independent browser verification; media composer controller/integration. Avoid concurrent edits to the same file through explicit ownership.

## Page-by-page reconstruction

| Page | Primary composition | Auxiliary / nested work |
| --- | --- | --- |
| Chat | Open transcript reading area; deliberate composer and styled Send; clear session context | Workspace inspector, resizable navigation, recents, model dialog, mini voice controls, action/confirmation dialogs; preserve streaming/Stop. |
| Agent | Run objective and primary action above open run state; related facts grouped | Plan, approvals, tool results and evidence grouped under their parent run; restrained logs and telemetry. |
| Voice | Live session, transcription and synthesis as distinct operational sections | Labeled ASR upload/context, engine/model setup, clone/model forms, preview/error states; actual per-service storage semantics. |
| Generate | Mode navigation, selected model module, prompt, expandable parameters, local progress and output | Model explorer/detail; weights/store management; audio/video/live analysis; gallery filters/detail/download/delete; shared state across modes without stale operation crossover. |
| Projects | Searchable project rows with useful path/context and local actions | Project detail, session association and bounded path display; avoid box-per-field nesting. |
| Dashboard | Readable run/system sections, substantial space between distinct groups | Compact metric rows, activity/jobs and resource detail, meaningful empty states; no fake telemetry. |
| Activity | Chronological operational list with grouped filters | Event detail/evidence/error surfaces and bounded log views. |
| Discover | Search/exploration first, results as inspectable modules | Nested capability details and actual links/actions; avoid dense decorative card walls. |
| Settings | Grouped preference sections with a clear primary control per task | Connection/auth, theme, voice/clones and nested fields; no placeholder-only labels, gray hierarchy across dialog/auxiliary levels. |

## Backend operation contracts

Keep existing `/v1/media/models` compatible. Introduce a separate management API for expensive cache inventory and operations. Model identity is `{kind, modelId}` resolved from the catalog; clients never supply an arbitrary deletion path or executable downloader. Return dependency records with repository, actual paths, measured bytes, cache state, sharing and explicit supported actions. Do not equate `_meta.json` with a completed installation.

Download is asynchronous and disk/network-only, with job ID and durable status; queued/running/ready/failed/interrupted states and known/unknown totals. Deduplicate concurrent requests. Use the same unified cache/env resolution as generation. Block destructive operations while generation, download or relocation can use that cache. Validate kind, model and repository membership; enforce run/admin scope locally. Known external providers/custom paths get an explicit unavailable action with reason.

Saved-media deletion validates a strict media kind and exact basename beneath its canonical gallery directory, rejects symlinks/traversal, and removes only the selected owned artifact and matching metadata. It must not follow arbitrary source paths from sidecars. Return the deletion scope honestly, including retained working copies where relevant. Do not remove catalog entries when deleting weights.

Coordinate migration/relocation and generation with the management guard; reject unsafe concurrent mutations. Tests prove busy states and shared dependencies, not merely successful deletion.

## Validation and delivery

- Route/service tests: isolated `OMNIUS_HOME`, `OMNIUS_MEDIA_HOME` and catalog, dummy files, injected downloader. Auth scopes, traversal/symlinks, dependency membership, duplicate/active jobs, restart recovery, deletion bytes, retained catalog, gallery scope and failure behavior.
- Runtime tests: immutable selected/output identity across refresh and mode changes, confirm cancellation sends no mutation, pending dedup, errors retain items, job progress truthfulness, blob cleanup, modal focus/back/keyboard behavior.
- Mandatory daemon frontend tests: `web-chat-transport-lifecycle.test.ts`, `web-ui-client-runtime.test.ts`, `web-ui-script.test.ts`. Also media runtime/routes, route/basepath, observability/style suites.
- Chromium: production HTML against an isolated authenticated prefixed API fixture. Nine routes × three widths × two themes; all four generation modes; three analysis modes; models/download/delete and output delete; Voice/nested settings; actual preview decode/audio playback/download bytes; pointer sidebar and Send; dialog keyboard/outside dismiss; no page errors or horizontal overflow. Disable browser GPU and block all nonfixture network traffic.
- Visual review: screenshots of primary and nested surfaces at desktop/mobile; inspect negative space, implied boundaries, font loading and grayscale hierarchy. Check text contrast numerically.
- Build source in isolated temporary output for browser verification, leaving concurrent publish output untouched. Report source/fixture verification separately from the user's running deployment.
