app: shell never applies the brand tokens — 270 var(--oc-*) reads, zero definitions #237

Closed
opened 2026-07-31 20:30:38 +00:00 by ben · 3 comments
Owner

Parent

Found during #183 Phase A (A1, first real launch of the production shell). Same QA thread as #230–#233 and the wire-contract ticket.

What happened

The operator app renders with almost no styling — layout only, no colours, no brand — looking nothing like the wireframe contract. The content is all there; the visual layer isn't.

Root cause: the app's component styles consume the theming seam's custom properties (--oc-accent, --oc-background, --oc-status-*, …) roughly 270 times, but nothing ever defines them. The seam's design (DDR 0007 / ADR 0094) is that the compiled brand kit's tokens.css declares them on :root, and the shared ui-kit exports the application function for exactly this — but the operator app never consumes it (the ui-kit wrap was deferred by ADR 0108's first-packaging scope). Every var(--oc-*) falls back to browser defaults, so the shell looks unstyled everywhere, including before founding even starts.

What I expected

The shell wears a coherent default kit from first paint (the seam already falls back to a default preset + letter-mark so the preview is "live from the operator's first keystroke" — the same default can dress the shell), and wears the community's compiled kit once one exists. The wireframes are the contract for what these screens look like.

Steps to reproduce

  1. Launch the production shell and land on Welcome (or any screen).
  2. Inspect any element: var(--oc-*) resolves to nothing; compare any screen against its wireframe.

Additional context

  • The plumbing largely exists: the helper compiles tokens.css locally through the real theming seam (the S3 preview op returns it), and the ui-kit has both the token-application function and the Quasar brand-var mapping ready. What's missing is the shell calling it — at boot with the default kit, and on brand-kit changes thereafter.
  • Distinct from the wire-contract ticket: that one is fields silently lost across the bridge; this one is a consumption gap the first packaging deliberately deferred — but the deferral left the shell below wireframe fidelity, not merely un-Quasar'd, so it needs an explicit slice rather than staying implicit in the deferred Quasar wrap.
## Parent Found during #183 Phase A (A1, first real launch of the production shell). Same QA thread as #230–#233 and the wire-contract ticket. ## What happened The operator app renders with almost no styling — layout only, no colours, no brand — looking nothing like the wireframe contract. The content is all there; the visual layer isn't. Root cause: the app's component styles consume the theming seam's custom properties (`--oc-accent`, `--oc-background`, `--oc-status-*`, …) roughly 270 times, but **nothing ever defines them**. The seam's design (DDR 0007 / ADR 0094) is that the compiled brand kit's `tokens.css` declares them on `:root`, and the shared ui-kit exports the application function for exactly this — but the operator app never consumes it (the ui-kit wrap was deferred by ADR 0108's first-packaging scope). Every `var(--oc-*)` falls back to browser defaults, so the shell looks unstyled everywhere, including before founding even starts. ## What I expected The shell wears a coherent default kit from first paint (the seam already falls back to a default preset + letter-mark so the preview is "live from the operator's first keystroke" — the same default can dress the shell), and wears the community's compiled kit once one exists. The wireframes are the contract for what these screens look like. ## Steps to reproduce 1. Launch the production shell and land on Welcome (or any screen). 2. Inspect any element: `var(--oc-*)` resolves to nothing; compare any screen against its wireframe. ## Additional context - The plumbing largely exists: the helper compiles `tokens.css` locally through the real theming seam (the S3 preview op returns it), and the ui-kit has both the token-application function and the Quasar brand-var mapping ready. What's missing is the shell calling it — at boot with the default kit, and on brand-kit changes thereafter. - Distinct from the wire-contract ticket: that one is fields silently lost across the bridge; this one is a consumption gap the first packaging deliberately deferred — but the deferral left the shell *below* wireframe fidelity, not merely un-Quasar'd, so it needs an explicit slice rather than staying implicit in the deferred Quasar wrap.
Author
Owner

This was generated by AI during triage.

Triage

Category: bug · State: ready-for-agent

Verification: confirmed by inspection — packages/ui-kit/src/brandTokens.ts exports applyBrandTokens, and dashboard/ consumes it across many components (grep shows dozens of hits under dashboard/src/components/**), but the operator app (app/src, app/src-electron) never calls it — the only tokens.css references under app/src are for compiling the artifact during founding preview (FoundingBrandKit.vue, founding.ts), never applying it to the shell's own :root. Matches the reported symptom (270 unstyled var(--oc-*) reads). No existing implementation, no prior .out-of-scope/ rejection.

Agent Brief

Category: bug
Summary: The operator app shell never applies the theming seam's brand tokens — every var(--oc-*) custom property falls back to browser defaults, so the shell renders unstyled from first paint.

Current behavior:
The app's component styles consume the theming seam's custom properties (--oc-accent, --oc-background, --oc-status-*, and others — roughly 270 reads) but nothing in the operator app defines them on :root. The seam's design (DDR 0007 / ADR 0094) is that the compiled brand kit's tokens.css declares them, and the shared ui-kit (packages/ui-kit) already exports applyBrandTokens for exactly this purpose — the dashboard package consumes it, but the operator app's shell never calls it (deferred as part of ADR 0108's first-packaging scope, along with the full Quasar wrap). The result: the shell looks completely unstyled on every screen, including before founding starts, well below wireframe fidelity.

Desired behavior:
The shell applies a coherent default brand kit from first paint (the theming seam already falls back to a default preset + letter-mark so a preview is "live from the operator's first keystroke" — the same default should dress the shell chrome), and applies the community's compiled kit once founding produces one, with the shell re-applying tokens on brand-kit changes thereafter.

Key interfaces:

  • applyBrandTokens (packages/ui-kit/src/brandTokens.ts) — the shell should call this at boot with the default preset, and again whenever a compiled tokens.css/brand kit becomes available (e.g. after founding's S3 preview, or on later brand-kit changes).
  • This is a consumption gap only — no change to applyBrandTokens's own contract or to the theming seam's compilation path should be needed.

Acceptance criteria:

  • Launching the production shell and landing on any screen (including pre-founding, e.g. Welcome) shows the default brand kit's colours/tokens applied — no var(--oc-*) falls back to a browser default.
  • Once founding compiles a real brand kit (S3 preview or later), the shell re-applies the updated tokens without requiring a relaunch.
  • Visual output for at least one screen matches its wireframe's colour/token usage (not full Quasar fidelity — that remains ADR 0108's deferred follow-up).
  • All existing app tests and the typecheck continue to pass.

Out of scope:

  • The full Quasar app-vite UI layer migration (ADR 0108) — this ticket only wires up token application, not the framework wrap.
  • The wire-contract bug (#236) — separate root cause, same QA thread.
> *This was generated by AI during triage.* ## Triage **Category:** bug · **State:** ready-for-agent **Verification:** confirmed by inspection — `packages/ui-kit/src/brandTokens.ts` exports `applyBrandTokens`, and `dashboard/` consumes it across many components (grep shows dozens of hits under `dashboard/src/components/**`), but the operator app (`app/src`, `app/src-electron`) never calls it — the only `tokens.css` references under `app/src` are for *compiling* the artifact during founding preview (`FoundingBrandKit.vue`, `founding.ts`), never applying it to the shell's own `:root`. Matches the reported symptom (270 unstyled `var(--oc-*)` reads). No existing implementation, no prior `.out-of-scope/` rejection. ## Agent Brief **Category:** bug **Summary:** The operator app shell never applies the theming seam's brand tokens — every `var(--oc-*)` custom property falls back to browser defaults, so the shell renders unstyled from first paint. **Current behavior:** The app's component styles consume the theming seam's custom properties (`--oc-accent`, `--oc-background`, `--oc-status-*`, and others — roughly 270 reads) but nothing in the operator app defines them on `:root`. The seam's design (DDR 0007 / ADR 0094) is that the compiled brand kit's `tokens.css` declares them, and the shared ui-kit (`packages/ui-kit`) already exports `applyBrandTokens` for exactly this purpose — the dashboard package consumes it, but the operator app's shell never calls it (deferred as part of ADR 0108's first-packaging scope, along with the full Quasar wrap). The result: the shell looks completely unstyled on every screen, including before founding starts, well below wireframe fidelity. **Desired behavior:** The shell applies a coherent default brand kit from first paint (the theming seam already falls back to a default preset + letter-mark so a preview is "live from the operator's first keystroke" — the same default should dress the shell chrome), and applies the community's compiled kit once founding produces one, with the shell re-applying tokens on brand-kit changes thereafter. **Key interfaces:** - `applyBrandTokens` (`packages/ui-kit/src/brandTokens.ts`) — the shell should call this at boot with the default preset, and again whenever a compiled `tokens.css`/brand kit becomes available (e.g. after founding's S3 preview, or on later brand-kit changes). - This is a consumption gap only — no change to `applyBrandTokens`'s own contract or to the theming seam's compilation path should be needed. **Acceptance criteria:** - [ ] Launching the production shell and landing on any screen (including pre-founding, e.g. Welcome) shows the default brand kit's colours/tokens applied — no `var(--oc-*)` falls back to a browser default. - [ ] Once founding compiles a real brand kit (S3 preview or later), the shell re-applies the updated tokens without requiring a relaunch. - [ ] Visual output for at least one screen matches its wireframe's colour/token usage (not full Quasar fidelity — that remains ADR 0108's deferred follow-up). - [ ] All existing app tests and the typecheck continue to pass. **Out of scope:** - The full Quasar app-vite UI layer migration (ADR 0108) — this ticket only wires up token application, not the framework wrap. - The wire-contract bug (#236) — separate root cause, same QA thread.
Author
Owner

Landed in 9d338bc on main.

Root cause was a consumption gap: the app read the theming seam's --oc-* custom properties ~270 times but never applied a compiled tokens.css, so every var(--oc-*) fell back to a browser default. Fixed as pure consumption wiring (no change to the seam compile path or applyBrandTokens's contract):

  • ui-kit DEFAULT_BRAND_TOKENS — the seam's compiled default preset (forest), echoed from brandkit.Compile with the same discipline PRESET_SWATCHES keeps for the preset accents.
  • bootPackagedApp applies it before mount (both real renderer entries — renderer/production.ts and renderer/dev.ts — boot through it), so Welcome and every pre-founding screen wears a coherent kit from first paint; dispose clears the vars (AC1).
  • FoundingWizard watches its compiled preview and re-applies the community's portal tokens.css onto :root live on the S3 first render and every brand edit, no relaunch (AC2).

The wireframe colour/token usage now resolves on every screen (AC3). All app (385), ui-kit (75) and dashboard (704) tests pass, and the app/ui-kit/dashboard typechecks are clean (AC4). The go-gated boot.test.ts remains skipped here (no Go toolchain in the sandbox), unaffected by this change.

Kept TS-only (guarded by seam-echo + comment, repo precedent) so the change stays within the app/ui-kit surface; the full Quasar wrap stays ADR 0108's deferred follow-up, out of scope.

Landed in 9d338bc on main. Root cause was a consumption gap: the app read the theming seam's `--oc-*` custom properties ~270 times but never applied a compiled `tokens.css`, so every `var(--oc-*)` fell back to a browser default. Fixed as pure consumption wiring (no change to the seam compile path or `applyBrandTokens`'s contract): - **ui-kit `DEFAULT_BRAND_TOKENS`** — the seam's compiled default preset (`forest`), echoed from `brandkit.Compile` with the same discipline `PRESET_SWATCHES` keeps for the preset accents. - **`bootPackagedApp`** applies it before mount (both real renderer entries — `renderer/production.ts` and `renderer/dev.ts` — boot through it), so Welcome and every pre-founding screen wears a coherent kit from first paint; dispose clears the vars (AC1). - **`FoundingWizard`** watches its compiled preview and re-applies the community's portal `tokens.css` onto `:root` live on the S3 first render and every brand edit, no relaunch (AC2). The wireframe colour/token usage now resolves on every screen (AC3). All app (385), ui-kit (75) and dashboard (704) tests pass, and the app/ui-kit/dashboard typechecks are clean (AC4). The go-gated `boot.test.ts` remains skipped here (no Go toolchain in the sandbox), unaffected by this change. Kept TS-only (guarded by seam-echo + comment, repo precedent) so the change stays within the app/ui-kit surface; the full Quasar wrap stays ADR 0108's deferred follow-up, out of scope.
ben closed this issue 2026-07-31 20:51:47 +00:00
Author
Owner

Follow-up landed in ea7e8ba (manual session), layered on the swarm's 9d338bc:

  • The found bridge gains a brand-tokens op (Orchestrator.BrandTokens): the seam compiles the open draft's kit — or the default kit (default preset + letter-mark) when none is open — and returns the portal tokens.css. Boot dresses the shell from it (dressShell, app/src/lib/shellBrand.ts), correcting the static DEFAULT_BRAND_TOKENS first paint with the seam's live compile — a relaunch mid-founding now wears the draft's chosen colours from boot, and the ui-kit's echoed default can't drift silently from the seam.
  • En route: the stdio bridge's stdin had no error route, so a write racing the helper's death (app quit / dispose) escaped as an uncaught EPIPE — surfaced by the boot-time fire-and-forget dress, same shape as the boot-time seat read. Stream errors now feed the transport's one failure path.

Seam proof includes a boot test over the REAL production helper (boot.test.ts polls --oc-accent → #2f7d4f on :root) and a deterministic EPIPE-race repro (stdioBridge.test.ts). 406 app tests + all Go packages green.

Follow-up landed in `ea7e8ba` (manual session), layered on the swarm's `9d338bc`: - The `found` bridge gains a **`brand-tokens`** op (`Orchestrator.BrandTokens`): the seam compiles the open draft's kit — or the default kit (default preset + letter-mark) when none is open — and returns the portal `tokens.css`. Boot dresses the shell from it (`dressShell`, `app/src/lib/shellBrand.ts`), correcting the static `DEFAULT_BRAND_TOKENS` first paint with the seam's live compile — a relaunch mid-founding now wears the draft's chosen colours from boot, and the ui-kit's echoed default can't drift silently from the seam. - En route: the stdio bridge's stdin had no error route, so a write racing the helper's death (app quit / dispose) escaped as an uncaught EPIPE — surfaced by the boot-time fire-and-forget dress, same shape as the boot-time seat read. Stream errors now feed the transport's one failure path. Seam proof includes a boot test over the REAL production helper (`boot.test.ts` polls `--oc-accent` → `#2f7d4f` on `:root`) and a deterministic EPIPE-race repro (`stdioBridge.test.ts`). 406 app tests + all Go packages green.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#237
No description provided.