Skip to content

feat(dashboard): Quantum skin, chain status pill, canary card, responsive layout - #165

Merged
I4cTime merged 3 commits into
mainfrom
feat/dashboard-quantum-skin
Nov 12, 2026
Merged

I4cTime merged 3 commits into
mainfrom
feat/dashboard-quantum-skin

Conversation

@I4cTime

@I4cTime I4cTime commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

Restyles the browser UI behind qring status so it reads as the same product as the redesigned q-ring site (the Quantum skin), and adds a Canary card.

  • Tokens in one place. src/core/dashboard-tokens.ts exports DASHBOARD_TOKENS (colours, radii, motion, font stacks) and tokensToCssVars(), which renders the page's :root block. It mirrors apps/qring/app/globals.css in i4c-sites and says so in its header. dashboard-html.ts and main.js now hold no hex or rgba literal; tints are color-mix() over the variables. A new test (dashboard-tokens.test.ts) checks the rendered values and the absence of literals.
  • Flat cards. No blobs, no glass blur, no card-reveal animation: bg-card, 1 px border, 16 px radius, hover bg-card-hover. The brand mark keeps the cyan to violet gradient and the only glow; card icons are plain cyan. System font stacks, headings at 600-700.
  • Playground vocabulary. KPI strip as StatsRow-style tiles (uppercase label, big tabular number, one-line hint). Audit Log gets the status pill (intact in success, broken at #n in danger, from auditChain; still .chain-badge with a "chain intact" label) and a console-style feed (mono, action chip, source chip, time). Policy rows show their mode as a small read-only segment chip. The secrets table keeps search, chips and sorting.
  • Canary card. DashboardSnapshot gains canaries: { key, scope, plantedAt?, trips, lastTripAt?, lastTripBy? }[], built in collectSnapshot() from the canary flags on the entries it already lists plus the canary events in the 24 h audit window. The card has the site's three states: none, armed (pulsing dot), tripped (danger border, "Tripped by " and the time).
  • Responsive. At 768 px: one column, KPI tiles two per row, header wraps and stops sticking. At 480 px: tighter gutters, the table scrolls inside its card, audit rows wrap. prefers-reduced-motion stops the pulses and transitions.
  • Also fixed on the way: CLI hints with <name> / <value> were parsed as HTML tags by htm and rendered blank; they are plain strings now. Zero-value donut slices no longer draw a dot.
  • Docs: CHANGELOG [Unreleased] Added + Changed, README dashboard card list. docs/stability.md does not list snapshot fields, so it is unchanged.
  • .gitignore: added !src/core/dashboard-tokens.ts to the allow-list, because the blanket *token* rule would otherwise drop the file.

Constraints kept

  • Binds 127.0.0.1 only; per-launch random token on every route (403 without it).
  • Same CSP and headers: default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; connect-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'none', X-Frame-Options DENY, nosniff, no-referrer, no-store.
  • Self-contained page: no external fetch, no font files, no font-src change.
  • Agent view: the canaries field is an empty array and the card is not rendered (the client learns it is an agent view from the internal __QRING__ global). The projection still strips canary and alert actions, prevHash, pid and correlation ids.
  • /, P, R shortcuts unchanged; command, flags and MCP tool unchanged; the payload only gains a field.

Type

  • Feature
  • Fix
  • Security
  • Docs
  • Chore / CI / deps

Checklist

  • pnpm run typecheck passes
  • pnpm run lint passes
  • pnpm run build passes (bundle regenerated and committed; a fresh build:dashboard matches it byte for byte)
  • pnpm run test:ci passes (99 files, 862 tests)
  • CHANGELOG.md updated under [Unreleased]
  • Docs / README updated
  • CLI and MCP parity kept (pnpm run check:parity OK)

Verification

  • New and updated tests: dashboard-tokens.test.ts (accent and bg-deep in the rendered :root, no colour literal in dashboard-html.ts or main.js); dashboard-agent-view.test.ts (canaries is [] in agent view and the page says agentView:true; the operator view lists the planted canary with trips: 1 and lastTripBy mcp, and not the real key); dashboard-server.test.ts (.canary-card, the plant hint and the pill text ship in the bundle; canaries is an array). Existing class and title assertions are unchanged.
  • Visual check on an isolated file-backend vault (6 demo secrets, 2 canaries with one tripped, an entangled pair, audit reads), served by node dist/index.js status --port 9878 --no-open and screenshotted with Playwright (Chrome) at 1440x900, 768x1024 and 390x844, viewport and full page: no console errors, no external requests, no horizontal overflow at any width. Response headers carry the CSP and the other headers; a request without the token returns 403.
  • prettier --check passes on every touched TypeScript file. src/dashboard-client/main.js was not run through prettier --write: it was not Prettier-formatted on main either, it is outside the format script's src/**/*.ts glob, and a write would reformat about 1,200 unrelated lines.

Breaking changes

None. The snapshot gains a canaries field; nothing is removed or renamed.

Closes #164

🤖 Generated with Claude Code

I4cTime and others added 3 commits November 12, 2026 10:20
…sive layout

The browser UI behind `qring status` now wears the q-ring site's Quantum
skin. Palette, radii and motion live in one constant, DASHBOARD_TOKENS in
src/core/dashboard-tokens.ts (mirrors apps/qring/app/globals.css in
i4c-sites), rendered into the page's :root by tokensToCssVars(); no other
dashboard file holds a colour literal, and a test checks that.

- Flat cards (bg-card, 1 px border, radius 16); blobs, glass blur and the
  card-reveal animation are gone. The brand mark keeps the cyan to violet
  gradient and the only glow.
- KPI strip as StatsRow-style tiles; Policy rows with a mode chip; Audit Log
  with the chain status pill (intact / broken at #n, keeps .chain-badge and
  the "chain intact" label) and a console-style feed.
- New Canary card (none / armed / tripped) fed by a new `canaries` snapshot
  field; an agent-view dashboard gets an empty array and no card.
- Responsive at 768 and 480 px; prefers-reduced-motion stops the pulses and
  transitions.

Binding, the per-launch token, the CSP and the self-contained page are
unchanged. Refs #164.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkMFzJ1Zs2thapqFsdGL2K
The blanket *token* pattern in .gitignore swallowed the new tokens file, so
the previous commit referenced a module it did not include. Add it to the
allow-list next to the other legitimate *token*/*secret* source paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkMFzJ1Zs2thapqFsdGL2K
@I4cTime
I4cTime merged commit 9405385 into main Nov 12, 2026
9 checks passed
@I4cTime
I4cTime deleted the feat/dashboard-quantum-skin branch November 12, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Status dashboard in the Quantum skin: site tokens, flat cards, canary card, responsive

1 participant