Epic: #113 · Milestone: MC0 — Product & decisions
Why
"Use our own tech (stx, etc.)" plus "seamless, performant, resource cheap" on a Pi 5 constrains the UI runtime hard. Facts:
~/Code/Tools/stxis TypeScript on Bun. It has no renderer of its own: output is HTML strings, Web Components, or — viapackages/stx/src/craft-compiler.ts(1,422 lines) — a Craft native component tree withCompilationFormat = 'zig' | 'typescript' | 'json' | 'binary'.~/Code/Tools/crosswind(=ts-css) is a CSS generator with a parser/minifier and no layout or paint engine.~/Code/Tools/craft(Zig) renders through a WebView (webkit2gtkon Linux) — not available on a bare-metal HomeOS and against the no-Linux-userland rule.- HomeOS has its own Craft in Home: spec
docs/design/craft.mdv0.3,kernel/src/lib/craft_lib.home,kernel/src/gui/craft_integration.home,apps/desktop/craft_bridge.home, plus HIG tokens indocs/design/hig-tokens.home. It is retained-mode draw-lists into the compositor — exactly what a 10-foot UI needs. ~/Code/Libraries/zig-jsis a complete JS engine (test262 100 %) with a pinned Home ABI — a viable runtime but a large one for an idle-at-128 MB budget.
Decision (recommended)
- Author every TV screen as
.stxsingle-file components (templates, props, signals, directives, Iconify icons). - Compile ahead of time on the developer machine: a new
homeoutput format in stx's craft-compiler emits.homesource that builds Craft component trees + signal bindings (#89). The emitted code is checked in underapps/tv/generated/(reviewable, diffable, agent-legible). - Style with crosswind's utility vocabulary, but the emitter resolves every class to HIG tokens at compile time (#90). No CSS parser on device.
- Run as one long-running Craft process (
apps/tv/), the same architecture MASTER_PLAN §9 chose for the desktop shell. No JS engine ships in v1. - Post-v1: zig-js for third-party plugins/apps, sandboxed; not on the critical path.
Tasks
docs/adr/ADR-MC4-ui-stack.mdwith the option table (WebView / zig-js runtime / AOT) and memory + latency estimates for each.- Decide the stx feature subset the emitter must support for v1 (list directives, signals, slots, i18n) and document unsupported ones as compile errors.