Skip to content

Redesign the UI (Pico + photoreal toaster hero) + admin model-key#5

Merged
LegalMarc merged 2 commits into
mainfrom
feat/toaster-ui-redesign
Jul 17, 2026
Merged

Redesign the UI (Pico + photoreal toaster hero) + admin model-key#5
LegalMarc merged 2 commits into
mainfrom
feat/toaster-ui-redesign

Conversation

@LegalMarc

@LegalMarc LegalMarc commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Two commits: the frontend redesign, and the admin model-key feature.

1 — Redesign (frontend + nginx)

  • Pico CSS (bundled) + ct-* token/utility layer, replacing inline styles.
  • ToasterHero — one near-photoreal inline-SVG toaster: dial selects the contract type (coming-soon stops render but aren't selectable), lever drops while a review runs, slots glow while toasting, and on completion a toast slice pops bearing a drawn contract that doubles as a "Click to download" button. Failure stays sober.
  • Real CC0 sounds (lever/tick/pop, ~12KB; provenance in src/assets/sounds/SOURCES.md), Web Audio, mute toggle. vite.config.ts refuses to inline audio (CSP has no data: in connect-src).
  • Accessible tab shell, all panels mounted + hidden-toggled. One shell for both roles.
  • nginx.conf: client_max_body_size 32m — unset defaults to 1m and rejects any contract over 1 MB before the backend's 25 MiB limit applies.

2 — Admin model-key

The instance-wide OpenRouter key can be set/rotated from an admin UI instead of only the deploy .env.

  • model_settings.py stores it in a MODEL_SETTINGS_TABLE; GET/POST/DELETE /api/admin/model-key report/set/clear it (last-four hint only, never the key).
  • pipeline_runner resolves it per review with an env fallback; the admin-set key wins.
  • AdminModel.tsx adds the "Model & API key" admin tab; bootstrap.py/compose declare the table.
  • Test fixtures use non-sk-or- fake keys (the code validates length only, not the prefix) so they don't trip secret scanners.

Verification (in this repo's context)

  • test_model_settings.py 40 tests OK · frontend tsc clean + 68 vitest across 10 files · vite build clean, audio emitted as same-origin files
  • Diff scanned: no secrets (GitHub push-protection clean), no exos-legal introduced, no excluded/corpus paths
  • Produced with scripts/public-cut.sh (exos-legal#374): corpus + secret exclusions verified before pushing

Deferred

The OPF-policy artifacts on the source branch are excluded — they record git_commit provenance against commits absent from this repo's fresh history and would fail the provenance gate. Separate follow-up.

🤖 Generated with Claude Code

Port the frontend redesign that makes the toaster the centerpiece of the
review experience.

- Adopt Pico CSS (bundled, no CDN — the deploy CSP forbids remote loads)
  with a ct-* token/utility layer (styles/tokens.css, styles/app.css),
  replacing scattered inline styles.
- ToasterHero (toaster/Toaster.tsx): one near-photoreal inline-SVG toaster.
  Its dial selects the contract type (coming-soon stops render but aren't
  selectable — a dead end can't be dressed as a choice), its lever drops
  while a review runs, its slots glow while toasting, and on completion a
  toast slice pops bearing a drawn contract that doubles as a "Click to
  download" button. Failure states stay sober.
- Real CC0 recordings for the lever/tick/pop (~12KB; provenance + ffmpeg
  derivation in src/assets/sounds/SOURCES.md), played via Web Audio on the
  first user gesture, with a mute toggle that defaults on under
  prefers-reduced-motion. vite.config.ts refuses to inline audio (the
  deploy CSP's connect-src has no data:, so an inlined clip would be
  CSP-blocked while passing local tests).
- Accessible tab shell (Review / Users & access / Retention & legal hold),
  all panels mounted + hidden-toggled so polling survives tab switches. One
  shell and one Review experience for both roles: admin only adds tabs.
- deploy/dts/nginx.conf: client_max_body_size 32m. Unset, nginx defaults to
  1m and rejects any contract over 1 MB before the backend's designed 25 MiB
  limit + structured 413 applies — real .docx with images clear 1 MB easily.

Scope: this is the FRONTEND redesign only. The admin model-key tab and the
OPF-policy work on the source branch are intentionally deferred — the former
needs a backend endpoint not yet public, the latter records provenance
against commits absent from this repo's fresh history.

Verified: npm ci + tsc clean; 57 vitest across 9 files; vite build emits the
audio as same-origin files with no inlined media.
Follow-on to the redesign in this PR: the instance-wide OpenRouter key can be
set and rotated from an admin UI instead of only via the deploy .env.

- model_settings.py stores the key in a MODEL_SETTINGS_TABLE (mirrors the
  demo_auth auth-mode setting); GET/POST/DELETE /api/admin/model-key report
  whether a key is loaded + its source with a last-four hint, set/rotate it,
  and clear it back to the OPENROUTER_API_KEY env fallback.
- pipeline_runner resolves the key via model_settings, falling back to the env
  var, per review (so a rotation takes effect on the next review, no restart);
  the admin-set key wins.
- AdminModel.tsx restores the "Model & API key" admin tab, gated and mounted
  like the other admin tabs.
- bootstrap.py creates MODEL_SETTINGS_TABLE; the DTS compose files declare it.

Verified in this repo's context: test_model_settings.py 40 tests OK; frontend
tsc clean + 68 vitest across 10 files. No secrets, no exos-legal, no excluded
paths in the diff.
@LegalMarc LegalMarc changed the title Redesign the UI: Pico design system + photoreal toaster hero Redesign the UI (Pico + photoreal toaster hero) + admin model-key Jul 17, 2026
@LegalMarc
LegalMarc merged commit 6e7a25b into main Jul 17, 2026
8 checks passed
@LegalMarc
LegalMarc deleted the feat/toaster-ui-redesign branch July 17, 2026 17:49
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.

1 participant