Law AI UI / UX¶
Every user-facing surface, what actually ships versus what docs once claimed, the token and component inventory, and the design-system contract new UI follows.
Current-state inventory of every user-facing surface, the two styling idioms that actually ship, and the governance target for a maintainable design system. Constitution §2 still lists
shadcn/uias the locked frontend kit; it is not installed. Spec 039 + ADR 0006 propose replacing that lock with a first-party system owned in-repo.
This file is the source of truth for what the UI is today. The spec is the source of truth for what we will build. docs/ui-ux-review.md is the source of truth for how we keep it good — the repeatable /ux-review loop and the nine structural rules scripts/ux_audit.py enforces in CI. Do not treat .design-sync/ as either.
Update, 2026-08-31 (spec 041): the layout half of the first-party design system shipped as frontend/ui/layout.css — shell metrics, the sticky stack, the z-scale, the scroll primitives, and the app-wide focus ring, catalogued in frontend/ui/README.md. The palette half (tokens.css, semantic.css, React primitives) is still spec 039's to build.
Surfaces¶
| Surface | App | Route / deploy | Stack | Components |
|---|---|---|---|---|
| Platform | frontend/ |
make dev → :3000 |
Next 16, React 19, Tailwind v4 | 10 files under frontend/components/ |
| LSAT practice (static) | lsat-static/ |
GitHub Pages, make lsat-export |
Next 16 static export, no Tailwind | 7 files under lsat-static/components/ |
| Design-sync snapshot | .design-sync/ |
converter bundle only | Synthetic law-ai-ui package |
Re-exports the 16 above |
The ? sheet is not only the shell's: a screen registers its own key group with usePageShortcuts while it is mounted, so the LSAT drill's A–E / Enter / N are listed beside ⌘K instead of only on the card's hint line (BL-20260901-10). The drill's own bindings come from useShortcuts (frontend/lib/lsat/keyboard.ts), which attaches its window listener and refreshes its map in useLayoutEffect so a key pressed the moment a card appears is never dropped. Any hook that binds shortcuts, or syncs a ref a handler reads, must do the same (law-ai#147).
Both front ends share one UI contract as of spec 044. frontend/ui/base.css (z-scale, focus ring, motion opt-out) is mirrored byte-for-byte into lsat-static/app/base.css — Next refuses to resolve a CSS @import outside an app root, so make ui-sync copies it and ux_audit.py R12 fails the build on drift. The audit itself now covers both apps and their stylesheets.
frontend/ pages: / (home), /agents, /analysis, /graph, /lsat, /settings, plus route-level loading / error / not-found states. Chrome is the spec 040 app shell (frontend/components/shell/), reworked by spec 041 into a viewport-locked shell: masthead, nav rail, contextual sidebar, inspector, compact tab bar, and a ⌘K command palette. Modules register in frontend/lib/modules/catalog.ts — adding a surface must not edit AppShell.tsx. Settings resolve through frontend/lib/scope/resolver.ts (instance-only live scope; org/team wait on spec 036). There is no Case Library UI despite docs/architecture.md naming one.
The layout contract (spec 041)¶
The document does not scroll. AppShell is h-dvh overflow-hidden, so the masthead, rail, sidebar, inspector, and compact tab bar are flex children of a viewport-height row and are structurally incapable of scrolling away. Exactly one element scrolls page content — <main class="shell-scroll"> — and panels that need to scroll use .shell-panel-scroll. Inside main, PageLayout pins a page header that condenses once the region scrolls, and StickyToolbar parks control bars directly beneath it against --shell-pageheader-h. View state inside a screen is in the URL too — the LSAT Lab tab (?tab=), the Agent Ops run filters (?type=, ?q=), and the selected case on the graph (?case=), through lib/shell/viewState.ts, which reserves those keys so a screen can never clobber the panel params (BL-20260831-02): a link carries the view, and Back steps through it. Scroll position is remembered per route in sessionStorage, because a locked viewport means the browser's own restoration has nothing to restore. Below md, the sidebar and inspector become focus-trapped drawers and the rail becomes a bottom tab bar.
Layout preferences (spec 051)¶
What the shell shows, and where, is the user's to choose. Every part of the chrome except the UPL disclaimer footer has a preference behind it — an ordinary setting in the same server-persisted store as the timer's dock, so it persists the way that does, appears on /settings under a "Layout" heading, and can be reset as a group. Since BL-20260905-10 those preferences are the signed-in person's own: the 15 ui.*, lsat.timer.* and lsat.library.* keys are settable at user scope with the instance value standing behind them as the inherited default an admin seeds (USER_SETTABLE in frontend/lib/settings/define.ts), and SettingsForm carries a scope chooser so which scope you are editing is a choice rather than an inference — see Scopes. Signed out, the chain is the single instance scope spec 040 shipped. The masthead's Layout menu is the one place to do it: menuitemcheckbox rows show or hide the navigation rail (and label it beside its glyphs at xl and wider, BL-20260831-06), the contextual sidebar, the inspector, the breadcrumb trail, the scope switcher, the back-to-top button, and — on their own routes — the section timer and the library's contents rail and outline, which the module declares as data in lib/modules/catalog.ts rather than the menu testing route prefixes (BL-20260905-07); menuitemradio groups put each side panel on either edge (the sidebar is always outermost, the inspector always innermost) and pick whether the page header condenses on scroll or is always compact; one menuitem resets everything. The palette mirrors the rail and breadcrumb toggles and the reset. With the rail hidden, the masthead grows a compact Modules menu — the same MODULE_CATALOG, as a role="menu" of links — so changing module never depends on knowing ⌘K or on the breadcrumb trail being on (BL-20260905-08). Panel toggles now write the preference as well as the URL, so a collapsed panel stays collapsed across a navigation; the URL still wins for the page it names, and a stored inspector choice beats the UPL-route auto-open. A running section clock is never hidden by anything (spec 043 FR-5). Defaults reproduce the previous fixed layout, so a fresh profile cannot tell the feature shipped. The store mirrors its rows into a law-ai.settings.v1 cookie and app/(app)/layout.tsx reads that cookie on the server, so a non-default layout is on the first paint instead of reflowing once per full load (BL-20260905-09); localStorage stays the source of truth after hydration and the cookie is rewritten from it on mount.
| The Layout menu, open on the library — module rows appear only on their routes | ![]() |
| A moved and thinned shell: rail and breadcrumbs hidden, sidebar docked on the right beside the inspector, page header compact | ![]() |
/settings, grouped by key prefix — every preference editable with provenance |
![]() |
The default layout, for comparison, is the first capture in the entry-template table above.
Feature parity (spec 046). The published site renders the same solve guides, hint carousel, five diagram types, and post-grade concept references as the lab — the guides are hand-authored static data, so they ship in content.json and are locked client-side until a question is graded. What it will never have, because a serverless site cannot: the AI tutor, answer cross-check, HITL authoring, the validation report, and server-side stats. ux_audit.py R13 fails the build when a frontend/components/lsat/ component gains no counterpart and no static-parity: none — <reason>.
lsat-static/ is a single-page tab router (Overview, LR, RC, LG, Writing, Library, Stats) driven by a HITL-approved content.json. It is not on the make dev compose network. Library carries two views, Articles and Concepts — the catalog was its own destination until the concepts merge moved it next to the material that teaches it, on both products.
The library, both products¶
| Platform, Concepts view — a concept naming the articles that teach it | ![]() |
| Platform, an article's glossary — each name opens that concept in the catalog | ![]() |
| Practice lab, with no concept catalog of its own | ![]() |
| Offline site, same two views | ![]() |
Page measures at 2560px, before and after the large-screen step (PageLayout's WIDTH map). The shell's docked chrome eats 36.5rem, so the caps only bind past ~1900px — and there they were leaving ~350px of dead gutter down each side:
| Before | After |
|---|---|
![]() |
![]() |
The entry template (lsat-library.md § "The entry template") at 1440px with both panels docked. Before, an article and a concept were two unrelated shapes — different heading levels, a different section order (Concepts in this article → References → Related on one, Where to learn it → See also → References on the other), a drill link on one and a drill button on the other — and the reader was squeezed to a ~230px column because the grid keyed off the viewport rather than the region it actually sits in. After, both readers render the same header → actions → body → cross-references sequence with fixed #entry-* anchors, one read-state store, and a grid driven by container queries:
| Before | After | |
|---|---|---|
| Article header | ![]() |
![]() |
| Article cross-references | ![]() |
![]() |
| Concept header | ![]() |
![]() |
| Concept cross-references | ![]() |
![]() |
| Offline site, concept card | ![]() |
![]() |
What actually ships (vs what docs claim)¶
| Claim (constitution §2 / AGENTS.md / PRD) | On disk |
|---|---|
| Next.js 15 | Next ^16.3 in both apps |
| shadcn/ui | No components.json, no components/ui/, no Radix |
| TanStack Query | Not a dependency (removed, BL-20260830-01) |
React Flow (@xyflow/react) |
Not a dependency (removed, BL-20260830-01 — Cytoscape only) |
| Recharts (PRD only) | Not a dependency |
| framer-motion, lucide-react | Not dependencies (removed, BL-20260830-01) |
| One design system | Two styling idioms, no shared package |
The platform styles with Tailwind utility classes and two CSS variables (--background, --foreground). The static LSAT site styles with a hand-written semantic CSS design system (lsat-static/app/globals.css, ~600 lines, 11 tokens). .design-sync/conventions.md already documents this split and forbids blending the idioms.
Token inventory (lsat-static — the only real palette)¶
| Token | Value | Role |
|---|---|---|
--bg |
#0f172a |
Page canvas (slate-900) |
--bg-elev |
#1e293b |
Cards, header, raised surfaces |
--bg-elev-2 |
#273449 |
Hover / nested elevation |
--border |
#334155 |
Hairline borders |
--text |
#e2e8f0 |
Body |
--text-muted |
#94a3b8 |
Secondary copy |
--accent |
#fbbf24 |
LSAT amber (links, pills, primary button) |
--accent-dim |
rgba(251, 191, 36, 0.15) |
Selected / tinted fill |
--ok |
#34d399 |
Correct / success |
--no |
#f87171 |
Incorrect / danger |
--radius |
12px |
Card radius |
The platform app does not use these tokens. It inlines Tailwind ramps (slate / blue / indigo / emerald / amber / red) with a blue primary (bg-blue-600, from-blue-500 to-indigo-600) and amber reserved for the UPL disclaimer. Both apps are dark-only; there is no prefers-color-scheme path and no theme toggle.
Shared hex coincidence: both canvases are #0f172a / #e2e8f0. That is the entire overlap.
Component map¶
Platform (frontend/components/)¶
| File | Kind | Notes |
|---|---|---|
shell/ |
Chrome | The app shell: AppShell, Masthead, NavRail, ContextSidebar, InspectorPanel, MobileTabBar, PageLayout + StickyToolbar, Overlay (Drawer + useFocusTrap), CommandPalette, ShortcutsHelp, BackToTop, ShellScroll, useMediaQuery. Catalogued in frontend/ui/README.md. |
LegalDisclaimer.tsx |
Guardrail | Banner + Footer. UPL copy (BL-20260810-07). Required beside generated analysis. |
HomeStats.tsx |
Widget | Fetches agent/backlog/spec counts. |
AgentDashboard.tsx |
Screen (~1460 lines) | God component: registry, runs, backlog, specs, health, launch modal. |
AgentTrace.tsx |
Primitive-ish | Numbered steps + optional confidence badge. Confidence is shown as a percentage with no authority label (watch constitution §13 if this is ever wired to citation volume). |
AnalysisStudio.tsx |
Screen | IRAC form, live WS trace, coverage envelope, citation verified badges, UPL banner. |
KnowledgeGraph.tsx |
Screen | Case search + neighborhood fetch. |
GraphViewer.tsx |
Widget | Cytoscape canvas. Sizes case nodes by CITES in-degree when graph.show_citation_counts is on, and says in the canvas description — as KnowledgeGraph's legend does on screen — that the size measures litigation frequency, not correctness or authority (BL-20260803-03, constitution §13). Any future ranking signal owes the same label. |
LsatLab.tsx |
Screen (~1750 lines) | God component: overview, LR/RC/LG drills, stats, HITL authoring. The concept catalog left for the library. Parallel to lsat-static/, not shared. |
LsatLibrary.tsx |
Screen | The study surface: Articles and Concepts as two views of one shelf, both rendered through one entry template (header · actions · body · concepts/articles · related · reading tracks · references · provenance, fixed anchors, shared card component) — see docs/lsat-library.md § "The entry template". Same three-column grid, same rail row shape, one read-state store for both. |
lsat/SectionTimerWidget.tsx |
Docked widget | The section clock. Docks in the sidebar (default), inspector, or in page — moved from its own menu or /settings, persisted per instance. A view over lib/lsat/timerStore.ts, so moving it never resets a running section; it follows you to other modules while a section is in progress and survives a reload with the elapsed time counted (spec 043). |
lsat/QuestionElapsed.tsx |
Primitive | The per-question clock, and only that. It used to live in a file called LsatTimer.tsx, which read as a rival to the docked section widget above; that file is deleted and the component now sits in the LSAT folder beside SectionTimerWidget.tsx, under the same name and the same startAt/onTick shape as lsat-static/components/QuestionElapsed.tsx (BL-20260831-15). |
frontend/app/(app)/page.tsx still inlines its own Card and SectionHeading instead of extracting them (spec 039's job). Spec 041 fixed its two content bugs: the marketing footer became a labelled <nav>, so the page no longer renders two contentinfo landmarks alongside the shell's LegalDisclaimerFooter (BL-20260830-06), and the STACK blurb now names the real stack — Django 5 / Next 16, and the Claude→Ollama provider chain rather than Ollama-as-the-runtime (BL-20260830-03). It is the one route deliberately exempt from PageLayout (ux-audit: bare-page), because a condensing header would sit on top of its full-bleed hero.
Static LSAT (lsat-static/components/)¶
| File | Kind | Notes |
|---|---|---|
Overview.tsx |
Screen | Section cards, .btn-primary amber CTA. |
Drill.tsx |
Screen | Section timer + question nav + optional passage column. |
QuestionCard.tsx |
Primitive-ish | Accessible radiogroup (roving tabindex, arrows, Space/Enter). The strongest a11y implementation in the repo. |
PassagePanel.tsx |
Widget | Sticky RC/LG passage. |
SectionTimer.tsx |
Primitive | Warn / urgent / expired states via semantic classes. |
QuestionElapsed.tsx |
Primitive | The per-question clock, split out of SectionTimer.tsx so the platform's lsat/QuestionElapsed.tsx has a same-named counterpart here (R13, BL-20260831-15). |
Library.tsx |
Screen | Reading surface, two views: contents rail + block-rendered article, or the concept catalog. |
Concepts.tsx |
View | Filterable concept catalog, rendered by Library.tsx as its Concepts view. |
Stats.tsx |
Screen | localStorage attempt history, plus an Argumentative Writing figure read from lib/deviceState.readWritingState(). Writing is deliberately not a row of the section table: SECTIONS is ['LR','RC','LG'] because writing has no keyed questions, and there is no accuracy to report on work the learner scores themselves (#121). |
UX findings (priority)¶
Correctness / trust (constitution §13, UPL)¶
- UPL disclaimer is global and good. Both apps mount it. Analysis Studio
additionally shows
LegalDisclaimerBannernext to generated IRAC. Keep this as a primitive, not a one-off. NavBar "Local" pill is decorative.— resolved 2026-09-05 (BL-20260831-01).NavBar.tsxwas dead since the spec 040 shell and has been deleted; the shell's masthead carries no status pill, so nothing looks online that is not.- Confidence badges have no provenance.
AgentTracepaints a green percentage. Fine for model self-score if labelled; dangerous if a future change feeds citation counts into it. Citation volume is now drawn on the graph (BL-20260803-03) and is labelled there as litigation frequency; it must never be folded into a confidence or correctness number. Homepage STACK copy is stale— fixed in spec 041. It now names Django 5 / Next 16 and the Claude→Ollama provider chain. Marketing pages that lie about the stack train users (and agents) wrong, so this is a/ux-reviewD8 check, not a one-off.
Consistency¶
- Two accents, undocumented. Platform = blue/indigo. LSAT static = amber.
Keep both as named tokens (
--accent-brand,--accent-practice); do not silently pick one. - Two max-widths. Platform content is
max-w-7xl; LSAT is.wrapat 960px. Different jobs — document them as--page-max/--prose-max. - Two LSAT products.
LsatLab(API-backed, authoring, tutor) vslsat-static(offline,content.json). Visual language should converge; feature sets should not be merged in the design-system spec. Two timers.— resolved 2026-09-06 (BL-20260831-15). The confusion was a name, not a duplicate:LsatTimer.tsxexported only a question clock while the section clock lived elsewhere, so the two files read as rival implementations of one control.LsatTimer.tsxis deleted; the platform now haslsat/QuestionElapsed.tsx(per question) andlsat/SectionTimerWidget.tsx(per section, docked), and the static site'sQuestionElapsed.tsx/SectionTimer.tsxpair them by name. The remaining difference between the two section clocks is styling — Tailwind utilities in the platform, semantic CSS in the static site — which is finding 5's token split, not a second widget.
Accessibility¶
8b. Placeholder-only controls — three inputs were named only by their placeholder (graph case search, Agent Ops run filter, LSAT tutor follow-up); fixed in spec 042 and gated by ux_audit.py R11. The Cytoscape canvas is now a named role="img" region pointing at the case list as its accessible equivalent, instead of three anonymous <canvas> elements.
9. Focus rings exist only on the static site — fixed in spec 041.
.focus-ring / .focus-ring-practice in layout.css are the app-wide :focus-visible indicator; the twelve controls that paired focus:outline-none with a 1px focus:border-* were migrated onto them, and ux_audit.py R5 fails the build on a regression.
10. No skip link — both apps have one. The platform shell since
spec 040, lsat-static since spec 044 (first tab stop, revealed on focus, targeting the main#view that had always been a ready focus target with nothing pointing at it). Spec 044 also gave the static site a single contentinfo landmark and a tokenised sticky stack that keeps the section clock visible during a drill at ≥820px — pinning it on a phone would have cost 37% of the viewport.
11. — closed 2026-09-06 (BL-20260831-03). Spec 041 gated smooth scrolling and added prefers-reduced-motion is partial..shell-motion for shell transitions; the rest followed. Every animate-* utility in frontend/app and frontend/components now carries motion-reduce:animate-none — the homepage "live" dots and stat pulse, the route-group loading skeletons in app/(app)/loading.tsx, the LSAT skeletons in lsat/LabPrimitives.tsx and the tutor's streaming cursor — and GraphViewer runs its Cytoscape cose layout with animate: false. __tests__/components/HomeMotion.test.tsx fails on any bare animate-* in those trees, and __tests__/components/GraphViewer.test.tsx pins the layout flag.
12. QuestionCard keyboard pattern is the gold standard — ported in
spec 042. The platform LSAT Lab had a role="tablist" with dead arrow keys, seven tab stops, and no aria-controls/tabpanel, plus a role="radiogroup" with no name and no roving tabindex — strictly worse keyboard access than the static export of the same widget. Both now compose useRovingTabIndex (one tab stop, arrows move and select). ux_audit.py R10 gates the ARIA half; __tests__/shell/rovingFocus.test.tsx gates the keyboard half. A shared Choice component is still spec 039's. 12b. RC/LG had no per-question — fixed (BL-20260901-08). The platform's passage panel stacked every question of a set in one column, so N/PonNext was undefined there and Tab was the only route between questions, while LR advanced from the keyboard and the published static site's shortcut sheet advertised N/P for all three sections. PassagePanel now pages one question at a time like lsat-static/components/Drill.tsx: N forward (freely, since a fixed stack can be skipped and returned to), P back, a numbered jump strip that names each question's answered state, focus moved onto the new card, and the graded answer held by the panel so stepping back shows what you picked rather than a blank card. LR keeps the stricter rule — N only after grading — because a dealt stream has nothing to come back to. 12c. The spec 047 T-015 keyboard scheme was — ported (BL-20260901-06). frontend/lib/lsat/keyboard.ts is lsat-static onlylsat-static/lib/keyboard.ts with the shell's own isTypingTarget: same keyName grammar, same never-steal-from-a-text-field / never-double-fire / never-shadow-the-browser rules, same useModalBlock depth. QuestionCard binds A–E and N/P through it at the window instead of on its own DOM subtree — the old scoping meant no key did anything until you had tabbed or clicked into the card — and SolveAssist gained the static site's hint keys H/J/K/R. Two divergences are deliberate and enforced rather than left implicit: the module refuses [, ], ?, Escape and ⌘K (SHELL_RESERVED_KEYS), because the platform shell owns those on every route while the static site, having no shell, binds [/] for section paging; and Enter stays a card-scoped React handler, because a window binding must preventDefault() before it can run and Enter is the key every other button on the card already answers. The Writing bindings (O, T, mod+Enter, M) came with the Writing surface itself in BL-20260901-09. 12d. The lab had no Argumentative Writing surface — ported (BL-20260901-09). WS was the one section the API described and the lab could not open: the Overview card read "No drill in the lab yet", and the task law schools actually read was practisable only on the published static site. frontend/components/lsat/WritingPanel.tsx ports lsat-static/components/Writing.tsx — prompt list, prompt reader, the 35-minute clock driven by time_limit_minutes, a draft held in this browser under the static site's own key prefixes (lib/lsat/writingDrafts.ts), the rubric self-check, and the annotated model response gated behind submitting. The platform adds what a static bundle cannot have: POST /api/lsat/writing/evaluate reads the draft against the same rubric, offered after the self-check rather than instead of it, with every band labelled as machine-derived. ux_audit.py R13 learned to accept a counterpart named by path, so a port under a different filename is a checked claim rather than an exemption.
Maintainability¶
- No primitive layer. Every screen re-implements buttons, cards, inputs, pills, empty states as one-off
classNamestrings. - God components.
LsatLab.tsxandAgentDashboard.tsxare each >1.4k lines. A design system cannot form while screens own every atom. .design-sync/is a snapshot, not a system. Hand-maintainedentry.tsx/componentSrcMap/dtsPropsFor; compiledstyles.css(~915 KB) does not regenerate in CI; Tailwind safelist silently drops any ramp not pre-enumerated. Previews are useful; they must consume the future package, not define it.Unused dependencies add install/CVE surface for libraries the UI does not call (TanStack Query, framer-motion, lucide-react, xyflow).Closed by BL-20260830-01: all four are gone fromfrontend/package.jsonand the lockfile. Re-add one only in the commit that first imports it.- Docs/code drift on the kit itself (shadcn listed, not present) causes agents to import components that do not exist.
Governance target (spec 039)¶
The maintainable shape. layout.css and README.md shipped in spec 041; the rest is specs/039-design-system:
frontend/ui/
layout.css # SHIPPED (041) — shell metrics, sticky stack, z-scale, scroll + focus
README.md # SHIPPED (041) — catalog: when to use which token/class/primitive
tokens.css # 039 — CSS custom properties, the only palette
semantic.css # 039 — .btn, .card, .choice, .pill, .empty, …
components/ # 039 — React primitives (Button, Card, Input, …)
- Tokens are the source of truth.
lsat-static/app/globals.cssimports them;frontend/app/globals.cssmaps them into Tailwind v4@theme. - Primitives, not screens. Nav, disclaimer, choice, timer, card — not Analysis Studio.
- No shadcn, no Storybook, no new top-level
packages/. First-party, MIT-compatible, lives underfrontend/ui/so AGENTS.md's layout stays canonical. Storybook would be a new framework (constitution §2 + ADR). - Lint the contract. A structural test fails on raw hex / non-token palette classes in feature components once migration of a file is marked done.
.design-syncbecomes a consumer offrontend/ui/, not a second palette. The compiled 915 KB stylesheet is regenerated from tokens + primitives, or dropped.
Dark-only remains the v1 theme. Light mode is a follow-up, not a requirement of 039.
Scopes: who a preference belongs to (BL-20260905-10, BL-20260830-08)¶
Two scopes are live. Instance (instance:local) is the seeded default an admin can set — and lock. User (user:<pk>, named by the server in /api/settings/values, never minted client-side) is where a signed-in person's own layout lands: every ui.* setting plus lsat.timer.* and lsat.library.* is settableAt: ['instance', 'user'] (USER_SETTABLE in frontend/lib/settings/define.ts), so two people sharing an instance stop overwriting each other's layout now that settings persist server-side. Policy values — analysis.hitl_threshold, graph.show_citation_counts — stay instance-only: they are not preferences. resetLayout deletes the user's rows and leaves the instance default standing; signed out, the chain is the single instance scope spec 040 shipped and nothing changes.
Project scope is a spec-036 matter, selected in the masthead's ScopeSwitcher. Its id always comes from a row the server returned (project:<id>), and a ?matter=<slug> deep link is re-resolved against the caller's own matters — an unknown or unowned slug falls back to the instance scope in silence, because "not yours" and "does not exist" must look identical.
How to change the UI after 039¶
- Token change — edit
frontend/ui/tokens.css, update the table in this file, runmake test-frontend. - New primitive — add
frontend/ui/components/<Name>.tsx+ a Vitest file underfrontend/__tests__/ui/. Do not put one-off variants in screen files. - Screen work — compose primitives. No new hex, no new semantic class that isn't in
semantic.css. - UPL — any surface that shows model-generated legal analysis must render
LegalDisclaimerBanner; every page keeps the footer. - Authority labelling — if a control sizes, ranks, or colors nodes by citation count or centrality, the legend must say what the number measures (constitution §13). Never "importance."
- Shell work — compose
PageLayout,StickyToolbar,Drawer, and the.shell-*classes from frontend/ui/README.md. Register new destinations infrontend/lib/modules/catalog.ts; never teachAppShell.tsxa route name. Runmake ux-auditbefore you push. - Periodic review — run
/ux-review(see docs/ui-ux-review.md) rather than waiting for someone to notice the shell has drifted. Each pass scores eight dimensions, fixes the single worst one, and promotes the fix intoscripts/ux_audit.pyorfrontend/__tests__/shell/.

















