Docs / REA-UI-AUDIT
REA UI audit — Kitty desktop app (2026-11-28)
Source: docs/REA-UI-AUDIT.md
Scope: phase 1 of the owner's 2026 UI/UX redesign. Subject is the first-party Electron app in
desktop/ on branch gc-ui-voxel (baseline: local main, which already contains the first
gaming-console redesign). Excluded from analysis: node_modules/, historical screenshots,
generated artifacts, the separate landing page worktree, and this repository's .venv.
REA output is static evidence only. Every claim below that affects the redesign was checked
against source, tests, or a safe read-only inspection; runtime behaviour that was not exercised is
listed under "Unresolved questions". Historical screenshots are evidence of what was captured,
not proof of the current build.
1. REA command result
CLI available: npx rea-agents@latest resolved to rea@6.10.1.
First attempt (with CSS and HTML paths included) failed. Exact error:
{"error":"JavaScript application analysis failed","code":"invalid_request","category":"invalid_input","message":"Analysis input is invalid. Check the arguments and try again.","retryable":false,"remediation":{"action":"Read the declared input schema or CLI usage for analyze_javascript_application; if using MCP and the catalog may be stale, call tools/list. Correct the listed fields, then retry. Do not repeat the unchanged call."},"recovery":{"kind":"inspect_input_contract","operation":"analyze_javascript_application"},"details":{"operation":"analyze_javascript_application","issues":[{"path":["sourcePath",18],"reason":"invalid_value","message":"Select an exact relevant file path from the artifact inventory; no globs or path aliases."},{"path":["sourcePath",26],"reason":"invalid_value","message":"Select an exact relevant file path from the artifact inventory; no globs or path aliases."},{"path":["sourcePath",27],"reason":"invalid_value","message":"Select an exact relevant file path from the artifact inventory; no globs or path aliases."}]}}
The rejected paths were src/styles.css, src/styles/tokens.css and src/styles/views.css:
REA inventories JavaScript application sources only. No fallback source audit was needed.
Successful command, run from desktop/ (source list = the 30 first-party .js/.cjs files under
src/, written to a temporary --source-paths-json file outside the repo):
npx rea-agents@latest analyze-javascript-application . \
--artifact-format directory \
--source-paths-json <tmp>/js-paths.json \
--detail summary \
--evidence_output <tmp>/rea-evidence.json \
--format json
Exit 0. Summary evidence id
ev_727973a0704e817aa82f3d587ad68394d97c75222c2d036a9f4160bd8c94b159; parent analysis evidence
id ev_17934bb66e43ea008c67078a94a7e15ee403f74d73007efb90ef677c8f87b420. Coverage
complete-within-view (examined 215 / total 215 inventory rows); 67 relevant files, 30 parsed
JavaScript files, 0 parse failures, 30,222 AST nodes, 232 findings, 188,709 text bytes read.
The evidence bundle and summaries were kept outside the worktree; nothing was committed.
REA's Electron boundary summary: 1 BrowserWindow, 4 explicit webPreferences, 1 preload
entrypoint, 1 contextBridge API, 22 IPC operations / 21 literal channels, 20 renderer
transmissions, 2 renderer listeners, electron_semantics: partial, 22 limitations. Important
limitations: 37 inventoried files outside the caller-selected scope; 1 Electron-loading source
only partially examined; 20 renderer transmissions ambiguous; main_handlers: 0 and
exposed_api_members: 0 are not evidence of absence (handlers are registered through an
injected ipcMain object and the bridge object is built dynamically). Source and tests confirm
19 ipcMain.handle channels, 19 matching ipcRenderer.invoke channels, and 20 frozen bridge
members (desktop/test/preload-contract.test.cjs, "the preload exposes only the documented
bridge functions").
2. Verified findings
| ID | Finding | Evidence (static + verification) | Consequence for redesign |
|---|---|---|---|
| F1 | Electron shell has contextIsolation: true, nodeIntegration: false, sandbox: true, preload from src/preload.cjs; navigation is denied (will-navigate prevented, setWindowOpenHandler denies). |
REA BrowserWindow/webPreferences; app.cjs createWindow; preload-contract and desktop-functionality tests. |
Keep exactly these preferences; renderer must stay plain local HTML/CSS/JS with no Node access. |
| F2 | Strict CSP: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:. |
index.html line 7; ui-ux test. |
No CDN scripts or remote fonts; any future 3D or font asset must be a local 'self' file. |
| F3 | One frozen contextBridge API with 20 functions; 19 invoke channels are paired with 19 ipcMain.handle handlers; two event channels (lifecycle:phase, tray:navigate). |
preload.cjs; main.cjs; preload-contract test. REA could not pair them statically. |
Preserve the IPC contract and channel names; new UI must call these functions, not add renderer-side Node. |
| F4 | IPC inputs are validated: lifecycle allow-list up/status/logs/stop/down, instance id /^[a-z0-9]{1,16}$/, service-name patterns, project must be open, registry operation and payload object required, settings validated and versioned, loopback-only URL for player links. |
main.cjs (LIFECYCLE_OPERATIONS, instanceFrom, isLoopbackUrl, registry:request), settings-schema.js, python-api-bridge.cjs; corresponding tests. |
Keep every guard; "AI-native" presentation must not bypass validation. |
| F5 | Python is the single source of truth for YAML and schema validation via gamecomposer.api; renderer has no YAML library and asks Python for parse/dump/validate/import. |
main.cjs registry:request; python-request-bridge.cjs; gamecomposer/api.py REGISTRY_OPERATIONS; tests/schema, tests/registry. |
Do not reimplement validation in the renderer; manifest editor stays two-way synced through Python. |
| F6 | Sandboxes are real Kiri state. gamecompose ls feeds sandboxes:list; the model maps container states to unknown/starting/running/stopped/error. Several instances per project and several projects are supported; per-instance request keys prevent cross-cancellation. |
main.cjs listSandboxes, requestKey; sandbox-model.js; tests/instances, desktop/test/sandbox-model.test.cjs, contract-adapter.test.cjs. |
New "Worlds/Sandboxes" surface must keep the record shape and instance identity (project, instance, service, manifest, template). |
| F7 | Declared resources (CPUs/memory) are manifest specs, not measured telemetry. Health is a loopback probe (responding / HTTP n / no response); views/sandboxes.js has uptime, cpu, memory columns that are not wired to live values. |
sandbox-model.js describeService; main.cjs sandbox:probe; views/sandboxes.js. |
Never render fake metrics, CPU graphs or uptime clocks in the new design; show declared values labelled as declared. |
| F8 | Preview is read-only; only the final wizard Create calls sandbox.create* with start: true. Cancel, Back and validation failures create nothing. |
wizard-shell.js advanceWizard, preview; gamecomposer/api.py; acceptance evidence desktop/docs/screenshots/174/README.md. |
Keep explicit Create before any sandbox or container exists. |
| F9 | Local games stay local: file picker/drag-drop path + SHA-256, copied into the user data library; registry entries are downloaded with pinned digests; no upload path exists. | preload.cjs pickers; wizard-shell.js drop target; gamecomposer/library.py, registry.py; tests/registry. |
Do not add cloud sync, upload or remote font/image fetches. |
| F10 | Navigation is duplicated: renderer.js owns project/sandboxes showView, while wizard-shell.js owns registry, consoles, games, controllers, settings in a dynamically appended .wizard-shell panel and rebinds the same two rail buttons. nav.js has a back stack and breadcrumbs but wizard-shell only calls nav.go; its Back is a wizard-step decrement. |
Source of both files; nav.js; wizard-modules.test.cjs. |
Replace with a single routed shell; preserve existing route ids as aliases so tests and capabilities stay intact. |
| F11 | Five-step wizard is a panel overlay with no route of its own: Source → Name + description → Configure → Manifest → Review & Create. Schema form walks all v0.2 properties and folds advanced keys into <details>. |
views/wizard.js, schema-form.js, wizard-shell.js; views-wizard/schema-form tests. |
Compress to Select / Configure / Review & Launch without dropping fields, validation, Back or Advanced. |
| F12 | Settings has nine groups and a versioned main-process store; defaults include appearance.accent: 'blue', which the current CSS does not use. Theme/locale can change live; some changes say "restart needed". |
settings-schema.js, settings-store.cjs, views/settings.js, settings.cjs; settings-store/views-settings tests. |
Keep keys/migration stable; map accent to the new lime system in phase 5 without breaking stored settings. |
| F13 | i18n tables exist for en/es and cover registry/wizard/settings labels, but the renderer, wizard shell, status pills and rail labels contain hard-coded English strings, and aria-labels are often constructed in English. |
i18n/en.js, es.js, i18n.js; renderer.js, wizard-shell.js; views-*/i18n tests (table parity only). |
Move all new copy through t(); audit hard-coded strings while rebuilding each surface. |
| F14 | Focus is partially preserved by preserveFocus() and data-focus-key after full list rebuilds; rail arrows and table row arrows are keyboard-navigable; focus ring is 2px. |
renderer.js preserveFocus/initKeyboard; styles.css; ui-ux test. |
Keep keyboard paths and focus-visible rings; prefer stable DOM regions over rebuild-and-restore. |
| F15 | Baseline visual language is the v4 gaming-console pass (lime window bezel, 112px rail, 64px display type, stat strip, kind-coded covers, chunky framed panels). The cat mark in desktop/assets/brand/ is unchanged. |
DESIGN.md (baseline), desktop/docs/screenshots/redesign/README.md, index.html, styles.css/styles/*. |
Replace composition and surfaces where the new brief conflicts; keep the cat asset file names and all ids/aria-labels/tests. |
| F16 | Historical v4 capture evidence is unreliable: v4-02-registry.png and v4-06-sandboxes.png are byte-identical (MD5 c89c592f5c126084cdae1827afdb34ff), and only four distinct hashes exist across twelve v4-*.png files. |
Direct hash comparison of desktop/docs/screenshots/redesign/v4-*.png. |
Do not use those frames as route proof in the new work; recapture with per-view assertions when phase 5 lands. |
| F17 | Baseline suites are green in this worktree after installing local dependencies: desktop 185 pass / 0 fail, SDK 18 / 0 fail, Python 215 pass + 11 subtests (URL-source test excluded), npm run check OK. |
Commands recorded in §5; no code changed in phase 1. | Use these counts as the regression baseline for phases 2–5. |
The tray/menu-bar path (tray.cjs, tray-menu.cjs, insight.cjs) reads the same Kiri listing and
validates manifest/instance/service against it before stop/down/logs; the store's
showInMenuBar key is the only setting it exposes. It is part of the state inventory even though
it lives outside the renderer.
3. Route, feature and state inventory
Destinations and routes (existing identifiers must survive)
| Existing route / id | Current host | What it does | New home (phase 2) |
|---|---|---|---|
project (#view-project, #nav-project) |
renderer.js |
Runtime banner, open manifest/file, local template cards | Studio home (same route id) |
sandboxes (#view-sandboxes, #nav-sandboxes) |
renderer.js + sandbox-model.js |
Live Kiri list, summary, instance/service actions, detail + logs, "other" sandboxes | Sandboxes / Worlds |
registry (data-route) |
wizard-shell.js, views/registry.js |
Catalog grid, chips/search, read-only preview, Add to library / Use in new sandbox | Discover registry |
registry/detail (implicit preview overlay) |
wizard-shell.js preview() |
Detail of one pinned entry and its read-only manifest | Discover registry → detail panel (keep as subroute) |
consoles, games, controllers |
wizard-shell.js, views/library.js, views/controller.js |
Local library lists, add local game, favorite/edit (games), controller layout/remap module | Library (three sections) |
wizard overlay (wizard state, 5 steps) |
views/wizard.js, wizard-shell.js, schema-form.js |
Select source, name/description, schema form, YAML editor + validation, Create | 3-stage creation flow (route alias retained) |
settings (data-route, 9 groups) |
wizard-shell.js, views/settings.js, settings store |
Appearance, language, runtime, registry, library, sandboxes, controllers, menu bar, about | Settings |
tray navigation (newSandbox, sandbox, logs) |
app.cjs, tray.cjs |
Opens/focuses the app and selects a row or the creation path | Entry points into Studio / Worlds |
nav.js back stack + breadcrumb |
nav.js |
Route labels for six destinations plus wizard | Shared by the single routed shell |
Feature inventory (all preserved)
- Runtime check/install command/copy; Python re-detect; runtime HUD.
- Open manifest from disk; open shipped templates; multiple projects open simultaneously; close project without stopping sandboxes; restore projects from Kiri listing.
- Registry catalog online/offline cache, four kinds, search, kind/console filters, detail, preview, verified checksum/license/version metadata, Add to library, Use in new sandbox.
- Library: consoles, games (file/folder, title, console, cover, favorite, edit, notes, last played), controllers; local files stored/hashed in user data dir.
- Wizard: local ROM picker and drag-drop, title/console/controller detection, unique name check, description, schema-driven form for every v0.2 property (Advanced fold), two-way YAML editor with inline validation, Review → Create, Back/Cancel create nothing.
- Portable manifest: parse/dump/import/export/save/duplicate,
path+sha256, "file needed on the other machine" note; CLI parity (gamecompose --file … config|up). - Lifecycle:
up,status,logs,stop,down,up --new, per-instance and all-instances actions, Cancel in flight, retry/copy details, log follow, health probe, loopback player open. - Sandbox detail: declared spec fields, container id, URL, log tail, last action, health, other Kiri sandboxes read-only.
- Settings: theme (system/light/dark), accent, density, reduced motion, en/es, runtime paths/ports/resources, registry URL/cache/offline, library folder, sandbox defaults, controller defaults, menu bar, versions/licenses, reset group.
- Keyboard: skip link, rail arrows, row arrows, visible focus, ARIA live status/log/stepper.
State inventory
| State | Source of truth | Rendered today |
|---|---|---|
| Python/runtime ready | runtime:check |
Chip + install banner + disabled project actions |
| Open projects | main-process projects Map + renderer state.projects |
Breadcrumb, template "Open", project headers in the table |
| Catalog | pinned registry index via Python, cached | Registry stats, chips, cards, preview |
| Library | local user-data library | Consoles/Games/Controllers lists |
| Sandbox list | gamecompose ls (Kiri labels) |
Table rows, summary counts, nav badge, "other" list |
| Container state | Kiri state text mapped by mapRuntimeState |
Status pill: unknown/starting/running/stopped/error |
| Health | loopback fetch | responding, HTTP n, no response, not checked |
| Pending/action result | renderer inFlight, sandbox-model reducer |
Button busy/Cancel, notice line, error panel with recovery |
| Logs | logs IPC, capped 20k tail |
Terminal frame, follow while running |
| Wizard draft | wizard-shell.state.wizard + views/wizard reducer |
Stepper, fields, YAML editor, errors |
| Settings | versioned JSON store | Nine grouped forms, live theme/locale changes |
4. Obsolete UI patterns to remove in the redesign
- Two navigation systems and duplicate rail listeners (
renderer.js+wizard-shell.js): one routed shell only; route ids preserved. - Overlay routing by
hidden+display:noneand a dynamically appended panel: replace with declarative routed sections; no stale hidden h1 can be mistaken for the active view. - "Project" as the home concept: Studio home keeps the
projectroute id but presents open work, discovery and creation together. - Five-step wizard as an unrouted overlay: three stages (Select / Configure / Review & Launch) with a real stepper and Back; keep the v0.2 schema form and Advanced fold.
- v4 storefront composition: 64px uppercase display heading, four-cell kind stat strip, oversized
kindcover bands, lime window bezel and 112px key rail are baseline, not the new system; retain hard edges and real catalog data, change the composition. - Unicode icon substitutes (
⚙gear,★/☆favorites): draw SVG icons in one consistent stroke. - Rebuild-everything rendering with
preserveFocusrepair: stable regions and incremental updates; keyboard focus must not depend on a restore hack. - Hard-coded English in shell/status/aria text: all copy through
t()with en/es parity. - Unused pure view modules (
views/sandboxes.jsmetrics table,views/controller.jsremap markup): either wire them to real state or fold them into the new components; never show invented uptime/CPU/RAM. - Split token ownership (
styles.cssvsstyles/tokens.cssvsstyles/views.css): one token source per theme, with the light grade defining every surface colour (the earlier dark-on-dark defect came from a missing--bgoverride). - Default accent
bluewith no visual effect: map to the new lime system while keeping the stored key and validation contract. - Historical captures as proof: v2/v3/v4 frames are provenance only; the identical v4 files (F16) must not be cited as route evidence.
5. Unresolved questions for phase 5 verification
- Live rail behaviour after the duplicate handlers: which listener wins when Project/Sandboxes is clicked while the overlay is open? Needs a real-app DOM assertion; not claimed here.
- Whether
registry.detailcan become a first-class route without breaking the existing preview overlay ornav.back()semantics. - Whether the
accentsetting should be migrated to the lime palette or kept as a cosmetic choice; stored values must remain valid. - How to vendor Three.js for the sandboxed
file://renderer without changing CSP ornodeIntegration(phase 4 module is injectable; phase 5 must load a local UMD build or bundle locally). - Whether every hard-coded string can be routed through i18n without changing test-visible labels/aria-labels; preserve test selectors.
- Real i18n of error panels and validation messages (currently English from Python plus the local
describeErrortable). - Live Kiri verification of any new "Worlds" grouping: the model is verified by tests, but this phase did not start/stop containers.
6. Baseline checks and evidence used
cd desktop && npm test→ 185 pass, 0 fail;npm run check→ OK.cd sdk && npm test→ 18 pass, 0 fail (afternpm cisuppliedtypescript/yaml)..venv/bin/python -m pytest tests -q --ignore=tests/url-source/test_url_source.py→ 215 passed, 11 subtests passed.git diff --check→ clean at the time of the audit.- Read:
PRODUCT.md,DESIGN.md(baseline),README.md,HANDOFF.md,HANDOFF-174.md,
desktop/README.md,desktop/docs/screenshots/174/README.md,
desktop/docs/screenshots/redesign/README.md,docs/instances.md,docs/architecture.md. - Source inspected: entrypoint,
main.cjs,preload.cjs,index.html, renderer,nav.js,
ui-core.js,sandbox-model.js, view modules, wizard shell, schema form, settings schema/store,
Python bridges, tray/insight, tests. No containers, Kiri daemon or native dialogs were touched.

