Redesign the UI (Pico + photoreal toaster hero) + admin model-key#5
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits: the frontend redesign, and the admin model-key feature.
1 — Redesign (frontend + nginx)
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.src/assets/sounds/SOURCES.md), Web Audio, mute toggle.vite.config.tsrefuses to inline audio (CSP has nodata:inconnect-src).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.pystores it in aMODEL_SETTINGS_TABLE;GET/POST/DELETE /api/admin/model-keyreport/set/clear it (last-four hint only, never the key).pipeline_runnerresolves it per review with an env fallback; the admin-set key wins.AdminModel.tsxadds the "Model & API key" admin tab;bootstrap.py/compose declare the table.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.py40 tests OK · frontendtscclean + 68 vitest across 10 files ·vite buildclean, audio emitted as same-origin filesexos-legalintroduced, no excluded/corpus pathsscripts/public-cut.sh(exos-legal#374): corpus + secret exclusions verified before pushingDeferred
The OPF-policy artifacts on the source branch are excluded — they record
git_commitprovenance against commits absent from this repo's fresh history and would fail the provenance gate. Separate follow-up.🤖 Generated with Claude Code