Skip to content

The open-source app everyone uses to manage agents at work

feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134)

scotttongc07e650cd790
diff --git a/.claude/agents/codemod-runner.md b/.claude/agents/codemod-runner.md
new file mode 100644
index 0000000000..3fafe19b69
--- /dev/null
+++ b/.claude/agents/codemod-runner.md
@@ -0,0 +1,17 @@
+---
+name: codemod-runner
+description: Writes and runs codemod scripts that replace hardcoded visual values with token references in ui/src/index.css. Use for Phase 2 of the design simplification run — mechanical refactors only.
+tools: Read, Write, Edit, Bash, Glob, Grep
+model: sonnet
+---
+
+You perform mechanical refactors via scripts, never hand-edits. Follow DESIGN.md at the repo root.
+
+Rules:
+
+- The token destination is ui/src/index.css (Tailwind v4), optionally a tokens.css imported by it. NEVER create a parallel token source. Tokens that must be runtime-tunable go in a NON-inline block — `@theme inline` bakes literals at build time.
+- Where a hardcoded value EXACTLY matches an existing token, replace it with that token reference. Otherwise extract the value into a new token VERBATIM — no normalizing, rounding, or inventing a scale. Ugly values stay ugly.
+- Every rewrite happens through a codemod script committed to scripts/ before it is run. Scripts must be idempotent and reviewable.
+- Third-party style overrides that cannot use tokens go on a documented allowlist in the token source, each with an inline comment saying why.
+- Verify after every script run: rg gates (zero hardcoded hex, zero arbitrary px/bracket values in ui/src/components/** and ui/src/pages/** outside the allowlist), pnpm typecheck, and the Storybook snapshot suite. Snapshots must match the Phase 0 baseline exactly.
+- If a replacement cannot be made without visual change, skip it and record it in doc/design/TOKEN-AUDIT.md under "Needs human decision".
diff --git a/.claude/agents/token-auditor.md b/.claude/agents/token-auditor.md
new file mode 100644
index 0000000000..07561c8052
--- /dev/null
+++ b/.claude/agents/token-auditor.md
@@ -0,0 +1,16 @@
+---
+name: token-auditor
+description: Scans ui/src/ for hardcoded visual values, duplicate components, and shadcn replacement candidates; produces doc/design/TOKEN-AUDIT.md and doc/design/COMPONENT-INVENTORY.md. Read-only on source — never modifies component files. Use for Phase 1 of the design simplification run.
+tools: Read, Grep, Glob, Bash
+model: sonnet
+---
+
+You inventory design-system debt in this repository. Follow DESIGN.md at the repo root; read doc/design/PRIOR-ART.md first — a previous audit found only 6 of ~220 drift sites were exact-value-mappable to existing tokens, so expect most hardcoded values to need new verbatim tokens.
+
+Your outputs (written to the repo root):
+
+1. TOKEN-AUDIT.md — every hardcoded color/spacing/radius/type/shadow value in ui/src/, with frequency, file locations, and near-duplicate clusters (e.g. 13/14/15px used interchangeably). For each value, note whether it EXACTLY matches one of the ~80 existing tokens in ui/src/index.css (semantic / brand / domain tiers — see DESIGN.md). Flag clusters for human review; never merge or normalize them. Include a "Needs human decision" section.
+
+2. COMPONENT-INVENTORY.md — all components under ui/src/components/ (24 primitives in ui/, ~277 feature components), their variants, and suspected duplicates with evidence (similar props, similar rendered output, copy-pasted origins). Include a "shadcn candidates" section: (a) custom components duplicating an available shadcn primitive, (b) installed shadcn components that drifted from the registry (npx shadcn@latest diff where available), (c) raw Radix/plain elements where an installed shadcn wrapper exists. For each, state the recommended replacement and expected visual impact. Recommendations only — merges and swaps happen in later human-approved runs, never this one.
+
+Never modify source files. Bash access is for read-only commands (rg, find, npx shadcn diff) and writing the two report files only.
diff --git a/.github/workflows/storybook-visual.yml b/.github/workflows/storybook-visual.yml
new file mode 100644
index 0000000000..325ca62696
--- /dev/null
+++ b/.github/workflows/storybook-visual.yml
@@ -0,0 +1,102 @@
+name: Storybook Visual
+
+on:
+ workflow_dispatch:
+ inputs:
+ update_snapshots:
+ description: "Generate updated snapshots and a baseline review bundle"
+ required: false
+ type: boolean
+ default: false
+ pull_request:
+ branches:
+ - master
+ types:
+ - opened
+ - reopened
+ - synchronize
+ - labeled
+
+concurrency:
+ group: storybook-visual-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ visual:
+ name: Storybook visual regression
+ if: >-
+ github.event_name == 'workflow_dispatch' ||
+ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'storybook-visual'))
+ runs-on: ubuntu-latest
+ timeout-minutes: 35
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v6
+ with:
+ version: 9.15.4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v6
+ with:
+ node-version: 24
+ cache: pnpm
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Install Playwright Chromium
+ run: npx playwright install --with-deps chromium
+
+ - name: Cache Storybook visual baseline archive
+ uses: actions/cache@v5
+ with:
+ path: tests/storybook-visual/.cache
+ key: storybook-visual-baseline-${{ runner.os }}-${{ hashFiles('tests/storybook-visual/baseline-manifest.json') }}
+
+ - name: Download Storybook visual baseline
+ run: pnpm storybook-visual:baseline download
+
+ - name: Verify Storybook visual baseline
+ run: pnpm storybook-visual:baseline verify
+
+ - name: Build Storybook
+ run: pnpm build-storybook
+
+ - name: Run Storybook visual tests
+ if: ${{ github.event.inputs.update_snapshots != 'true' }}
+ run: npx playwright test --config tests/storybook-visual/playwright.config.ts
+
+ - name: Generate updated snapshots for review
+ if: ${{ github.event.inputs.update_snapshots == 'true' }}
+ run: npx playwright test --config tests/storybook-visual/playwright.config.ts --update-snapshots
+
+ - name: Pack updated baseline review bundle
+ if: ${{ github.event.inputs.update_snapshots == 'true' }}
+ run: pnpm storybook-visual:baseline pack
+
+ - name: Upload Storybook visual report
+ uses: actions/upload-artifact@v7
+ if: always()
+ with:
+ name: storybook-visual-report-${{ github.run_id }}
+ path: |
+ tests/storybook-visual/playwright-report/
+ tests/storybook-visual/test-results/
+ retention-days: 30
+ if-no-files-found: warn
+
+ - name: Upload updated baseline review bundle
+ uses: actions/upload-artifact@v7
+ if: ${{ github.event.inputs.update_snapshots == 'true' }}
+ with:
+ name: storybook-visual-baseline-review-${{ github.run_id }}
+ path: tests/storybook-visual/baseline-review/snapshots.tgz
+ retention-days: 30
+ if-no-files-found: error
diff --git a/.gitignore b/.gitignore
index 09af52ce16..4284013138 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,6 +56,11 @@ tests/e2e/test-results/
tests/e2e/playwright-report/
tests/release-smoke/test-results/
tests/release-smoke/playwright-report/
+tests/storybook-visual/.cache/
+tests/storybook-visual/.snapshots/
+tests/storybook-visual/baseline-review/
+tests/storybook-visual/test-results/
+tests/storybook-visual/playwright-report/
.superset/
.superpowers/
.claude/worktrees/
diff --git a/AGENTS.md b/AGENTS.md
index ddefe527d6..cc341f6861 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -220,3 +220,7 @@ PR #2218 (`feat/external-adapter-phase1`) adds external adapter support. See roo
- `createServerAdapter()` must include ALL optional fields (especially `detectModel`)
- Built-in UI adapters can shadow external plugin parsers; external override pause/resume should restore the built-in parser.
- Reference external adapters: Droid (npm); Hermes can also be tested as an override package.
+
+## Design system
+
+`DESIGN.md` at the repo root is the source of truth for UI design decisions. The token-only rule applies to all `ui/` changes: every color, spacing, radius, type, shadow, and motion value in `ui/src/components/**` and `ui/src/pages/**` comes from the token layer in `ui/src/index.css` — no hex, raw px, arbitrary Tailwind bracket values, or raw `font-size`/`fontSize` declarations in components, outside the documented allowlist in `ui/src/index.css`. Run `pnpm check:token-gates` (`scripts/check-token-gates.mjs`) before committing UI changes — it fails on any violation not covered by that allowlist.
diff --git a/DESIGN.md b/DESIGN.md
new file mode 100644
index 0000000000..6eaa1e12cf
--- /dev/null
+++ b/DESIGN.md
@@ -0,0 +1,58 @@
+# Paperclip Design Principles
+
+**Status:** v0.3 — anchor document for design-language simplification. Governs structure, not brand. Brand values (color, type, iconography) are intentionally unspecified: they are being redesigned and will land as token values only. Nothing in `ui/` may hardcode them. Spacing/radius scales are likewise TBD pending the token audit (see Principle 3).
+
+Changes from v0.2: token layer location corrected to the repo's real source (`ui/src/index.css`); existing token tiers inventoried; snapshot-coverage scope bounded for Run 1; the issue→task copy rename moved out of the zero-visual-change run.
+
+## What this document is for
+
+Agents and humans modifying `ui/` treat this file as the source of truth for design decisions. Storybook is the verification surface — it documents the system; it does not define it. If a change conflicts with this document, change this document first (with review) or change the code.
+
+## Product stance
+
+Paperclip is an operational control plane: org charts, tasks, heartbeat runs, budgets, approvals, audit logs. The user is an operator scanning state and making decisions. Every screen should answer, in order: *what is happening, does it need me, what do I do about it.* Density in service of scanning beats whitespace in service of aesthetics — but density comes from information, never from chrome.
+
+## The token layer (where visual values live)
+
+The single token source is **`ui/src/index.css`** (Tailwind v4; there is no tailwind config file — tokens are CSS custom properties consumed via `@theme`). Do NOT create a parallel token source such as `ui/src/tokens/` — that would produce two sources of truth. If index.css grows unwieldy, extracted values may live in a `tokens.css` **imported by index.css** so the pipeline still has one root.
+
+Tailwind v4 gotcha: `@theme inline` bakes literal values at build time. Any token that must be runtime-tunable (theme editor, dark mode overrides) must be defined in a NON-inline block.
+
+Existing tiers already in index.css (~80+ tokens) — extraction maps to these on **exact value match** before minting anything new:
+
+1. **Semantic tier** — shadcn core set: `--background`, `--foreground`, `--card`, `--primary`, `--secondary`, `--muted`, `--accent`, `--destructive`, `--border`, `--input`, `--ring`, `--sidebar-*`, `--chart-1..5` (OKLCH, light/dark overrides).
+2. **Brand tier** — agent gradients `--agent-1a/1b..10a/10b` (fixed hex) and status hues `--status-task-*` / `--status-agent-*` (WCAG-tuned; see inline comments).
+3. **Domain tier** — match-chip tokens `--chip-match-*`, annotation highlights `--paperclip-doc-annotation-highlight-*`, plus motion/typography tokens.
+
+## Principles
+
+1. **One way to say each thing.** One component per job. One Button, one Card, one Badge, one Table, one EmptyState. Variants are props, not new components. Before creating a component, prove no existing one covers the job.
+2. **Tokens are the only source of visual values.** All color, spacing, radius, type size/weight, shadow, and motion values come from the token layer. No hex, no raw px, no ad-hoc Tailwind arbitrary values (`p-[13px]`) in components. If a needed value doesn't exist, add a token — don't inline it. Tailwind palette classes (`bg-red-500`, `text-zinc-400`, etc.) ARE hardcoded values in spirit: they name a literal color, not a semantic role. They are in-scope debt scheduled for a dedicated future run (Run 4, cluster-by-cluster mapping to semantic tokens per doc/design/DECISION-SHEET.md B2) and are not currently gated by check-token-gates. Exception (doc/design/DECISION-SHEET.md B1 user ruling): first-party intentional one-off decoration on demo/UX-lab surfaces stays inline and allowlisted rather than minted as singleton tokens.
+3. **Spacing routes through tokens; the scale comes later.** During simplification, extract every spacing and radius value verbatim into tokens — do not normalize, round, or invent a scale. The final scale is a design decision made by a human after reviewing the token audit. Structural rules apply now: vertical rhythm within a container uses one gap value, not per-element margins, and siblings never carry both margin and gap.
+4. **Hierarchy through structure, not decoration.** Prefer position, size, and weight over borders, backgrounds, and dividers. Every border, divider, and background fill must justify itself; when in doubt, remove it. A screen should survive the removal of one visual layer.
+5. **Status is systematic.** States like running / paused / blocked / awaiting-approval / over-budget map to a single semantic status token set used identically everywhere (badge, row, chart, log). An operator learns the vocabulary once.
+6. **Machine values look machine-made.** IDs, costs, token counts, timestamps, and log output use the monospace token and consistent formatting helpers. Never format these ad hoc per screen.
+7. **Words are part of the system.** One name per concept across the entire UI — the canonical term is *task* (never *issue* or *ticket* in copy, labels, or empty states). Buttons name the action ("Approve hire," not "Submit"). Errors say what happened and what to do. Empty states say what to do first. **Note:** enforcing the task rename is a visible change and is explicitly OUT of the zero-visual-change extraction run; it happens in its own follow-up run.
+8. **Agent-modifiable by design.** The system must be changeable via instructions: single token source, lint rules that enforce it, and this document kept current. A correct change should be expressible as "edit tokens + run checks," not "visit 40 files."
+
+## Enforcement (what "compliant" means for the extraction run)
+
+- **Zero visual change is proven, not promised:** Storybook visual snapshots are baselined before any refactor, and all snapshots match baseline after it. A change that alters rendered output must be intentional and human-approved.
+- **Baseline scope for Run 1:** the shared primitives in `ui/src/components/ui/` (each gets a story if missing — there are only ~24) plus the ~46 existing stories under `ui/storybook/stories/`. Do NOT attempt a story for every feature component (~277) in this run; full coverage is a later effort.
+- Mechanical rewrites (value extraction, renames) are done via committed codemod scripts in `scripts/`, not hand-edits — reviewable once, repeatable forever.
+- Token layer is the single source (`ui/src/index.css`, per above) consumed via CSS variables / Tailwind theme — never values copied into components.
+- Lint/grep gates pass: zero hardcoded hex values, zero arbitrary spacing values, zero raw font-size declarations in `ui/src/components/**` and `ui/src/pages/**` outside the token layer and a documented allowlist (third-party overrides, intentional opt-outs commented inline).
+- `pnpm build`, `pnpm typecheck`, and `pnpm build-storybook` pass.
+- AGENTS.md links here and states the token-only rule.
+
+Aspirational (NOT gating this run): no duplicate components; every component has exactly one story covering its variants; all UI copy says "task".
+
+## Out of scope (do not do during simplification)
+
+No visual redesign, no new colors or typefaces, no layout restructuring, no new dependencies beyond snapshot tooling, no component consolidation/merges (audit + recommend only), no copy renames, no changes to server code or app logic. Simplification means fewer parts, same product.
+
+## Prior art (read before auditing)
+
+See `doc/design/PRIOR-ART.md` — a previous audit pass (PAP-280/283/284, on the `PAP-282-playground` branch, NOT on master) found that of ~220 hardcoded drift sites, only 6 were exact-value-mappable to existing tokens; expect the verbatim extraction to mint many new tokens that the human scale-collapse step later merges. It also drafted usage rules (radius tiers, CTA tiers, named type styles) that are good candidates for the post-audit scale decision.
+
+How-to guide for day-to-day UI changes: see `doc/design/CHANGING-THE-UI.md`.
diff --git a/doc/DEVELOPING.md b/doc/DEVELOPING.md
index 031e16800a..a0a6100cec 100644
--- a/doc/DEVELOPING.md
+++ b/doc/DEVELOPING.md
@@ -56,6 +56,26 @@ pnpm build-storybook
These run the `@paperclipai/ui` Storybook on port `6006` and build the static output to `ui/storybook-static/`.
+The Storybook visual regression suite uses external PNG baselines instead of
+committed screenshots:
+
+```sh
+pnpm test:storybook-visual
+pnpm test:storybook-visual:update
+```
+
+`pnpm test:storybook-visual` downloads and verifies the baseline archive from
+`tests/storybook-visual/baseline-manifest.json` before running Playwright.
+Accepted visual changes should update the manifest metadata and publish a new
+immutable archive with `pnpm storybook-visual:baseline pack` and
+`pnpm storybook-visual:baseline upload`; do not commit generated PNG snapshots.
+
+PR visual checks are opt-in while the suite stabilizes. Add the
+`storybook-visual` label to a PR, or run the `Storybook Visual` GitHub Actions
+workflow manually, to produce downloadable Playwright report/test-result
+artifacts. Normal PR visual runs use read-only repository permissions and do not
+upload or mutate baseline objects.
+
## UI Fonts And Screenshots
The board UI ships its own sans-serif webfont assets in `ui/public/fonts/`.
diff --git a/doc/design/AGENT-SESSIONS.md b/doc/design/AGENT-SESSIONS.md
new file mode 100644
index 0000000000..5d83784689
--- /dev/null
+++ b/doc/design/AGENT-SESSIONS.md
@@ -0,0 +1,66 @@
+# Running an AI-agent session against the design system
+
+A guide for the *human* driving the session. You don't need to know the codebase — the system briefs the agent for you (AGENTS.md → `DESIGN.md` → `doc/design/`). Your job is to say what you want, look at pictures, and say yes or no. This document tells you how to do that well.
+
+## The golden rule
+
+**Describe outcomes, not implementations.** The whole point of the token system is that intent maps to small, safe changes:
+
+- ✅ "Make all the running indicators the same blue as the status chips."
+- ✅ "The smallest text in the sidebar is hard to read — bump it one step."
+- ✅ "Corners feel too sharp. Round everything slightly."
+- ❌ "Edit line 1899 of IssueChatThread.tsx" (you'll be wrong, and it doesn't matter — the agent finds the sites)
+
+If your ask names a *feeling* ("too loud", "cramped", "inconsistent"), that's fine — expect the agent to translate it into a token change and show you the before/after to confirm the translation.
+
+## Pick the session size
+
+**Small (minutes) — a value change.** Colors, sizes, spacing, radius, one component's look.
+> "In the Paperclip repo: make X look like Y. Show me before/after screenshots from the visual suite before you re-baseline anything."
+
+The agent should: edit token(s) → run `pnpm test:storybook-visual` → show you the diff images → only after your yes, run `test:storybook-visual:update`, publish the packed baseline archive from a trusted maintainer environment, and commit the code change + manifest update together.
+
+**Medium (an afternoon) — a retheme or a component-family restyle.** Ask for a **git worktree** so main stays untouched:
+> "Create a worktree off master, apply shadcn preset `<CODE>` as token values only (values-only — review the CLI's diff, revert scaffolding), reconcile the Paperclip status/agent color tiers, then build me a before/after gallery of the key surfaces."
+
+Review the gallery, iterate ("the dark red is too soft", "two different greens on toggles — one green"), then tell it to re-baseline and merge when you're satisfied.
+
+**Large (a day, unattended) — a bounded autonomous run.** Use `/goal` with a *measurable* finish line — the evaluator needs conditions a command can verify, not aspirations:
+> Good conditions: "rg finds zero palette classes in ui/src/components", "the snapshot suite passes against the pinned external baseline", "pnpm check:token-gates reports 3/3 CLEAN".
+> Bad conditions: "the UI feels cleaner", "design is more consistent".
+
+See `doc/design/GOAL-PROMPT.md` for a complete worked example (the run that built this system), including the phase structure and guardrails worth copying: work in a worktree, commit per phase, never re-baseline without human review, stop-and-report over partial application.
+
+## What to demand from the agent (your checklist)
+
+Hold every session to these five, regardless of size:
+
+1. **Pictures before permanence.** Never approve on description. The suite produces before/actual/diff images for every changed story — ask for them ("show me these visually before I decide"). For subtle changes, ask for full-resolution images, not compressed thumbnails.
+2. **Proof commands, not claims.** "Done" means: `pnpm check:token-gates` 3/3 CLEAN, `pnpm typecheck` green, suite result stated as a number ("510/510" or "N intentional diffs pending your review"). If the agent says done without these, ask for the outputs.
+3. **Baselines ride with the change.** Intentional visual change → updated manifest metadata in the same commit, after the packed archive is reviewed and published. An agent that updates baselines to silence a failure it can't explain is the one thing you never accept.
+4. **Mechanical changes via scripts.** If it's touching 20+ files with the same rewrite, it should write an idempotent codemod in `scripts/` (existing `codemod-*.mjs` files are the pattern), not hand-edit.
+5. **Decisions get written down.** Anything judgment-shaped (a mapping, an exception, a deferral) goes in `doc/design/DECISION-SHEET.md` with one line of rationale.
+
+## Reviewing like a designer
+
+- **Contact sheet**: the diff images under `tests/storybook-visual/test-results/` are your primary review surface; ask the agent to assemble them into a browsable before/after page (or use `npx playwright show-report` from `tests/storybook-visual/`).
+- **Live test drive**: for big changes, ask for a running instance from the worktree — `pnpm paperclipai worktree init` once, then `PORT=3300 pnpm dev:once` gives an isolated Paperclip (own database, own config; your real instance is untouched). Click around; real use surfaces what screenshots can't.
+- **Side-by-side Storybook**: old on one port, new on another (`pnpm storybook` in each checkout), flip tabs.
+- Trust your eyes over the agent's summary. If something looks wrong, say so plainly ("the text in the red boxes is illegible") — vague feedback is fine, the screenshots give the agent the precision.
+
+## Safety rails (and the forbidden moves)
+
+- **Worktrees for anything nontrivial.** Master is never touched until an explicit merge; the scrap path is deleting the worktree.
+- **Pushing is a separate, explicit step.** Nothing goes to GitHub until you say push.
+- Forbidden, always: `shadcn apply --preset` (overwrites components); re-baselining snapshots to hide an unexplained diff; hardcoding a value because a token "doesn't fit" (add the token instead); "fixing" the scheduled-debt areas ad hoc (palette classes, card/pill consolidation — see DECISION-SHEET).
+
+## When something goes wrong
+
+- **Suite fails and the agent didn't change visuals** → it broke something; the diff image shows where. Don't let it re-baseline.
+- **A test fails asserting an old literal value** → lockstep case: the assertion updates to the token form, in the same commit as an explanation.
+- **A story flakes under full-suite load** → have it re-run that story in isolation before treating it as real (three known flakes are documented in DECISION-SHEET).
+- **The agent is stuck or looping** → ask for a status report with the three proof commands; completed phases are committed, so restarting a session loses almost nothing.
+
+## The short version
+
+Say what you want in plain language → agent turns it into token/component edits → you review before/after screenshots → you say "ship it" or say what's off → repeat. Every round today's system was built with took under an hour. That loop *is* the design workflow now.
diff --git a/doc/design/CHANGING-THE-UI.md b/doc/design/CHANGING-THE-UI.md
new file mode 100644
index 0000000000..49ee2a721e
--- /dev/null
+++ b/doc/design/CHANGING-THE-UI.md
@@ -0,0 +1,74 @@
+# Changing Paperclip's UI — a field guide
+
+How to make visual changes now that the design system exists. Written for everyone: designers, engineers, and AI agents (AGENTS.md points here via DESIGN.md).
+
+## The one-minute mental model
+
+Paperclip's look lives in **three layers**, and you almost always work in the first one:
+
+1. **Tokens** — every color, text size, spacing, radius, and shadow is a named value in `ui/src/index.css`. Change a token, and every surface using it follows.
+2. **Components** — consume tokens, never raw values. One component per job (one Button, one Card, one ToggleSwitch).
+3. **Screenshots** — 510 baseline images (255 stories × light/dark) downloaded into `tests/storybook-visual/.snapshots/` from the pinned external archive in `tests/storybook-visual/baseline-manifest.json`. They are the proof of what the UI looks like. Any visual change shows up as a screenshot diff; no visual change proves itself the same way.
+
+The rules live in [`DESIGN.md`](../../DESIGN.md) (repo root). The reasoning behind past decisions lives in [`DECISION-SHEET.md`](DECISION-SHEET.md). If you disagree with a rule, change `DESIGN.md` first (with review) — don't quietly diverge in code.
+
+## The three commands
+
+```bash
+pnpm check:token-gates # am I allowed to write this? (no hardcoded values)
+pnpm test:storybook-visual # what does my change look like? (diff vs baseline)
+pnpm test:storybook-visual:update # accept my intentional changes as the new baseline
+```
+
+## Recipe 1 — change how something looks everywhere
+
+*"Make the corners rounder." "That amber is too loud." "Bump the smallest text size."*
+
+1. Find the token in `ui/src/index.css` (they're named and commented: `--radius`, `--status-task-todo`, `--text-micro`, …).
+2. Change the value.
+3. `pnpm test:storybook-visual` — it will "fail" on every affected story. That's the point: each failure writes a before/actual/diff image triplet into `tests/storybook-visual/test-results/`. Review them (or `npx playwright show-report` from `tests/storybook-visual/` for a browsable version).
+4. Happy? `pnpm test:storybook-visual:update`, review the generated bundle under `tests/storybook-visual/baseline-review/`, publish it from a trusted maintainer environment, then commit the token edit **and** the updated manifest metadata together.
+
+Notable single-knob tokens: `--radius` drives the entire corner ladder (sm→4xl are derived); the `--status-task-*` / `--status-agent-*` family is the app-wide status vocabulary (chips, charts, bars, live dots all follow it).
+
+## Recipe 2 — retheme the whole app
+
+The core palette follows the shadcn token names, so a theme built at ui.shadcn.com/create applies as token values:
+
+```bash
+cd ui && pnpm dlx shadcn@latest init --preset <CODE> --force --no-reinstall
+```
+
+Then **review the git diff and keep only the CSS-variable value changes** — the CLI also tries to rewrite `components.json`, `lib/utils.ts`, and add dependencies; revert those (it once deleted 240 lines of our utils). Never use `shadcn apply --preset` (it overwrites component files). After the token diff is clean: Recipe 1 steps 3–4, plus a sanity pass on the Paperclip-specific tiers (agent gradients, WCAG-tuned status hues) for clashes.
+
+## Recipe 3 — build or style a component
+
+- **Values**: tokens only. No hex, no `text-[11px]`, no `p-[13px]`. If no token fits, **add a token** — that's a feature, not a workaround.
+- **Type**: use the named ladder — `--text-nano` (10px) / `--text-micro` (11px) / Tailwind `text-xs` (12) / `--text-compact` (13) / `text-sm` (14). Letter-spacing: `--tracking-label` / `--tracking-eyebrow` / `--tracking-caps`.
+- **Status**: anything that means running/idle/paused/error/todo/done/blocked uses the status system (`ui/src/lib/status-colors.ts` helpers or `--status-*` tokens). Liveness is always blue.
+- **Primitives**: check `ui/src/components/ui/` and `doc/design/COMPONENT-INVENTORY.md` before writing a new component. Switches are `ToggleSwitch`; badges/chips route through `brandChipBadge`.
+- **Give it a story.** New visual surface = new Storybook story = automatic screenshot coverage forever.
+- `pnpm check:token-gates` before you push. If a value genuinely can't be a token (third-party config, canvas fills, intentional one-off decoration on demo pages), it goes on the allowlist **with an inline comment saying why**.
+
+## Recipe 4 — you changed something and snapshots failed
+
+That's the system working. Two cases:
+
+- **You meant it** → review the diffs (they're your design review), then `pnpm test:storybook-visual:update`, publish the packed baseline archive, and commit the manifest update with the change. A PR with visual changes but no baseline-manifest update is incomplete; baseline changes with no explanation are a red flag.
+- **You didn't mean it** → you broke something. The diff images show you exactly where. Do not update the baseline to make it green.
+
+Three stories are known to flake under full parallel load (they pass in isolation — see DECISION-SHEET). Re-run a single story with `npx playwright test --config tests/storybook-visual/playwright.config.ts -g "<story name>"` before assuming a real failure.
+
+## For AI-agent sessions
+
+(Running a session as the human? See [`AGENT-SESSIONS.md`](AGENT-SESSIONS.md) — this section is instructions for the agent itself.)
+
+This system was built to be steered by instruction. "Make all running indicators blue" or "collapse these three grays into one" should land as a token edit or a small codemod plus a snapshot diff — not a manual hunt. If a change is mechanical and touches many files, write an idempotent script in `scripts/` (see `codemod-*.mjs` for the pattern) instead of hand-editing. DESIGN.md is loaded via AGENTS.md; follow it exactly, and record consequential choices in DECISION-SHEET.md.
+
+## What's deliberately not done yet (don't fix ad hoc)
+
+- **Tailwind palette classes** (`bg-red-500`, ~3,100 sites) — scheduled for a dedicated cluster-by-cluster conversion pass; piecemeal fixes will collide with it.
+- **Hand-rolled cards/pills → `Card`/`Badge`**, sidebar agents-section unification — queued as a component-convergence pass with per-site snapshot verification.
+- **ESLint ratchet** — will eventually enforce the token rules at lint time; until then `check:token-gates` is the gate.
+
+See `DECISION-SHEET.md` for the full ledger.
diff --git a/doc/design/COMPONENT-INVENTORY.md b/doc/design/COMPONENT-INVENTORY.md
new file mode 100644
index 0000000000..3554292745
--- /dev/null
+++ b/doc/design/COMPONENT-INVENTORY.md
@@ -0,0 +1,377 @@
+# COMPONENT-INVENTORY.md — Component Inventory (Phase 1)
+
+Run scope: `ui/src/components/` and `ui/src/pages/` on branch `design/token-extraction`. Read-only audit — no source files modified.
+
+**All consolidation, merge, and shadcn-swap recommendations in this document are RECOMMENDATIONS ONLY.** Per `GOAL-PROMPT.md` and `DESIGN.md`, no component merges, deletions, or swaps happen in this run. They become human-approved follow-up runs ("Run 2"/"Run 3").
+
+## Counts
+
+| Area | Count |
+|---|---:|
+| Shared primitives (`ui/src/components/ui/`) | 24 |
+| Feature components, flat (`ui/src/components/*.tsx`) | 178 |
+| Feature components, nested subdirs (`access/`, `artifacts/`, `environment-variables-editor/`, `interrupt-handoff/`, `issue-output/`, `issue-properties/`, `routine-sections/`, `search/`, `timeline/`, `transcript/`) | 28 |
+| **Feature components total** | **206** |
+| Pages (`ui/src/pages/`, incl. `pages/secrets/`) | 73 |
+| **Grand total** | **303** (roughly matches DESIGN.md's "24 + ~277") |
+
+---
+
+## 1. Shared primitives — `ui/src/components/ui/` (24)
+
+All 24 checked against the live shadcn registry via `npx shadcn@latest diff` (network-available in this environment). Aggregate `diff` and per-component spot checks (`button`, `dialog`) both returned **"No updates found"** — these are currently in sync with the upstream registry source.
+
+| Component | File | Registry name | Variants (props) | Purpose |
+|---|---|---|---|---|
+| Alert Dialog | `alert-dialog.tsx` | `alert-dialog` | (Radix primitive passthrough) | Confirm/destructive-action modal |
+| Avatar | `avatar.tsx` | `avatar` | `size` (sm/default), `shape` (circle/square via `data-shape`) | User/agent avatar with fallback initials |
+| Badge | `badge.tsx` | `badge` | `variant` (default/secondary/destructive/outline) | Generic pill label |
+| Breadcrumb | `breadcrumb.tsx` | `breadcrumb` | (Radix/plain nav passthrough) | Page breadcrumb trail |
+| Button | `button.tsx` | `button` | `variant` (default/destructive/outline/secondary/ghost/link), `size` (default/sm/lg/icon/icon-sm/icon-xs) | CTA / action button, all tiers |
+| Card | `card.tsx` | `card` | Header/Title/Description/Content/Footer subparts | Bordered content container |
+| Checkbox | `checkbox.tsx` | `checkbox` | (Radix passthrough) | Boolean input |
+| Collapsible | `collapsible.tsx` | `collapsible` | (Radix passthrough) | Expand/collapse section |
+| Command | `command.tsx` | `command` | Dialog/Input/List/Item/Group/Separator/Shortcut | ⌘K palette primitive (backs `CommandPalette`) |
+| Dialog | `dialog.tsx` | `dialog` | (Radix passthrough), expandable max-width transition | Modal dialog |
+| Dropdown Menu | `dropdown-menu.tsx` | `dropdown-menu` | Item/CheckboxItem/RadioItem/Sub/Separator/Shortcut | Context/action menu |
+| Input | `input.tsx` | `input` | (native input passthrough) | Text input |
+| Label | `label.tsx` | `label` | (Radix passthrough) | Form field label |
+| Popover | `popover.tsx` | `popover` | (Radix passthrough) | Floating panel |
+| Radio Card | `radio-card.tsx` | **not a standard registry name** | (custom, card-shaped radio option) | Large selectable option card (onboarding/settings pickers) |
+| Scroll Area | `scroll-area.tsx` | `scroll-area` | (Radix passthrough) | Styled scroll container |
+| Select | `select.tsx` | `select` | (Radix passthrough) | Dropdown select |
+| Separator | `separator.tsx` | `separator` | `orientation` | Divider line |
+| Sheet | `sheet.tsx` | `sheet` | `side` (top/right/bottom/left) | Slide-in drawer |
+| Skeleton | `skeleton.tsx` | `skeleton` | (plain div passthrough) | Loading placeholder |
+| Tabs | `tabs.tsx` | `tabs` | (Radix passthrough) | Tab navigation |
+| Textarea | `textarea.tsx` | `textarea` | (native passthrough) | Multi-line text input |
+| Toggle Switch | `toggle-switch.tsx` | **not a standard registry name** (registry has `switch`) | (custom on/off toggle) | Boolean toggle control |
+| Tooltip | `tooltip.tsx` | `tooltip` | (Radix passthrough) | Hover/focus hint |
+
+**Note:** `radio-card` and `toggle-switch` are not standard shadcn registry component names (the registry ships `radio-group` and `switch` respectively) — these were custom-built or heavily renamed/adapted rather than installed from the registry, so `shadcn diff` cannot check them against an upstream source. See shadcn-candidates section 4c.
+
+**Stock-value note:** several "arbitrary Tailwind bracket values" flagged in `TOKEN-AUDIT.md` inside these primitives (`checkbox.tsx` `rounded-[4px]`, `tooltip.tsx` `rounded-[2px]`, `command.tsx` `max-h-[300px]`, `avatar.tsx` `text-[10px]`) were verified to match the **current shadcn/ui registry source verbatim** — they are not local drift, just registry boilerplate that itself doesn't route through a token layer. Phase 2 will still need to touch them (DESIGN.md's gate is "zero arbitrary values in `ui/src/components/**`" with no carve-out for `components/ui/`), but they are not evidence of local customization.
+
+---
+
+## 2. Feature components — `ui/src/components/` (206)
+
+Grouped by rough domain area. One line each; variants column is props-based where notable, blank where the component is largely propless/single-purpose.
+
+### 2.1 Issue / task surfaces (largest cluster)
+
+| Component | Purpose |
+|---|---|
+| `IssueRow.tsx` | Single row in a task list (status glyph, title, chips) |
+| `IssuesList.tsx` | List/board container rendering many `IssueRow`s, sort/filter/group |
+| `IssueColumns.tsx` | Column-layout config for the issues list/board |
+| `IssueGroupHeader.tsx` | Section header when list is grouped (by status/project/assignee) |
+| `IssueProperties.tsx` | 1-line re-export barrel → `issue-properties/IssueProperties.tsx` |
+| `issue-properties/IssueProperties.tsx` | Full task detail properties panel (2,301 lines) — status, assignee, labels, project, dates |
+| `IssueChatThread.tsx` | Task comment/chat thread (agent + human messages) |
+| `IssueThreadInteractionCard.tsx` | Rich interaction card embedded in the chat thread (approvals, tool calls) |
+| `IssueRecoveryActionCard.tsx` | Recovery-action prompt card in a stalled/errored task thread |
+| `IssueScheduledRetryCard.tsx` | Scheduled-retry status card in task thread |
+| `IssueRunLedger.tsx` | Run/cost ledger table for a task |
+| `IssueMonitorActivityCard.tsx` | Monitoring/activity summary card on a task |
+| `IssueBlockedNotice.tsx` | Banner when a task is blocked |
+| `IssueAssignedBacklogNotice.tsx` | Banner when a backlog task gets assigned |
+| `IssueDocumentAnnotations.tsx` / `issue-output/` variants | Doc-annotation highlight overlay on task documents |
+| `IssueDocumentsSection.tsx` | Documents tab/section on task detail |
+| `IssueAttachmentsSection.tsx` | Attachments tab/section on task detail |
+| `IssuePlanDecompositionsSection.tsx` | Sub-task/decomposition list section |
+| `IssueRelatedWorkPanel.tsx` | Related-issues panel |
+| `IssueReferenceActivitySummary.tsx` / `IssueReferencePill.tsx` | Inline task-reference chip + activity rollup |
+| `IssueSiblingNavigation.tsx` | Prev/next sibling task nav |
+| `IssueLinkQuicklook.tsx` / `IssuesQuicklook.tsx` | Hover-preview popover for a linked task / task list |
+| `IssueFiltersPopover.tsx` | Filter builder popover for the issues list |
+| `IssueWorkspaceCard.tsx` | Card summarizing a task's execution workspace |
+| `IssueContinuationHandoff.tsx` | Handoff-to-next-run card |
+| `NewIssueDialog.tsx` | Create-task dialog |
+
+### 2.2 Agent / execution
+
+| Component | Purpose |
+|---|---|
+| `AgentCapsule.tsx` | The brand "capsule" motif — 3-state agent avatar (slot/configured/online) |
+| `AgentActionButtons.tsx` | Start/stop/pause agent action row |
+| `AgentBubbleActionRow.tsx` | Action row (copy/vote/timestamp/menu) under a conf-room agent chat bubble — **only one implementation found**, confirming PRIOR-ART's concern about a duplicate is resolved |
+| `AgentConfigForm.tsx` | Agent configuration form (model, instructions, etc.) |
+| `AgentIconPicker.tsx` | Icon picker for agent avatars |
+| `AgentProperties.tsx` | Agent detail properties panel |
+| `ActiveAgentsPanel.tsx` | Sidebar/dashboard panel of currently-running agents |
+| `LiveRunWidget.tsx` | Live run status widget |
+| `RunChatSurface.tsx` | Shared chat-surface shell used by both conf-room and task chat |
+| `ClaudeSubscriptionPanel.tsx` / `CodexSubscriptionPanel.tsx` | Provider-specific subscription/quota panels — parallel, provider-specific (not a duplicate; see 3.4) |
+| `ProviderQuotaCard.tsx` / `QuotaBar.tsx` | Generic quota display card / bar |
+
+### 2.3 Chat / composer
+
+| Component | Purpose |
+|---|---|
+| `ChatComposer.tsx` (380 lines) | Shared lean composer (conf-room + reused where a single-line/simple composer suffices) |
+| `MarkdownEditor.tsx` (1,425 lines) | Rich MDX-based editor with mention autocomplete — task comment composer |
+| `OnboardingChat.tsx` | Onboarding-flow chat surface |
+| `CommentThread.tsx` | Generic comment-thread renderer (non-task contexts) |
+| `MarkdownBody.tsx` / `WorkspaceFileMarkdownBody.tsx` | Rendered markdown output (read-only) — general vs. workspace-file-scoped |
+
+**KNOWN-DUPLICATES.md lead verified:** `ChatComposer` vs `MarkdownEditor`-based task composer — confirmed genuinely different in scope (380 vs 1,425 lines; ChatComposer has no mention-autocomplete/MDX machinery). Per KNOWN-DUPLICATES.md this was a deliberate non-unification (PAP-101) — **flagged in section 5, not recommended for merge.**
+
+### 2.4 Status / chips / badges
+
+| Component | Purpose |
+|---|---|
+| `StatusIcon.tsx` | Interactive status glyph + popover to change status (wraps `StatusGlyph`) |
+| `StatusGlyph.tsx` | Pure SVG glyph renderer per status (sm/md/lg), no interactivity |
+| `StatusBadge.tsx` | Custom `<span>` pill components: `StatusBadge` (generic run/goal/approval), `AgentStatusBadge`, heartbeat capsule — **does not wrap the shadcn `Badge` primitive** (see shadcn candidates 4a) |
+| `PriorityIcon.tsx` | Priority-level icon |
+| `ExternalObjectStatusIcon.tsx` / `ExternalObjectStatusSummary.tsx` / `ExternalObjectPill.tsx` | External-object (linked PR/doc/etc.) status glyph, rollup summary, and inline pill — a third, deliberately separate status-presentation family |
+| `BlockedReasonChip.tsx` | Chip explaining why a task is blocked |
+| `SourceTrustBadge.tsx` / `SourceResolvedFoldBadge.tsx` / `SourceResolvedFoldCallout.tsx` | Trust/fold badges for external content sources |
+| `ProductivityReviewBadge.tsx` | Review-status badge |
+
+**KNOWN-DUPLICATES.md lead verified:** StatusIcon / inline-mention chips / task chips are intentionally three separate systems (StatusIcon+StatusGlyph = task status glyph family; `ExternalObjectStatusIcon`/`Pill`/`Summary` = a second, external-object-specific family; mention chips in `lib/mention-chips.ts` + markdown CSS = a third, generic "chip in prose" family). **Documented here per instruction, not merged.**
+
+### 2.5 Sidebar / navigation
+
+| Component | Purpose |
+|---|---|
+| `Sidebar.tsx` / `SidebarShell.tsx` / `SecondarySidebar.tsx` / `InstanceSidebar.tsx` | Primary/secondary/instance-scoped sidebar shells |
+| `SidebarSection.tsx` / `SidebarNavItem.tsx` | Sidebar section grouping + nav item row |
+| `SidebarProjects.tsx` / `SidebarStarredProjects.tsx` | Project list / starred-project list in sidebar |
+| `SidebarAgents.tsx` | Agent list in sidebar |
+| `SidebarAccountMenu.tsx` / `SidebarCompanyMenu.tsx` | Account and company switcher menus |
+| `SidebarServerInfo.tsx` | Server/instance info footer |
+| `RequestCollapsedSidebar.tsx` | Collapsed-state sidebar for request/approval views |
+| `RoutineSubSidebar.tsx` | Routine-scoped sub-sidebar |
+| `MobileBottomNav.tsx` | Mobile bottom tab bar |
+| `BreadcrumbBar.tsx` (uses `ui/breadcrumb`) | Page breadcrumb bar wrapper |
+| `PageTabBar.tsx` | In-page tab bar |
+| `CommandPalette.tsx` | ⌘K command palette (wraps `ui/command`) |
+
+**Sidebar text-size cluster** (cross-ref TOKEN-AUDIT.md 3.1): `Sidebar.tsx`, `SidebarNavItem.tsx`, `SidebarAgents.tsx`, `SidebarProjects.tsx`, `SidebarStarredProjects.tsx`, `SidebarAccountMenu.tsx` all independently use `text-[13px]` — six components implementing what looks like one shared "sidebar row label" intent as six separate arbitrary values. Flagged for the human type-scale decision, not merged here.
+
+### 2.6 Pipelines / routines / goals
+
+| Component | Purpose |
+|---|---|
+| `PipelineHealthWarnings.tsx` / `PipelineLivenessBanner.tsx` | Pipeline health/liveness banners |
+| `PipelineItemBodyDocument.tsx` / `PipelineStageHistoryPanel.tsx` / `PipelineWorkReferences.tsx` | Pipeline stage detail panels |
+| `PipelinesExperimentalGate.tsx` | Feature-flag gate wrapper for pipelines |
+| `RoutineList.tsx` / `ManagedRoutinesList.tsx` | Routine list views |
+| `RoutineActivityRow.tsx` / `RoutineHistoryTab.tsx` | Routine activity row + history tab |
+| `RoutineRunVariablesDialog.tsx` / `RoutineVariablesEditor.tsx` | Routine run-variable input dialog/editor |
+| `RoutineSaveBar.tsx` / `RoutineTriggerCard.tsx` | Routine save-bar + trigger config card |
+| `routine-sections/editable-sections.tsx` (+2 more) | Editable routine-section blocks |
+| `ScheduleEditor.tsx` | Cron/schedule editor |
+| `GoalTree.tsx` / `GoalProperties.tsx` / `NewGoalDialog.tsx` | Goal hierarchy tree, detail panel, create dialog |
+
+### 2.7 Finance / budget
+
+| Component | Purpose |
+|---|---|
+| `AccountingModelCard.tsx` / `BillerSpendCard.tsx` / `FinanceBillerCard.tsx` / `FinanceKindCard.tsx` / `FinanceTimelineCard.tsx` | Various finance-dashboard cards — 5 distinct card shapes for different finance groupings (model/biller/kind/timeline); worth a human check for whether all 5 are truly distinct or 2-3 could share a base card |
+| `BudgetIncidentCard.tsx` / `BudgetPolicyCard.tsx` / `BudgetSidebarMarker.tsx` | Budget incident, policy config, sidebar marker |
+| `MetricCard.tsx` | Generic metric-display card |
+
+### 2.8 Files / documents / artifacts
+
+| Component | Purpose |
+|---|---|
+| `FileTree.tsx` | General file-tree renderer + `buildFileTree`/`FileTreeNode` model |
+| `PackageFileTree.tsx` | Thin wrapper around `FileTree` (`wrapLabels` default) — reuses `FileTreeProps`, not a duplicate |
+| `WorkspaceFileBrowser.tsx` | Execution-workspace file browser — **defines its own parallel tree-node model** (`WorkspaceFileTreeNode`, `buildWorkspaceFileTree`, `compareTreeNodes`) instead of reusing `FileTree`'s `FileTreeNode`/`buildFileTree` — see suspected duplicates (3.2) |
+| `FileViewerSheet.tsx` | File content viewer sheet (wraps `ui/sheet`) |
+| `FileTree.tsx`'s `parseFrontmatter` | Shared frontmatter parser (also exported, reused elsewhere) |
+| `DocumentAnnotationLayer.tsx` / `DocumentAnnotationPanel.tsx` | Document highlight/annotation overlay + side panel |
+| `DocumentDiffModal.tsx` | Document diff viewer modal |
+| `DocumentFrameHeader.tsx` | Header chrome for an embedded document frame |
+| `ArtifactFileChip.tsx` / `artifacts/ArtifactCard.tsx` / `artifacts/ArtifactGroupCard.tsx` / `ArtifactsPanel.tsx` | Artifact chip, card, grouped-card, and panel — internally consistent `rounded-[8px]` cluster (TOKEN-AUDIT 3.5) |
+| `ImageGalleryModal.tsx` | Image gallery lightbox modal |
+
+### 2.9 Onboarding / access / identity
+
+| Component | Purpose |
+|---|---|
+| `OnboardingWizard.tsx` / `OnboardingWizardVariant.tsx` | Onboarding flow + an alternate variant — worth a human check on whether the variant is still live or leftover from an A/B (see 3.5) |
+| `FrontDoor.tsx` | Landing/entry gate component |
+| `CloudAccessGate.tsx` / `ConferenceRoomChatGate.tsx` / `PipelinesExperimentalGate.tsx` | Three separate feature-flag/access gate wrappers — same pattern (children-if-enabled), each hand-rolled per feature; candidate for a shared `FeatureGate` primitive (flagged, not built here) |
+| `Identity.tsx` | Avatar + name identity chip (`deriveInitials` helper) |
+| `MembershipAction.tsx` | Membership accept/decline action row |
+| `access/` (2 files) | Access-request related components |
+| `ReportsToPicker.tsx` / `ExecutionParticipantPicker.tsx` / `InlineEntitySelector.tsx` / `SearchableSelect.tsx` | Four distinct entity-picker components — overlapping purpose (pick a person/entity from a list); see suspected duplicates (3.3) |
+| `SecretBindingPicker.tsx` / `environment-variables-editor/` (5 files) | Secrets/env-var binding UI |
+
+### 2.10 System / chrome / misc
+
+| Component | Purpose |
+|---|---|
+| `Layout.tsx` | App shell layout |
+| `EmptyState.tsx` | **The single canonical empty-state component** — confirmed only one exists, matching DESIGN.md principle 1 |
+| `SystemNotice.tsx` | Global system notice banner |
+| `DevRestartBanner.tsx` | Dev-mode restart-required banner |
+| `ToastViewport.tsx` + `context/ToastContext.tsx` | Fully custom toast notification system — no shadcn `sonner`/toast primitive installed (see shadcn candidates 4a) |
+| `KeyboardShortcutsCheatsheet.tsx` | ⌘K-adjacent shortcuts help modal |
+| `PageSkeleton.tsx` | Loading skeleton (wraps `ui/skeleton`) |
+| `RouteErrorBoundary.tsx` | Route-level error boundary |
+| `ThemeToggle.tsx` | Light/dark toggle |
+| `CopyText.tsx` | Copy-to-clipboard text control |
+| `EntityRow.tsx` | Generic entity list row (used across several list contexts) |
+| `SwipeToArchive.tsx` | Mobile swipe-to-archive gesture wrapper |
+| `ScrollToBottom.tsx` | Scroll-to-bottom floating button |
+| `FoldCurtain.tsx` | Collapsible "show more" curtain/fade |
+| `InlineEditor.tsx` | Generic inline-edit-in-place control |
+| `JsonSchemaForm.tsx` | JSON-schema-driven dynamic form renderer |
+| `TrustPresetSection.tsx` | Trust-level preset picker section |
+| `WorktreeBanner.tsx` | Worktree-branding banner |
+| `CompanyPatternIcon.tsx` | Canvas-rendered company pattern/avatar icon |
+| `CompanySwitcher.tsx` / `CompanySettingsSidebar.tsx` | Company switcher + settings sidebar |
+| `ProjectProperties.tsx` / `ProjectTile.tsx` / `ProjectWorkspaceSummaryCard.tsx` / `ProjectWorkspacesContent.tsx` | Project detail panel, tile, workspace summary card, workspace content |
+| `ApprovalCard.tsx` / `ApprovalPayload.tsx` | Approval request card + payload renderer |
+| `ExecutionWorkspaceCloseDialog.tsx` | Close-workspace confirm dialog |
+| `ResponsibleUserDenialNotice.tsx` | Denial-notice banner |
+| `BootstrapPendingPage.tsx` | Bootstrap-pending full-page state |
+| `MissingPluginTabPlaceholder.tsx` | Placeholder when a plugin tab isn't installed |
+| `StandaloneBrowserControls.tsx` | Standalone-mode browser chrome controls |
+| `AsciiArtAnimation.tsx` | Decorative ASCII animation (boot/loading) |
+| `OpenCodeLogoIcon.tsx` | Static logo icon |
+| `StarToggle.tsx` | Star/favorite toggle button |
+| `OutputFeedbackButtons.tsx` | Thumbs up/down feedback buttons on agent output |
+| `KanbanBoard.tsx` | Kanban board view (alternate to `IssuesList` list view) |
+| `agent-config-primitives.tsx` | Shared field primitives for agent config forms |
+| `PropertiesPanel.tsx` | Generic properties-panel shell (used by Issue/Project/Agent/Goal Properties) |
+
+### 2.11 Nested subdirectories
+
+| Directory | Files | Purpose |
+|---|---|---|
+| `access/` | 2 | Access-request UI |
+| `artifacts/` | 2 | `ArtifactCard`, `ArtifactGroupCard` |
+| `environment-variables-editor/` | 5 | Env-var/secret editor rows and index |
+| `interrupt-handoff/` | 1 | `InterruptHandoffViews.tsx` |
+| `issue-output/` | 5 | Task output file tiles / sections |
+| `issue-properties/` | 5 | Task properties panel (full impl, see 2.1) |
+| `routine-sections/` | 3 | Editable routine section blocks |
+| `search/` | 3 | Search result row, `HighlightedText`, `MatchSourceChip` |
+| `timeline/` | 1 | `WorkTimelineChart.tsx` |
+| `transcript/` | 1 | `RunTranscriptView.tsx` |
+
+---
+
+## 3. Pages — `ui/src/pages/` (73)
+
+Grouped by area; one line each.
+
+| Page | Purpose |
+|---|---|
+| `Dashboard.tsx` | Home/overview dashboard |
+| `IssueDetail.tsx` / `IssuesList` route pages | Task detail + list routes |
+| `AgentDetail.tsx` / `Agents.tsx` | Agent detail + list |
+| `ProjectDetail.tsx` / `Projects.test.tsx`-adjacent list page | Project detail + list |
+| `Pipelines.tsx` / `PipelineSettings.tsx` | Pipeline list + settings |
+| `Routines.tsx` | Routine list/detail |
+| `Org.tsx` / `OrgChart.tsx` | Org directory + org chart visualization |
+| `Costs.tsx` | Cost/budget dashboard |
+| `Timeline.tsx` | Work timeline view (wraps `timeline/WorkTimelineChart`) |
+| `Inbox.tsx` | Notifications/requests inbox |
+| `Approvals.tsx` / `ApprovalDetail.tsx` | Approval queue + detail |
+| `CompanySettings.tsx` / `CompanySkills.tsx` / `CompanyEnvironments.tsx` / `CompanyAccess.tsx` / `CompanyImport.tsx` / `CompanyExport.tsx` | Company-scoped settings sub-pages |
+| `TeamCatalog.tsx` | Team/role catalog |
+| `UserProfile.tsx` / `ProfileSettings.tsx` | User profile view + settings |
+| `Secrets.tsx` / `secrets/*` (5 files) | Secrets management + sub-tabs (import-from-vault, definitions, my-secrets, presentation helpers, missing-banner) |
+| `PluginManager.tsx` / `PluginSettings.tsx` | Plugin management + per-plugin settings |
+| `AdapterManager.tsx` | Adapter (agent runtime) management |
+| `CloudUpstream.tsx` / `CloudUpstreamUxLab.tsx` | Cloud-upstream connection page + its UxLab showcase twin |
+| `InviteLanding.tsx` / `InviteUxLab.tsx` | Invite acceptance landing page + UxLab showcase twin |
+| `BootstrapSetupUxLab.tsx` | Bootstrap-setup flow showcase |
+| `ResponsibleUserDenialUxLab.tsx` | Denial-flow showcase |
+| `SystemNoticeUxLab.tsx` | System-notice showcase |
+| `IssueChatUxLab.tsx` / `RunTranscriptUxLab.tsx` | Chat + transcript showcases |
+| `DesignGuide.tsx` | Design-system showcase/reference page |
+| `BoardChat.tsx` / `BoardClaim.tsx` | Board (concierge) chat + claim flow |
+| `NotFound.tsx` | 404 page |
+| `CliAuth.tsx` | CLI auth handoff page |
+| `JoinRequestQueue.tsx` | Join-request queue |
+| `InstanceAccess.tsx` / `InstanceGeneralSettings.tsx` / `InstanceExperimentalSettings.tsx` | Instance-level settings pages |
+| `ExecutionWorkspaceDetail.tsx` / `ProjectWorkspaceDetail.tsx` | Execution/project workspace detail pages |
+| `Companies.tsx` | Multi-company switcher/list |
+| `CompanyImport.tsx` / `CompanyExport.tsx` | Import/export company data |
+| `RoutineDetail.tsx` | Routine detail route |
+
+**UxLab pages are real routes** (confirmed via `App.tsx` — `/ux-lab/*`, `/design-guide`), not build-excluded demo code, so all hardcoded values inside them are in-scope per DESIGN.md even though they're showcase surfaces rather than product screens a typical operator visits daily.
+
+---
+
+## 4. Shadcn candidates
+
+**All items below are recommendations only — no swaps happen in this run.**
+
+### 4a. Custom components duplicating an available shadcn primitive
+
+| Custom component | Duplicates | Recommended replacement | Expected visual impact |
+|---|---|---|---|
+| `ToastViewport.tsx` + `context/ToastContext.tsx` | shadcn's `sonner`-based toast pattern (not currently installed) | Install `sonner`/toast primitive, migrate `useToastActions`/`useToastState` call sites to it | Low if the registry's toast is restyled to match current `toneClasses`/`toneDotClasses` tint system; the current implementation already has custom tone colors (`sky`/`emerald`/`amber`/`red`) that would need to carry over as variant props — a naive swap would look different unless those tones are preserved |
+| `components/StatusBadge.tsx` (`StatusBadge`, `AgentStatusBadge`) | shadcn `Badge` primitive (installed, `ui/badge.tsx`) | Keep as a distinct component (status badges need the `.status-chip` color-mix mechanic Badge's variant system doesn't support) but consider having it render `<Badge>` internally with a custom class rather than a bare `<span>`, for consistency of base styles (focus ring, disabled states, etc.) | Low — internal implementation change only if done carefully; skip if it risks the WCAG-tuned status hues |
+| Hand-rolled bordered-container `<div>`/`<ul>` patterns (`rounded-md border bg-card`-shaped) found in ~26 files (`pages/AdapterManager.tsx`, `pages/TeamCatalog.tsx`, `pages/InstanceAccess.tsx`, `pages/BootstrapSetupUxLab.tsx`, `pages/ResponsibleUserDenialUxLab.tsx`, `pages/CliAuth.tsx`, `pages/BoardClaim.tsx`, `pages/BoardChat.tsx`, `pages/InstanceGeneralSettings.tsx`, `pages/ProjectWorkspaceDetail.tsx`, `pages/Timeline.tsx`, `pages/PluginManager.tsx`, `pages/JoinRequestQueue.tsx`, `pages/InstanceExperimentalSettings.tsx`, `App.tsx`, `components/BootstrapPendingPage.tsx`, `components/IssuePlanDecompositionsSection.tsx`, `components/BlockedInboxView.tsx`, `components/ApprovalCard.tsx`, + ~7 more) vs. shadcn `Card` (installed, only imported in 21 files) | `Card`/`CardContent` | Low-to-medium — many of these are `<ul>` list wrappers, not literal card content; a swap would need per-site judgment, not a blanket codemod. Flagging the cluster, not asserting every site should change. |
+| Hand-rolled pill/badge-shaped `<span>`s (`rounded-full px-2 text-[...]`) outside `Badge` usage, ~34 files | `Badge` (installed, 35 files already use it) | `Badge` with a custom `className` for color | Low if colors are preserved as `className` overrides |
+| `plugins/launchers.tsx` generic plugin-shell overlay (`role="dialog"`, hand-rolled backdrop `bg-black/45`, manual z-index math, `rounded-xl`/`rounded-2xl`) | `Dialog` / `Sheet` / `Popover` (all installed) | Case-by-case: this component multiplexes dialog/drawer/popover shell types from one plugin-host abstraction, which none of the three installed primitives do individually — a clean swap likely means keeping the multiplexer but delegating each `shellType` branch to the matching installed primitive instead of a fully custom `<div>` tree | Medium — this is the most structurally custom overlay in the codebase; recommend closer human review before treating it as a simple swap |
+
+### 4b. Installed shadcn components drifted from the registry
+
+`npx shadcn@latest diff` (run from `ui/`, network available) reported **"No updates found"** for the aggregate diff and for spot-checked `button` and `dialog` individually. **No drift detected** against the current registry for any of the 22 standard-named primitives. (`radio-card` and `toggle-switch` aren't standard registry names so `diff` cannot evaluate them — see 4c.)
+
+### 4c. Raw Radix/plain elements where an installed shadcn wrapper exists
+
+- **No raw `@radix-ui/*` imports were found outside `ui/src/components/ui/`** (`rg -l '@radix-ui' -g '*.tsx' -g '!components/ui/*'` returned zero files) — every Radix primitive in the app is properly routed through the `components/ui/` wrapper layer. This is a clean result; no action needed.
+- One raw hand-rolled modal (`plugins/launchers.tsx`, `role="dialog"` on a plain `<div>`) exists where `Dialog`/`Sheet` wrappers are installed — see 4a above, same finding, cross-listed here because it's also a "plain element where a wrapper exists" case.
+- `radio-card.tsx` and `toggle-switch.tsx` are functioning as de facto custom primitives sitting in the `ui/` folder alongside real shadcn components, but they were not installed via the registry (no matching registry names). Recommend a human decide whether to (a) leave them as intentionally custom, documenting why the registry's `radio-group`/`switch` don't fit, or (b) evaluate swapping to the registry versions if the customization was incidental rather than deliberate.
+
+---
+
+## 5. Suspected duplicates (with evidence)
+
+All of the below are **leads for human review**, not verdicts, per KNOWN-DUPLICATES.md's framing.
+
+### 5.1 Seed leads from KNOWN-DUPLICATES.md — verified
+
+| Lead | Finding |
+|---|---|
+| `ChatComposer` vs `MarkdownEditor`-based task composer | **Confirmed genuinely distinct** (380 vs 1,425 lines; different prop interfaces `ChatComposerProps` vs `MarkdownEditorProps`; MarkdownEditor owns mention-autocomplete machinery — `findMentionMatch`, `computeMentionMenuPosition`, `placeCaretAfterMentionAnchor` — that ChatComposer has none of). Matches KNOWN-DUPLICATES.md's note that this was a deliberate non-unification (PAP-101). **Needs human decision: re-confirm this split should remain permanent, or revisit unification now that both have matured further.** |
+| `AgentBubbleActionRow.tsx` duplicate check | **Only one file found** (`components/AgentBubbleActionRow.tsx`). The concurrent-work duplicate PRIOR-ART/KNOWN-DUPLICATES.md warned about is not present on this branch — resolved. |
+| `StatusIcon` vs inline-mention chips vs task chips | **Confirmed three separate, intentionally distinct systems**: (1) `StatusIcon`/`StatusGlyph` — task status glyph, drives from `--status-task-icon-*` tokens; (2) `ExternalObjectStatusIcon`/`ExternalObjectPill`/`ExternalObjectStatusSummary` — a parallel system for external (PR/doc/etc.) object status, independent color/severity model (`externalObjectStatusIcon`, `externalObjectStatusToneSeverity` in `lib/status-colors.ts`); (3) mention chips (`lib/mention-chips.ts` + `.paperclip-mention-chip` CSS in `index.css`) — generic "entity reference in prose" chip unrelated to status at all. Documented per instruction, **not merged.** |
+
+### 5.2 New leads found during this audit
+
+| Lead | Evidence |
+|---|---|
+| `FileTree.tsx` vs `WorkspaceFileBrowser.tsx` tree models | `FileTree.tsx` exports `buildFileTree`, `FileTreeNode`, `countFiles`, `collectAllPaths`, `parseFrontmatter`. `WorkspaceFileBrowser.tsx` independently defines its own `WorkspaceFileTreeNode`/`WorkspaceFileTreeFolderNode`/`WorkspaceFileTreeFileNode`, `buildWorkspaceFileTree`, `compareTreeNodes`, `finalizeTreeFolder` — a parallel tree-building implementation rather than reuse of `FileTree`'s exported helpers. `PackageFileTree.tsx` by contrast correctly wraps `FileTree` (reuses `FileTreeProps`). **Needs human decision**: was `WorkspaceFileBrowser`'s separate model a deliberate choice (different node shape needs — e.g. it may need workspace-specific metadata `FileTreeNode` lacks) or copy-paste-and-diverge drift? |
+| `agentStatusBadge` vs `brandChipBadge` (`lib/status-colors.ts`) | Byte-for-byte identical maps for the 4 shared keys (gray/blue/amber/red — same hex, same dark-mode alpha suffixes); `brandChipBadge` additionally has `green`/`violet`. Cross-referenced in TOKEN-AUDIT.md section 1.1. **Recommend collapsing `agentStatusBadge` into `brandChipBadge`** (or making it an alias) since they are provably identical, not just similar. |
+| Entity-picker family: `ReportsToPicker.tsx`, `ExecutionParticipantPicker.tsx`, `InlineEntitySelector.tsx`, `SearchableSelect.tsx` | Four components with overlapping "pick one entity from a searchable list" purpose. Not verified identical (each has domain-specific filtering — reports-to org hierarchy, execution participants, generic inline selection, generic searchable select) but the prop-surface overlap (all take an options list + selected value + onChange) is a plausible consolidation candidate. **Flagged, not verified as true duplicates** — would need a closer prop-by-prop diff in a follow-up run. |
+
+### 5.3 Corrections after closer inspection
+
+- `OnboardingWizardVariant.tsx` (10 lines) is **not** a duplicate of `OnboardingWizard.tsx` (1,786 lines) — it's a thin routing wrapper (`export function OnboardingWizardVariant() { return <OnboardingWizard />; }`) left over from a since-retired experimental-flag variant (per its own doc comment: "Conference-room chat is now the only surface left behind `enableConferenceRoomChat`; onboarding stays available without that experimental flag"). Both are routed in `App.tsx`. **No action needed** — this is a naming leftover, not visual/logic duplication; candidate for a trivial rename-and-inline cleanup in a future non-visual refactor, out of scope here.
+- `components/IssueProperties.tsx` is a 1-line re-export barrel (`export { IssueProperties } from "./issue-properties";`) — not a duplicate of `components/issue-properties/IssueProperties.tsx`, just a compatibility import path.
+
+### 5.4 Finance card family — needs closer human review
+
+`AccountingModelCard.tsx`, `BillerSpendCard.tsx`, `FinanceBillerCard.tsx`, `FinanceKindCard.tsx`, `FinanceTimelineCard.tsx` — five components with card-shaped, finance-dashboard purposes and naming that overlaps enough (`BillerSpendCard` vs `FinanceBillerCard`) to warrant a closer look than this audit had time for. Not verified as duplicates; flagged as a lead only.
+
+### 5.5 Feature-gate wrapper pattern (not a duplicate, but a repeated pattern)
+
+`CloudAccessGate.tsx`, `ConferenceRoomChatGate.tsx`, `PipelinesExperimentalGate.tsx` each independently implement the same "render children only if flag X is enabled, else render fallback" shape. Not byte-identical (each checks a different flag/hook), so not a strict duplicate, but a strong candidate for a shared `FeatureGate`/`ExperimentalGate` primitive that takes a flag-check function as a prop. Flagged as a recommendation, not built here.
+
+---
+
+## 6. Needs human decision (required section)
+
+1. **`ChatComposer` vs `MarkdownEditor`-based composer** — KNOWN-DUPLICATES.md already flags this as deliberately unmerged (PAP-101). This audit confirms the split is real (not accidental) given the large capability gap. Human call: keep permanently split, or revisit now. **DECIDED (Run 2 review, DECISION-SHEET.md C1): keep the split, documented as deliberate — user re-confirmed after visual review.**
+2. **`FileTree.tsx` vs `WorkspaceFileBrowser.tsx` independent tree models** — is `WorkspaceFileBrowser`'s separate `WorkspaceFileTreeNode` model justified by different data needs, or is it drift that should be refactored onto `FileTree`'s exported `buildFileTree`/`FileTreeNode`? Needs someone who knows both call sites' actual data shapes. **DECIDED (Run 2 review, DECISION-SHEET.md C2): investigate data-shape needs as Run 3 prep; refactor onto FileTree only if shapes align.**
+3. **`agentStatusBadge` vs `brandChipBadge`** (`lib/status-colors.ts`) — these are provably byte-identical for their 4 shared keys. Recommend collapsing, but doing so touches every call site importing `agentStatusBadge`, so it's a human-approved Run 2/3 item, not automatic. **RESOLVED (Run 2 review, DECISION-SHEET.md A1): collapsed — `agentStatusBadge` had zero importing call sites and was deleted; `brandChipBadge` is the single map.**
+4. **Entity-picker family** (`ReportsToPicker`, `ExecutionParticipantPicker`, `InlineEntitySelector`, `SearchableSelect`) — plausible consolidation candidate on prop-surface similarity alone; needs a closer prop-by-prop and behavior diff (not done in this pass) before any merge recommendation can be made with confidence. **DECIDED (Run 2 review, DECISION-SHEET.md C3): prop-by-prop diff queued as Run 3 prep; no merge without it.**
+5. **Finance card family** (5 components, section 5.4) — needs a domain-knowledgeable human to confirm whether all 5 are truly distinct dashboard needs or 2-3 could share a base `FinanceCard`. **DECIDED (Run 2 review, DECISION-SHEET.md C4): keep all five; revisit only if a sixth appears.**
+6. **Hand-rolled card-shaped containers vs. `Card` primitive** (~26 files) and **hand-rolled pill spans vs. `Badge`** (~34 files) — both are large, low-risk-looking consolidation opportunities, but "low risk" was assessed at a glance only; a real swap pass needs per-site visual verification (this is exactly what Storybook snapshots from Phase 0 would catch if these were touched). **DECIDED (Run 2 review, DECISION-SHEET.md C5): queued for Run 3 as the shadcn-swap list, with per-site snapshot verification.**
+7. **`plugins/launchers.tsx` custom multiplexed overlay** — the most structurally custom modal-like component in the app; recommend a dedicated closer look before deciding whether/how to route it through `Dialog`/`Sheet`/`Popover`, since it currently does something none of the three do alone (switch shell type per plugin action). **DECIDED (Run 2 review, DECISION-SHEET.md C6): dedicated review task; excluded from Run 3.**
+8. **`radio-card.tsx` / `toggle-switch.tsx` non-standard "shadcn" primitives** — confirm whether these were deliberately custom-built (and should stay documented as such) or are stale/incidental deviations from `radio-group`/`switch` that should be swapped in a later run. **DECIDED (Run 2 review, DECISION-SHEET.md C7): deliberately custom — documented as such; no swap.**
+9. **`StatusBadge`/`AgentStatusBadge` not wrapping the installed `Badge` primitive** — worth a human call on whether unifying the base markup (while keeping the custom `.status-chip` color-mix mechanic) is worth the churn, or whether the current bespoke `<span>` approach should just be documented as an intentional, permanent exception (similar to the StatusIcon/ExternalObject/mention-chip three-way split already documented). **DECIDED (Run 2 review, DECISION-SHEET.md C8): documented as an intentional exception — the WCAG-tuned `.status-chip` mechanic stays bespoke.**
+10. **Toast system has no installed shadcn primitive to compare against** — `ToastViewport`/`ToastContext` is fully custom because no `sonner`/toast component is installed at all. Human call: install one and migrate, or formally document the custom toast as the system's permanent choice (it already has a working tone/variant system). **DECIDED (Run 2 review, DECISION-SHEET.md C9): decision deferred to Run 4, when the toast's palette colors get retokenized; sonner-behind-a-pushToast-facade is the alternative to evaluate then.**
diff --git a/doc/design/DECISION-SHEET.md b/doc/design/DECISION-SHEET.md
new file mode 100644
index 0000000000..e2cab973f3
--- /dev/null
+++ b/doc/design/DECISION-SHEET.md
@@ -0,0 +1,71 @@
+# DECISION-SHEET — Run 1 human review
+
+Every open question from TOKEN-AUDIT.md §8 + batch logs and COMPONENT-INVENTORY.md §6, each with a recommendation, blast radius, and where it lands. Statuses: **PENDING** → APPROVED / OVERRIDDEN (with note) / DEFERRED.
+
+## A. Quick wins — low risk, do in this review phase
+
+| # | Decision | Recommendation | Blast radius | Status |
+|---|---|---|---|---|
+| A1 | `agentStatusBadge` vs `brandChipBadge` byte-identical maps (status-colors.ts) | Collapse to `brandChipBadge`, re-point imports | code dedup, zero pixels | APPROVED — done 5ecc0f9e4: `agentStatusBadge` had ZERO importing call sites, so it was deleted outright (no re-pointing, no alias needed); `brandChipBadge` is the single map, `AgentBadgeColor` kept (subset of `BrandChipColor`) |
+| A2 | Contrast-pair triplication (color-contrast.ts / worktree-branding.ts / ThemeContext.tsx) | One shared constant IF values are truly identical; verify per-pair first, keep semantically distinct ones separate | 3 files, zero pixels if identical | APPROVED — done 383460bb2: only `#f8fafc`/`#111827` is byte-identical across files → exported as `READABLE_TEXT_LIGHT`/`READABLE_TEXT_DARK` from color-contrast.ts, imported by worktree-branding.ts; ThemeContext's `#18181b`/`#ffffff` meta-theme-color pair, the DARK_BG/LIGHT_BG rgb-object compositing backgrounds, and worktree-branding's `#000000` parse fallback are semantically distinct → untouched |
+| A3 | Project-color fallbacks `#6366f1` / `#64748b` (14 sites) | Two semantic tokens (`--project-seed`, `--project-none`) — file pattern shows two intents | rename-only, zero pixels | APPROVED — done 7e3e59db2: pure rename `--hex-6366f1`→`--project-seed` (7 sites) and `--hex-64748b`→`--project-none` (9 sites incl. ActivityCharts 'backlog') + index.css definitions, values unchanged |
+| A4 | Test-file hardcoded hex (56 sites) | Leave alone; update lockstep only when asserted values actually change | none | APPROVED — policy adopted, no code change |
+| A5 | `FileViewerSheet` half-migrated `var(--paperclip-code-highlight-*, fallback)` | Mint the two vars in index.css at the fallback values (identical pixels today; makes the intended token real) | 1 file | APPROVED — done 7929aabeb: both vars minted in the extracted-tokens :root block at exactly the former fallback values; chose to SIMPLIFY the Batch 4 `--code-highlight-*-resolved` wrappers to plain `var(--x)` (fallbacks now redundant; nothing sets the vars at runtime); FileViewerSheet.tsx call sites unchanged |
+| A6 | "Liveness blue" chat bubble reusing `--status-task-in_progress` (semantic coincidence) | Decouple: mint `--liveness-blue` with same value so a future status-hue change doesn't drag the chat bubble along | 2 sites, zero pixels | APPROVED — done b76a7955a: `--liveness-blue: #2563eb` minted; IssueChatThread.tsx bubble class + IssueChatThread.test.tsx lockstep assertion re-pointed |
+
+## B. Policy calls
+
+| # | Decision | Recommendation | Status |
+|---|---|---|---|
+| B1 | One-off decorative gradients/shadows (5 production + UxLab; 38 arbitrary shadows, no `--shadow-*` tokens existed) | Allowlist as documented "intentional one-off decoration" (extend allowlist criteria beyond third-party); DELETE the ~20 never-reused singleton `--gradient-extract-*` tokens back to inline, keep only reused ones. Spirit over letter of principle 2 | APPROVED — middle path, executed: 27 demo-only tokens reverted inline (19 gradients: --gradient-extract-5,6,8-24; 8 shadows: --shadow-extract-15,16,17,19-23 — all consumed solely by *UxLab.tsx pages), 35 call sites restored to original bracket literals, definitions deleted, 4 UxLab pages allowlisted + criteria doc-comment extended to first-party intentional decoration. KEPT 22 production tokens (gradients 1,2,3,4,7,25,26 + 15 shadows) — NOTE: --shadow-extract-4/5 kept contrary to the audit's first cut because ChatComposer.tsx and IssueChatThread.tsx (production) consume them, not just ChatComposer.test.tsx |
+| B2 | Tailwind palette classes (`bg-red-500` etc.) — 3,115 sites / 145 files | Own future run (Run 4): cluster-by-cluster mapping to semantic tokens, starting with status-adjacent colors; NOT wholesale now, NOT permanent exemption. Update DESIGN.md principle 2 to name palette classes explicitly | APPROVED — own Run 4 later |
+| B3 | Micro type cluster 9–15px (730 sites) + letter-spacing 9 values (202 sites) | Adopt PRIOR-ART named ladder (map 9→10 nano, keep 10/11/12/13/14; 15→14; tracking → 3 steps) via contact-sheet review — executed in the preset-tune session, decided now | EXECUTED (pending contact-sheet) — scripts/codemod-type-ladder.mjs (idempotent, committed): 730 font-size sites -> --text-nano (10px, incl. 9->10) / --text-micro (11px, incl. 0.7rem) / text-xs (12px) / --text-compact (13px) / text-sm (14px, incl. 15->14); 202 tracking sites -> --tracking-label (0.08em) / --tracking-eyebrow (0.14em) / --tracking-caps (0.2em); all --fs-* and --ls-* definitions deleted. NOTE: text-xs/text-sm sites also pick up Tailwind scale line-height (contact-sheet reviewable). PRIOR-ART "sm 13" tier renamed --text-compact (name collides with Tailwind text-sm=14px) |
+| B4 | Radius conflict (`--radius-lg/xl` = 0px vs stock 2xl/3xl) | Defer to preset session — it's a brand question. Candidate: PRIOR-ART monotonic 6/8/10/14/16 | DEFERRED to preset session |
+| B5 | Chart palette vs canonical status hues (ActivityCharts in_progress = violet, elsewhere blue) | Re-point charts at `--status-task-*` (operator learns one vocabulary — DESIGN.md P5). Visible change → contact sheet | APPROVED & CLOSED — user approved on before/after contact sheet (Jul 6); 2 chart snapshots re-baselined, suite 510/510 on new baseline. Known trade documented: To-Do amber vs priority-Medium amber adjacency, revisit at preset session |
+
+## C. Component calls (from COMPONENT-INVENTORY.md §6)
+
+| # | Decision | Recommendation | Status |
+|---|---|---|---|
+| C1 | ChatComposer vs MarkdownEditor split | Keep split; document as deliberate in COMPONENT-INVENTORY | APPROVED — keep split, documented deliberate (user re-confirmed after visual review) |
+| C2 | FileTree vs WorkspaceFileBrowser parallel tree models | Investigate data-shape needs in Run 3; refactor onto FileTree only if shapes align | APPROVED — investigate data-shape needs in Run 3 prep |
+| C3 | Entity-picker family (4 components) | Prop-by-prop diff as Run 3 prep task; no merge without it | APPROVED — prop-by-prop diff as Run 3 prep task; no merge without it |
+| C4 | Finance card family (5 components) | Keep; revisit only if a 6th appears | APPROVED — keep all five; revisit only if a 6th appears |
+| C5 | Hand-rolled cards (~26 files) → `Card`; pills (~34 files) → `Badge` | Run 3 shadcn-swap list, per-site snapshot verification | APPROVED — queued Run 3 shadcn-swap list, per-site snapshot verification |
+| C6 | `plugins/launchers.tsx` overlay | Dedicated review task; exclude from Run 3 | APPROVED — dedicated review task, excluded from Run 3 |
+| C7 | radio-card / toggle-switch custom primitives | Document as deliberate custom; skip swaps | APPROVED — documented as deliberate custom; skip swaps |
+| C8 | StatusBadge not wrapping Badge primitive | Document as intentional exception (WCAG-tuned .status-chip mechanic) | APPROVED — documented as intentional exception (WCAG-tuned .status-chip mechanic) |
+| C9 | Toast system (no shadcn primitive installed) | Keep custom toast; document as permanent choice (working tone/variant system; sonner migration = churn without user-visible gain) | DEFERRED to Run 4 — decide when toast palette colors get retokenized; sonner-behind-a-pushToast-facade is the alternative to evaluate |
+| C10 | FeatureGate wrapper pattern (3 near-identical gates) | Nice-to-have shared primitive; backlog, not a run | APPROVED — backlog nice-to-have, not a run |
+| C11 | Sidebar agents section: hand-rolled rows (own spacing/icon colors, palette-blue liveness dot) instead of `SidebarNavItem`; only section that is collapsible | Run 3 item: unify rows onto `SidebarNavItem`, settle collapsibility policy across sections, liveness dot → canonical status blue. Wholesale shadcn Sidebar adoption REJECTED for now (app already has equivalent machinery incl. icon-rail height trick; highest-regression chrome) — re-evaluate as a dedicated item after Run 3 only if its behaviors (kbd shortcut, persisted state, mobile sheet) are wanted | APPROVED — user-spotted during :3300 test drive (Jul 6), queued for Run 3 |
+
+## Gallery feedback round 1 (preset-tune session, Jul 6) — executed
+
+User rulings from the tune-session gallery review; all intentionally visible, snapshots NOT re-baselined (fresh before/after triplets regenerated in tests/storybook-visual/test-results/ against the old baseline):
+
+1. **Dark destructive red reverted** — `.dark --destructive` back to master's original `oklch(0.637 0.237 25.331)` (preset's softer `oklch(0.704 0.191 22.216)` rejected); light mode untouched.
+2. **Budget/quota BAR FILLS reuse status colors** — moving-fill elements only: healthy → `bg-(--status-task-done)`, warning → `bg-(--status-task-todo)`, exceeded/hard-stop → `bg-(--status-task-blocked)` in BudgetPolicyCard.tsx, QuotaBar.tsx (feeds ProviderQuotaCard/BillerSpendCard pages), Costs.tsx, CodexSubscriptionPanel.tsx (escalation tiers only). Inspected and deliberately LEFT: Org.tsx status dot (not a bar), BudgetPolicyCard chip washes/notice borders (not fills), CodexSubscriptionPanel healthy `bg-primary/70` + null `bg-zinc-700` (healthy tier uses brand primary by design — flagged as ambiguous, not emerald).
+3. **RUNNING = status blue, not cyan/teal** — IssueChatThread running chip now composes `brandChipBadge.blue` (layout classes unchanged); RunTranscriptView running label uses new `runningLabelText` export (`text-[#1D4ED8] dark:text-[#2563EB]`, hexes kept in lib/status-colors.ts for gate cleanliness); `statusBadge.running` + `agentStatusDot.running` maps and AgentDetail `runStatusIcons.running` re-pointed cyan→blue. Deliberately LEFT + flagged: `externalObjectStatusIcon/Badge.running` (same-map collision — `open` is already blue there; documented UX-spec tone system), and the cyan "Live" branding family (LiveRunWidget theme, AgentDetail live-card border + Live pulse dots, DesignGuide Live sample) — "Live" is a distinct motif from RUNNING chips; note AgentDetail's mobile Live pill is already blue, so a dedicated Live-color decision is recommended.
+
+## Gallery feedback round 2 (preset-tune session, Jul 6) — executed
+
+1. **BudgetIncidentCard light-mode legibility (pre-existing bug)** — the hard-stop card's eyebrow/title/description/banner used dark-tuned red-50/100/200 text with no light variants over the light pink gradient. Light mode now uses red-600..950-tier text (matching the app's existing `text-red-700 dark:text-red-300` light-red-surface pattern); dark classes preserved verbatim behind `dark:`. Sibling fix: BudgetPolicyCard statusTone chips (hard_stop/warning/ok) + its red banner had the same dark-only text — same treatment. Gradient backgrounds (kept B1 tokens) untouched.
+2. **Bar fills, remaining stragglers → status hues** — ClaudeSubscriptionPanel fillClass ("Current week Opus only" salmon red) and ProviderQuotaCard quota-window fills: red-400→`bg-(--status-task-blocked)`, amber/yellow-400→`bg-(--status-task-todo)`, green-400→`bg-(--status-task-done)`. Healthy `bg-primary/70` + null `bg-zinc-700` tiers unchanged (r1 ruling). Inspected, NOT a bar: BudgetSidebarMarker circular icon badge (left).
+3. **Systematic cyan→status-blue liveness sweep** (~50 sites / 20 files; supersedes r1's "Live family left" note per user ruling): running-status tones (CommentThread, interrupt-handoff, runRetryState, AgentDetail run chip + status maps), live dots/pings (AgentDetail, OnboardingChat, ArtifactsPanel generating, ActiveAgentsPanel, IssueDetail Live pill, RunTranscriptView, IssueRunLedger live chip, DesignGuide sample), Live surfaces (LiveRunWidget theme, ActiveAgentsPanel Live-now box, AgentDetail live-card border), scheduled-retry family (IssueScheduledRetryCard, runRetryState, IssueRunLedger retry-pending), externalObjectStatus icon/badge `running` (now shares blue with `open`; liveness pulse differentiates — flagged), timeline "now" marker `#2dd4bf`→`#2563eb` (1.5px line vs `#5b9bf6` delegated bars, shape differentiates — flagged), and the liveness glow shadow tokens `--shadow-extract-1/11/14` value-edited `rgba(6,182,212,0.08)`→`rgba(37,99,235,0.08)` (kept-token VALUES changed, call sites unchanged).
+ Deliberately LEFT (non-liveness cyan, one-line reasons): xterm terminal cursor (CompanyEnvironments — terminal chrome); `on_demand` invocation-source chips (AgentDetail x2 + DesignGuide sample — source tag, not liveness); CompanySkills "Includes assets" chip (content-type tag); CompanyImport renamed-file mono text x2 (rename annotation); BlockedReasonChip `recovery_required` (blocked-reason category); IssueRunLedger "Advanced" outcome + "Silence snoozed" tones (outcome/pause semantics, not live); UxLab decorative gradients (B1 allowlisted decoration).
+
+## Gallery feedback round 3 (preset-tune session, Jul 6) — executed
+
+1+2. **Toggle unification** — hunt found exactly ONE second switch implementation: `ToggleField` in agent-config-primitives.tsx (hand-rolled h-5 w-9 pill, `bg-green-600` track — the "other green"). It now renders the canonical `ToggleSwitch` (3da1bbcc5 capsule, on = `var(--status-task-done)`), same props/behavior/testid. All other named suspects (AgentConfigForm, Instance*Settings, RoutineDetail, PipelineSettings, story fixtures) already used ToggleSwitch; remaining `bg-green-600` hits are buttons, not tracks. Every switch now renders the one capsule + one green.
+3. **Agent-status chips → canonical colors** ("Org snippets and quick scan identity" = StatusBadge in control-plane-surfaces story): `statusBadge` agent keys now route through `brandChipBadge` families (bordered brand chips): running → blue, idle → GRAY (was yellow tint), paused → amber, **active → green (no canonical agent status exists — user-ruled mapping to the brand green/done family)**; error already rides the shared run-status red. brandChipBadge block moved above statusBadge in status-colors.ts (declaration order). Org.tsx's hand-rolled status-dot ternary now routes through `agentStatusDot` (same hues + gains the blue running dot). Left: Companies.tsx company-status chip (company entity, not agent), AgentConfigForm "current" model tag (not a status).
+4. **Dark-text-on-light-wash sweep** — the flagged BudgetPolicyCard banner was already fixed in round 2 (screenshot predated it). Systematic sweep (bare `text-{red,amber,emerald,sky,green,yellow,cyan}-{50..300}` without dark: protection): **58 sites fixed across 14 files** (Dashboard budget alert, BudgetPolicyCard remaining-amount, AgentConfigForm banners x3, AgentDetail banners/chips x9, ProjectDetail x3, CompanyAccess, IssueDocumentsSection x6, RoutineHistoryTab x11, DocumentDiffModal x2, PipelineItemBodyDocument x2, RoutineSaveBar, DocumentFrameHeader, OutputFileTile x3, CompanySkills x10) — pattern: 50→950, 100→900, 200→800, 300→700 in light + original behind `dark:`, opacity suffixes preserved. Verified-safe leftovers: InviteLanding x4 (dark-styled standalone page), SidebarNavItem badge + DocumentAnnotationLayer tail + DevRestartBanner (solid dark/colored bg or dark:-protected).
+
+## Verification status (this review)
+
+- `pnpm check:token-gates` — re-run independently: 3/3 CLEAN (468 files, 31 allowlist entries).
+- `pnpm typecheck` + full `pnpm test:storybook-visual` — re-running independently (in progress).
+- Eyeball-pass note: the Phase 0 baseline was captured at the master fork point before any change, and the suite compares current rendering to it at `maxDiffPixels: 0` — pixel-equality with master-at-fork is machine-proven; side-by-side Storybook remains available on request (`pnpm storybook` here + `-p 6007` on master).
+
+## Tune session — CLOSED (Jul 6, 2026)
+
+User approved the complete new design language via gallery v4 + live test drive on the :3300 worktree instance ("ship it"). Merged origin/master (12 commits; one conflict — upstream deliberately removed the Wakes-on-confirm chip, deletion accepted). 296 snapshots re-baselined; gates 3/3 CLEAN; typecheck green; final suite verification run against the new baseline. Remaining roadmap: Run 3 (cards/pills/C11 sidebar + investigations + AgentDetail story), issue→task rename run, Run 4 (palette classes + toast), ESLint ratchet.
diff --git a/doc/design/GOAL-PROMPT.md b/doc/design/GOAL-PROMPT.md
new file mode 100644
index 0000000000..cc3611eb48
--- /dev/null
+++ b/doc/design/GOAL-PROMPT.md
@@ -0,0 +1,81 @@
+# /goal Prompt — Design Language Simplification, Run 1 (v3)
+
+Paste everything inside the code block below into Claude Code after typing `/goal`, from inside this worktree. Prerequisites already satisfied on this branch: DESIGN.md, PRIOR-ART.md, KNOWN-DUPLICATES.md at repo root; token-auditor + codemod-runner in `.claude/agents/`.
+
+v3: condensed under the /goal 4,000-character limit (v2 was 4,648 and got rejected). The paste block now carries only mission + DONE-WHEN + guardrails; the full phase spec lives in the "Phase spec" section below, which the run reads from this file on disk.
+
+```
+Refactor Paperclip's UI so every visual value flows through the single
+existing token layer, with provably zero visual change, working only in
+this git worktree on branch design/token-extraction. Never touch master
+or other working trees. DESIGN.md at the repo root is the source of
+truth; follow it exactly. Read PRIOR-ART.md before auditing. Execute
+Phases 0-2 exactly as specified in the "Phase spec" section of
+GOAL-PROMPT.md at the repo root (Phase 0 external baseline archive,
+Phase 1 audit, Phase 2 codemod extraction), delegating Phase 1 to the
+token-auditor subagent and Phase 2 to the codemod-runner subagent.
+Commit after each phase and in small reviewable steps.
+
+DONE WHEN (all verified in this worktree):
+1. The Storybook visual snapshot suite passes against a Phase 0
+ baseline that was captured BEFORE any component change and pinned in
+ tests/storybook-visual/baseline-manifest.json — zero visual change.
+ Baseline scope: primitives in ui/src/components/ui/
+ (add minimal stories only for those) plus the existing stories in
+ ui/storybook/stories/. No stories for the ~277 feature components.
+2. ui/src/index.css (plus any tokens.css it imports) is the only token
+ source and components consume visual values only through it; no
+ parallel token source exists; runtime-tunable tokens live in a
+ NON-inline block.
+3. rg gates pass: zero hex color literals, zero arbitrary px/bracket
+ Tailwind values, zero raw font-size declarations in
+ ui/src/components/** and ui/src/pages/** outside the documented
+ allowlist in the token source.
+4. TOKEN-AUDIT.md and COMPONENT-INVENTORY.md exist at the repo root,
+ are current, and each contains a "Needs human decision" section.
+5. pnpm build, pnpm typecheck, and pnpm build-storybook all exit 0.
+
+GUARDRAILS
+- Preserve rendered output exactly. Reuse an existing token only on
+ EXACT value match; otherwise mint a new token with the value
+ VERBATIM — no normalizing, rounding, or inventing a scale. If a
+ replacement cannot be made without visual change, skip it and log it
+ under "Needs human decision".
+- All value rewrites happen via codemod scripts committed to scripts/,
+ never file-by-file hand edits.
+- No redesign, no layout changes, no new colors/typefaces, no component
+ merges or deletions (consolidation and shadcn swaps are
+ recommendations-only in COMPONENT-INVENTORY.md), no copy renames
+ (issue->task is a separate later run), no new dependencies beyond
+ snapshot tooling, no server or app-logic changes.
+- If reality conflicts with DESIGN.md, record the conflict in
+ TOKEN-AUDIT.md instead of guessing. If a phase cannot be completed,
+ stop and report rather than partially applying it.
+```
+
+## Phase spec (referenced by the goal — the run reads this from disk)
+
+**Phase 0 — Baseline (before changing ANY component):**
+- Set up Storybook visual snapshot testing (Storybook test-runner with image snapshots, or equivalent already-compatible tooling; Storybook lives at `ui/storybook/`, launched via `pnpm storybook`).
+- Coverage scope: the shared primitives in `ui/src/components/ui/` (add a minimal story for any of the ~24 that lack one) plus all existing stories under `ui/storybook/stories/`. Do NOT write stories for the ~277 feature components in this run.
+- Pack and publish the passing baseline snapshots through the external
+ Storybook visual baseline flow, then commit the manifest metadata. Every
+ later phase must keep snapshots matching this baseline.
+
+**Phase 1 — Audit (no code changes; delegate to token-auditor):**
+- Produce `TOKEN-AUDIT.md` at the repo root: every hardcoded color/spacing/radius/type/shadow value in `ui/src/`, its frequency, file locations, and near-duplicate clusters (e.g. 13/14/15px used interchangeably). Flag clusters for human review — do NOT merge them. Cross-reference the ~80 existing tokens in `ui/src/index.css`: for each hardcoded value, note whether it exactly matches an existing token.
+- Produce `COMPONENT-INVENTORY.md`: all components, their variants, and suspected duplicates with evidence (similar props, similar rendered output, copy-pasted origins). Include a "shadcn candidates" section: (a) custom components duplicating an available shadcn primitive, (b) installed shadcn components drifted from the registry (`npx shadcn@latest diff` where available), (c) raw Radix/plain elements where an installed shadcn wrapper exists. For each, state the recommended replacement and expected visual impact. ALL consolidation and swap items are RECOMMENDATIONS ONLY.
+
+**Phase 2 — Extraction (mechanical, via codemod; delegate to codemod-runner):**
+- Token destination is `ui/src/index.css` (Tailwind v4; optionally a `tokens.css` imported by index.css). Do NOT create a parallel token source. Tokens that must be runtime-tunable go in a NON-inline block (`@theme inline` bakes literals).
+- Exact-match values → existing token reference; everything else → new verbatim token. Ugly values stay ugly; they are the audit.
+- Codemod scripts committed to `scripts/` perform the replacements; run them; no hand-edits.
+- Third-party overrides that cannot use tokens go on a documented allowlist in the token source, each with an inline comment saying why.
+
+## After the run (human steps)
+
+1. Eyeball pass: `pnpm storybook` here and in the master tree (`-p 6007`), flip between tabs.
+2. Read TOKEN-AUDIT.md; choose the real spacing/radius scale (PRIOR-ART.md has drafted rules to start from).
+3. Tune tokens; snapshots now fail intentionally — the diff folders are your design-review contact sheet. This is also where the ui.shadcn.com/create preset lands, as token-value edits.
+4. Review COMPONENT-INVENTORY.md; approve a merge list and shadcn-swap list → those become Run 2 and Run 3, each its own /goal.
+5. Merge to master when satisfied (rebase first if master moved). Scrap path: `git worktree remove ../paperclip-design-simplify --force`.
diff --git a/doc/design/KNOWN-DUPLICATES.md b/doc/design/KNOWN-DUPLICATES.md
new file mode 100644
index 0000000000..82b08cc8c3
--- /dev/null
+++ b/doc/design/KNOWN-DUPLICATES.md
@@ -0,0 +1,14 @@
+# Known duplicates & off-limits areas (human-maintained)
+
+Seed list for the audit. Add components you already believe are redundant, and any screens the run must not touch. The auditor treats entries here as leads to verify, not verdicts.
+
+## Suspected duplicates / overlap (leads)
+
+- Chat composers: the shared `ChatComposer` vs `MarkdownEditor`-based task composer — deliberately NOT unified in a prior pass (PAP-101); audit the overlap but flag as "Needs human decision".
+- Agent bubble action rows: `AgentBubbleActionRow.tsx` had two parallel implementations created by concurrent work at one point — verify only one remains.
+- Status glyphs/chips: `StatusIcon` vs inline-mention chips vs task chips — intentionally separate systems per prior work; document, don't merge.
+
+## Off-limits in this run
+
+- `ui/src/components/theme-editor/` and anything under experimental theme/playground paths, if present on this branch.
+- Server code, adapters, CLI — everything outside `ui/`.
diff --git a/doc/design/PRIOR-ART.md b/doc/design/PRIOR-ART.md
new file mode 100644
index 0000000000..695f805e46
--- /dev/null
+++ b/doc/design/PRIOR-ART.md
@@ -0,0 +1,21 @@
+# Prior art: PAP-280 design-token audit (branch `PAP-282-playground`, not on master)
+
+A previous audit/relink pass ran against this codebase in mid-2026. Its code never merged to master, but its findings are directly reusable by the token audit. Read this before Phase 1.
+
+## Key findings to inherit
+
+- **Drift is mostly NOT same-value-mappable.** The relink pass (commit `032d6c8db` on the branch) attempted to swap hardcoded values for existing semantic tokens *without visual change* and found only **6 exact-value swaps** possible (`text-muted-fg`, `rounded-md`) out of ~220 audited drift sites (~193 color / 23 radius / 7 type). Implication for Phase 2: expect to mint many new verbatim tokens; do not force-fit near-misses onto existing tokens — that changes pixels.
+- **Token gap clusters identified** (commit `96689351d`): recurring un-tokenized needs were a code-surface background, an accent blue, and a muted feed text color — these became `--surface-code`, `--accent-blue`-style gap tokens on the branch. Audit should check whether the same clusters still dominate.
+- **Tailwind v4 tunability gotcha** (learned the hard way): `@theme inline` bakes literals at build time; tunable tokens must live in a non-inline block.
+
+## Drafted usage rules (branch commit `6ba86cd4f` — candidates for the human scale decision, NOT current master state)
+
+- **Radius:** one monotonic scale `sm 6 / md 8 / lg 10 / xl 14 / 2xl 16 / full`. Assignments: sm=chips/badges/pills; md=buttons/inputs/menu items (default); lg=cards/popovers/panels; xl=dialogs/sheets/overlays; 2xl=hero/onboarding only; full=avatars/dots/capsules. Nested elements step down one tier from their container. (Master's current values differ — verify in the audit.)
+- **CTA tiers:** three-tier button prominence — Primary (`default`/`destructive`): the single commit action per view; Secondary (`secondary`/`outline`): supporting actions; Tertiary (`ghost`/`link`): row actions, cancels, toolbar icons.
+- **Type styles:** nine named intent styles (backed by `--text-*` tokens incl. `micro` 11px / `nano` 10px) instead of re-deriving `text-lg font-semibold` per call site. Color is a separate axis.
+- **Drift-prevention contract:** no raw hex for chrome — use `background / card / muted / accent / border / muted-foreground`; when a needed value has no token, add a semantic token; intentional opt-outs (code/terminal blocks) carry a comment saying why, so a future re-link pass leaves them alone.
+
+## Reusable machinery on the branch
+
+- A theme playground / theme editor with portable `*.theme.json` export-import (whole-app live retheme, A/B compare). Useful later for the human scale-collapse and brand/preset tune steps — not needed for the extraction run.
+- `.claude/skills/design-guide/` skill + `ui/src/pages/DesignGuide.tsx` showcase page (branch versions are richer than master's).
diff --git a/doc/design/RUN3-PROMPT.md b/doc/design/RUN3-PROMPT.md
new file mode 100644
index 0000000000..b378950890
--- /dev/null
+++ b/doc/design/RUN3-PROMPT.md
@@ -0,0 +1,96 @@
+# Run 3 — Component convergence: guide + /goal prompt
+
+Executes the approved component-convergence scope from `DECISION-SHEET.md`: C5 (hand-rolled cards → `Card`, pills → `Badge`), C11 (sidebar agents rows → `SidebarNavItem`), C2/C3 (investigate-first items), plus the AgentDetail story coverage gap.
+
+## Which directory?
+
+**If PR #9134 has merged to master (preferred):** create a fresh worktree from the main checkout —
+
+```bash
+cd ~/Projects/DEV/paperclip
+git fetch origin && git worktree add ../paperclip-run3 -b design/component-convergence origin/master
+cd ../paperclip-run3 && pnpm install
+```
+
+**If #9134 is still open:** reuse the existing worktree (it has everything installed and the baselines present) on a stacked branch —
+
+```bash
+cd ~/Projects/DEV/paperclip-design-simplify
+git checkout -b design/component-convergence
+```
+
+Either way: launch `claude` from inside that directory, type `/goal`, paste the block below. The session inherits DESIGN.md and these docs automatically.
+
+## What to expect
+
+- Mostly unattended, roughly a day. Unlike Run 1, small visible deltas are *expected* (a border tone here, 1px of padding there) — the guardrails force every one to be exported for your review and individually revertable.
+- After the goal clears: open `doc/design/run3-review/` (before/after images for every story the run changed), skim, and revert any commit whose look you reject. Each conversion is its own commit.
+
+## The /goal paste block
+
+```
+Converge Paperclip's duplicated hand-rolled UI onto the shared
+primitives, per the approved scope in doc/design/DECISION-SHEET.md
+items C2, C3, C5, C11. DESIGN.md is the source of truth; read
+doc/design/CHANGING-THE-UI.md and doc/design/RUN3-PROMPT.md first.
+Work only in this worktree/branch; never touch master. Small
+reviewable commits: one component-conversion unit per commit.
+
+SCOPE
+1. C5a: every hand-rolled card container (rounded-* + border +
+ bg-card pattern) in ui/src/components/** and ui/src/pages/**
+ converts to the Card primitive, preserving layout and behavior.
+2. C5b: every hand-rolled pill span converts to Badge (or the
+ status-chip system where it encodes status), same preservation.
+3. C11: SidebarAgents rows render via SidebarNavItem (keep agent
+ status dot + wake affordances; dot uses --status-agent-running).
+ Apply one collapsibility policy across sidebar sections and
+ record it in DECISION-SHEET.md C11.
+4. C2/C3: investigate (do not merge by default): C2 WorkspaceFileBrowser
+ vs FileTree tree models; C3 the four entity pickers. Write verdicts
+ with evidence into COMPONENT-INVENTORY.md. Execute a merge ONLY if
+ the verdict is copy-paste drift with identical data shapes and the
+ merge preserves behavior; otherwise document keep-as-is rationale.
+5. Add a Storybook story for the AgentDetail page (realistic fixture,
+ light+dark) so it joins the visual suite.
+
+VERIFICATION DISCIPLINE (small visual deltas are EXPECTED)
+- Before starting: run the suite once to confirm 510/510 green.
+- Per conversion commit: run the affected stories; if pixels changed,
+ copy each changed story's expected/actual/diff triplet into
+ doc/design/run3-review/<story>/ and note the story ids + one-line
+ justification in the commit message. Deltas must be small
+ (primitive-level: borders, radii, padding) — a layout shift or
+ color-meaning change means STOP that conversion, revert it, and
+ record it under "Needs human decision" in DECISION-SHEET.md.
+- A site that cannot adopt the primitive without breaking behavior:
+ skip it, comment why inline, list it in the report.
+
+DONE WHEN (all verified in this worktree)
+1. rg finds no hand-rolled card-container or pill-span patterns in
+ ui/src/components/** or ui/src/pages/** outside documented inline
+ allowlist comments; converted sites import Card/Badge/SidebarNavItem.
+2. C2/C3 verdicts written in COMPONENT-INVENTORY.md; C11 policy
+ recorded in DECISION-SHEET.md.
+3. AgentDetail story exists and renders in the suite.
+4. pnpm check:token-gates 3/3 CLEAN; pnpm typecheck green;
+ pnpm --filter @paperclipai/ui build exit 0.
+5. Full visual suite passes against the updated baseline, and
+ doc/design/run3-review/ contains the triplets for every story
+ whose baseline changed, committed.
+6. All vitest suites for touched components pass, assertions updated
+ in lockstep where they referenced old markup/classes.
+
+GUARDRAILS
+- Preserve behavior exactly: props, handlers, a11y roles, test ids.
+- No new dependencies. No palette-class conversions (Run 4's job).
+- Never re-baseline a diff you cannot justify in the commit message.
+- If a phase cannot complete, stop and report rather than partially
+ applying it.
+```
+
+## After the run
+
+1. Review `doc/design/run3-review/` — approve or `git revert` per commit.
+2. Check the "Needs human decision" additions in DECISION-SHEET.md.
+3. Merge (or stack the PR), then Run 4 (palette classes) and the ESLint ratchet are all that remain.
diff --git a/doc/design/TOKEN-AUDIT.md b/doc/design/TOKEN-AUDIT.md
new file mode 100644
index 0000000000..c3b2cf5360
--- /dev/null
+++ b/doc/design/TOKEN-AUDIT.md
@@ -0,0 +1,428 @@
+# TOKEN-AUDIT.md — Design Token Drift Audit (Phase 1)
+
+Run scope: `ui/src/` only, on branch `design/token-extraction`. Read-only audit — no source files were modified. See `DESIGN.md` for the token layer contract and `PRIOR-ART.md` for prior findings (only 6/220 exact-mappable).
+
+**Method:** ripgrep over `ui/src/**/*.{ts,tsx,css}`. Counts below are current as of this run (2026-07-06), not the PRIOR-ART numbers. Test files (`*.test.ts(x)`) are included in totals where noted but broken out separately — they are not shipped UI, but they do encode the same hardcoded values and will need companion updates if Phase 2 changes the values they assert against.
+
+## Executive summary
+
+| Category | Site count | Files | Existing-token exact matches |
+|---|---:|---:|---:|
+| Hex color literals (`#...`) | 206 (150 source / 56 test-only) | 51 | ~14 sites (case-insensitive match only — see below) |
+| `rgb()/rgba()/hsl()/hsla()` literals | 52 | ~30 | 0 (all are opaque decorative gradients / canvas fills) |
+| Tailwind arbitrary color brackets (`bg-[#..]`, `text-[#..]`, `border-[#..]`) | ~72 | ~10 | overlaps with hex count above (same literals, bracket-wrapped) |
+| Tailwind palette utility classes (`bg-red-500`, `text-amber-600`, etc. — not literal hex but not project tokens either) | **3,115** | **145** | 0 (Tailwind's built-in oklch palette, never routed through `index.css`) |
+| `text-[Npx]` arbitrary font-size | 730 | 137 | 0 |
+| `tracking-[N em]` arbitrary letter-spacing | 202 | ~40 | 0 |
+| `w-[...]` / `h-[...]` arbitrary size | 124 / 166 | ~60 combined | 0 (mostly px/rem/vh/dvh/calc, some `var(--radix-*)`) |
+| `min-w/max-w/min-h/max-h-[...]` | 194 | ~45 | 0 |
+| `p*/m*-[...]` arbitrary spacing | 14 | 9 | 0 (mostly `env(safe-area-inset-*)` and `calc(theme(spacing.N)-2px)`) |
+| `gap-[...]` arbitrary | 8 | 2 | 0 |
+| `rounded-[...]` arbitrary radius | 25 | 10 | 0 (4 of these are **stock shadcn registry values**, not local drift — see below) |
+| `shadow-[...]` arbitrary shadow | 38 | 21 | 0 |
+| inline `style={{ }}` literals with a hardcoded value | ~90 sites across 58 files | 58 | see cross-ref |
+| Chart/status color constant arrays (`.ts`) | 6 files, ~35 distinct hex | 6 | 1 partial (`#2563eb`) |
+
+Total distinct hardcoded-value **sites** (excluding the 3,115 Tailwind-palette-class sites, which are reported separately because enumerating each is not useful) is roughly **1,550** across color/spacing/radius/type/shadow categories. Including the Tailwind palette-class sites, the true "every visual value should be a token" count DESIGN.md principle 2 implies is **~4,650+**. This is far larger than PRIOR-ART's ~220 — either the codebase grew substantially since that audit, or that audit undercounted Tailwind arbitrary values and palette classes (it reported "~193 color / 23 radius / 7 type" — consistent with counting only hex/oklch color literals and rounded-brackets, not `text-[Npx]` or Tailwind palette-class usage). **Flagged for human decision**: whether Tailwind palette-class usage (`bg-red-500` etc.) is in scope for Phase 2 token extraction, since DESIGN.md principle 2 says "no hex, no raw px" but doesn't explicitly call out named Tailwind color classes, and mechanically tokenizing 3,115 sites is a materially bigger job than the rest of this audit combined.
+
+---
+
+## 1. Color literals
+
+### 1.1 Hex colors — exact/near matches against `index.css` tokens
+
+`index.css` status/brand hex values (all defined in `:root`, mode-independent — see DESIGN.md brand tier):
+
+```
+--status-agent-idle: #a8aeb2 --status-task-backlog: #a8aeb2 --status-task-cancelled: #a8aeb2
+--status-agent-running: #2563eb --status-task-in_progress: #2563eb
+--status-agent-paused: #f59e0b --status-task-todo: #f59e0b
+--status-agent-error: #dc2626 --status-task-blocked: #dc2626
+--status-task-in_review: #7c3aed
+--status-task-done: #22c55e
+--status-task-icon-backlog: #52585d --status-task-icon-todo: #cc7a00 --status-task-icon-done: #16a34a
+--status-task-icon-cancelled: #52585d
+(.dark overrides) --status-task-icon-backlog: #9a958a -todo: #fbbf24 -in_review: #9474f0 -done: #34d06f -cancelled: #9a958a
+--paperclip-doc-annotation-highlight-*: #fef08a / #fde047 / #fef9c3 (light), #a16207 / #ca8a04 / #854d0e / #713f12 (dark)
+--agent-1a..10b: 20 fixed brand hex (gradient stops), unique, not reused elsewhere in ui/src
+```
+
+**Exact matches found (case-insensitive value match) in `ui/src/lib/status-colors.ts`:**
+
+| Hardcoded value | Site | Token it matches | Safe to swap without visual change? |
+|---|---|---|---|
+| `#A8AEB2` | `status-colors.ts:112,120,144` | `--status-agent-idle` / `--status-task-backlog` (`#a8aeb2`) | Yes — value identical, case differs only |
+| `#2563EB` | `status-colors.ts:113,121,145` | `--status-agent-running` / `--status-task-in_progress` (`#2563eb`) | Yes |
+| `#F59E0B` | `status-colors.ts:114,122,146` | `--status-agent-paused` / `--status-task-todo` (`#f59e0b`) | Yes |
+| `#DC2626` | `status-colors.ts:115,123,149` | `--status-agent-error` / `--status-task-blocked` (`#dc2626`) | Yes |
+| `#22C55E` | `status-colors.ts:147` | `--status-task-done` (`#22c55e`) | Yes |
+| `#7C3AED` | `status-colors.ts:148` | `--status-task-in_review` (`#7c3aed`) | Yes |
+| `#52585D` | `status-colors.ts:112,144` | `--status-task-icon-backlog` (light) (`#52585d`) | **Needs human decision** — token is mode-dependent (dark override `#9a958a`); this hardcoded value is used as a **fixed** chip background/text/border tint across both modes (it appears inside a class string with a separate literal `dark:` variant already, e.g. `dark:text-[#9A958A]`). The light value happens to equal the icon token; the surrounding hardcoded `dark:` variant (`#9A958A`) also happens to equal `--status-task-icon-backlog`'s dark override. So the *pair* is exactly reproducible via the token + its `.dark` override, but only if both the light and dark literals are replaced together — a partial swap would break one mode. |
+| `#9A958A` | `status-colors.ts:112,144` | `--status-task-icon-backlog` `.dark` override (`#9a958a`) | Same caveat as above — pair with `#52585D` |
+
+These 6 pairs (12 literal sites) in `status-colors.ts` are the largest concentration of **exact, likely-safe** matches found in this audit — consistent with PRIOR-ART's finding that exact matches are rare and cluster narrowly. All other hardcoded hex in the file (`#F5F3F0`, `#DBEAFE`, `#1D4ED8`, `#FEF3C7`, `#B45309`, `#FEE2E2`, `#991B1B`, `#DCFCE7`, `#188A3C`, `#EDE9FE`, `#5B21B6`, `#6E6960`/`#6e696024` alpha variants, and all the `dark:bg-[#...NN]` alpha-suffixed variants) have **no exact-value token match** — they are chip background tints (e.g., `#F5F3F0` light chip fill) that were hand-tuned independently of the base hue tokens and don't derive from them via any documented formula.
+
+**`agentStatusBadge` (status-colors.ts:111-116) and `brandChipBadge` (status-colors.ts:143-149) are byte-for-byte identical maps** (same 4 shared keys: gray/blue/amber/red, same hex, same dark alpha suffixes) — flagged as a literal duplicate object, not just a duplicate value. `brandChipBadge` additionally has a `green` and `violet` entry `agentStatusBadge` lacks. **Needs human decision**: collapse `agentStatusBadge` into `brandChipBadge` (drop the redundant map) — this is a code dedup, not a token question, but it directly affects how many sites Phase 2 needs to touch.
+
+### 1.2 Hex colors — no match, chart/status color arrays (mint new tokens)
+
+Six files define standalone hex color arrays/maps for chart or dot rendering, none derived from `index.css`:
+
+- `components/ActivityCharts.tsx:125-184` — priority colors (`critical #ef4444`, `high #f97316`, `medium #eab308`, `low #6b7280`) and a **second, differently-valued** status-color map (`todo #3b82f6`, `in_progress #8b5cf6`, `in_review #a855f7`, `done #10b981`, `blocked #ef4444`, `cancelled #6b7280`, `backlog #64748b`) that does **not** match `lib/status-colors.ts`'s `issueStatusColor`/`taskStatusVar` naming-to-hue mapping at all (e.g., `in_progress` is violet-ish `#8b5cf6` here vs. blue `#2563eb` in the canonical status system). **Flag: internal inconsistency**, not just missing tokens — this chart appears to use an entirely independent palette from the rest of the app's status system.
+- `pages/OrgChart.tsx:162-169` — agent status dot colors (`running #22d3ee`, `active #4ade80`, `paused #facc15`, `idle #facc15`, `error #f87171`, `terminated #a3a3a3`) — again independent from `--status-agent-*` (compare `running`: `#22d3ee` here vs `#2563eb` token).
+- `lib/timeline/layout.ts:131-136,162` — `TIMELINE_COLORS` (`delegated #5b9bf6`, `automation #f4b740`, `cancelled #9aa3ad`, `now #2dd4bf`) plus a runtime `hsl(hue 62% 52%)` per-issue hash color (line 162) — deliberately unbounded (hash-based), cannot be tokenized as discrete values; the 4 named constants can be.
+- `pages/CompanySkills.tsx:549-551` — a 12-color palette array for skill/tag chips (`#6366f1, #0ea5e9, #10b981, #f59e0b, #ef4444, #8b5cf6, #ec4899, #14b8a6, #f97316, #22c55e, #3b82f6, #a855f7`).
+- `lib/color-contrast.ts:9,71-72` — `DARK_BG {24,24,27}` (documented as zinc-900/`#18181b`), `TEXT_LIGHT #f8fafc`, `TEXT_DARK #111827` — contrast-calculation reference colors, functionally load-bearing (not decorative), needs care in Phase 2.
+- `context/ThemeContext.tsx:20-21` — `DARK_THEME_COLOR #18181b`, `LIGHT_THEME_COLOR #ffffff` — sets the `<meta name="theme-color">` tag; same value family as `color-contrast.ts`'s `DARK_BG`.
+- `lib/worktree-branding.ts:28,49` — fallback black/white pair (`#000000` / `#f8fafc` / `#111827`), same contrast-pair pattern as above.
+
+**Cluster: 3 separate near-identical "readable text on dark/light" pairs** exist (`color-contrast.ts`, `worktree-branding.ts`, and implicitly `ThemeContext.tsx`'s theme-color), using `#f8fafc`/`#111827` twice and `#18181b`/`#020617`-family dark backgrounds inconsistently. **Flagged for human review** — looks like copy-paste convergence on the same Tailwind `slate-50`/`gray-900`-ish pair from three independent implementations; do not merge without checking each call site's actual contrast requirement.
+
+### 1.3 Hex colors — project-color fallback cluster (widely repeated)
+
+`#6366f1` (indigo) and `#64748b` (slate) are used as **default/fallback colors for user-configurable project colors** (`project.color ?? "#6366f1"` pattern) in 14 total sites:
+
+- `#6366f1`: `pages/ProjectDetail.tsx:789`, `pages/CompanySettings.tsx:272`, `pages/CompanySkills.tsx:549`, `pages/PipelineSettings.tsx:2959,2974`, `plugins/bridge-init.ts:502,515`, `components/issue-properties/IssueProperties.tsx:181,1576,1649`, `components/NewIssueDialog.tsx:1489,1504` (+2 in test files)
+- `#64748b`: `pages/Routines.tsx:751,766`, `components/MarkdownEditor.tsx:1355`, `components/RoutineRunVariablesDialog.tsx:426,441`, `components/RoutineList.tsx:121`, `components/IssueColumns.tsx:362`, `components/routine-sections/editable-sections.tsx:193,208`, `components/ActivityCharts.tsx:184` (also appears as the `backlog` chart color, see 1.2)
+
+Neither matches an `index.css` token. **This is the single highest-value token-minting candidate in the whole audit** — one new `--project-color-fallback` (or two, if indigo/slate serve different call sites deliberately — `#6366f1` seems to be the "new project" default color picker seed, `#64748b` the "no project assigned" muted-slate fallback) would collapse 14+ sites. **Flag for human decision**: are these two meant to be the same fallback (a copy-paste drift) or intentionally different (new-project-color-picker-seed vs. no-project-slate)? The file-level pattern suggests two distinct call-site families (issue/project-creation UI uses indigo; routine/schedule UI uses slate), which argues for two tokens, not one.
+
+### 1.4 Hex colors — miscellaneous singletons
+
+- `components/ActivityFeed.tsx:286-288` and `components/FeedCard.tsx:432` — `#959596` (muted feed actor/verb text), 4 sites, 2 files. No token match. **This matches PRIOR-ART's called-out "muted feed text" gap cluster** — confirms it's still present and still untokenized.
+- `components/OnboardingWizard.tsx:1722` — `bg-[#1d1d1d]` (dark decorative panel), singleton.
+- `components/IssueChatThread.tsx:1451` — `bg-[#2563EB]` for "human's own message" bubble — **exact match** to `--status-agent-running`/`--status-task-in_progress` (`#2563eb`), but comment at line 1450 calls it "Liveness blue" independently — likely coincidental reuse of the same brand blue rather than a deliberate token reference. Flag as exact-match candidate but note the semantic mismatch (chat-bubble liveness vs. task-status liveness are different concepts that happen to share a hue).
+- `pages/InviteUxLab.tsx:199,411` — `brandColor="#114488"` (lab/showcase-only, hardcoded prop value for a demo).
+- `pages/CompanyEnvironments.tsx:427-431` — xterm.js terminal theme colors (`#0a0a0a`, `#f5f5f5`, `#22d3ee`, `#020617`, `#2563eb55`) — third-party terminal library config, arguably belongs on the documented allowlist (terminal chrome is intentionally distinct from app chrome).
+- `fixtures/issueChatUxFixtures.ts:91` — `#0f766e` fixture data, out of runtime scope (test/demo fixture, not rendered UI chrome) but technically under `ui/src/`.
+- `lib/mention-chips.ts:193` — `stroke="#000"` inside an inline SVG string (icon mask), singleton, likely intentional pure-black regardless of theme (needs human check).
+
+---
+
+## 2. `rgb()/rgba()/hsl()/hsla()` literals (52 sites, non-test)
+
+Overwhelmingly **decorative gradient hero backgrounds** using `rgba(...)` inside Tailwind arbitrary `bg-[linear-gradient(...)]` / `bg-[radial-gradient(...)]` values:
+
+- **UxLab/showcase pages** (majority of sites): `pages/IssueChatUxLab.tsx` (7), `pages/SystemNoticeUxLab.tsx` (5), `pages/InviteUxLab.tsx` (7), `pages/RunTranscriptUxLab.tsx` (2), `pages/ProfileSettings.tsx` (2) — these ARE routed (`/ux-lab/*`, `/design-guide`), not build-excluded, so they are in scope per DESIGN.md, but they are explicitly demo/showcase surfaces rather than product screens.
+- **Production surfaces with the same gradient pattern**: `pages/Dashboard.tsx:222` (red budget-alert gradient), `pages/Costs.tsx:842` (subtle white gradient card), `components/AccountingModelCard.tsx:31`, `components/SidebarAccountMenu.tsx:163`, `components/BudgetIncidentCard.tsx:46`. Each gradient is a **unique** rgba tuple (no two production sites share the same gradient stops) — this is bespoke decoration per surface, not a systematic pattern, and is a strong "Needs human decision" candidate: minting one token per gradient (5+ new tokens) preserves pixels but does not reduce the "one way to say alert-card decoration" debt DESIGN.md principle 1 wants; collapsing them changes pixels.
+- **Functional (non-decorative) uses**: `lib/mention-chips.ts:169` — `rgba(r,g,b,0.22)` computed at runtime from a hash-derived color (cannot be a static token). `components/CompanyPatternIcon.tsx:128,131` — `rgb(...)` canvas fill computed from props (same — dynamic, not tokenizable as a single value). `lib/timeline/layout.ts:162` — `hsl(hue 62% 52%)` runtime hash color (same). `components/FileViewerSheet.tsx:370,379` — `var(--paperclip-code-highlight-bg, rgba(250,204,21,0.12))` — this one **already has a CSS-var fallback pattern**, i.e., it's half-migrated: the var doesn't exist in `index.css` yet, only the inline fallback does. **Recommend this becomes the actual token** (`--paperclip-code-highlight-bg` / `-border`) in Phase 2 since the call site already expects it.
+
+**Needs human decision**: whether one-off decorative gradients (Dashboard, Costs, AccountingModelCard, SidebarAccountMenu, BudgetIncidentCard, and all UxLab pages) should each mint a bespoke token (verbatim per DESIGN.md guardrails) or be added to the documented allowlist as "intentional decorative opt-outs" — minting ~15 near-duplicate gradient tokens that will never be reused elsewhere seems to work against the spirit of "tokens are the only source of visual values" even though it satisfies the letter of it.
+
+---
+
+## 3. Tailwind arbitrary bracket values (spacing / size / radius / type / shadow)
+
+### 3.1 Font-size — `text-[Npx]` (730 sites, 137 files) — THE dominant cluster
+
+| Value | Site count | Representative files (abbreviated where >10) |
+|---|---:|---|
+| **11px** | 417 | 104 files use it at least once. Heaviest: `pages/Secrets.tsx` (28), `pages/CompanySkills.tsx` (24), `components/transcript/RunTranscriptView.tsx` (20), `components/IssueChatThread.tsx` (17), `pages/TeamCatalog.tsx` (15), `components/IssueRunLedger.tsx` (15), `pages/AgentDetail.tsx` (12), `components/ProjectProperties.tsx` (12), `components/OnboardingWizard.tsx` (12), `components/IssueRecoveryActionCard.tsx` (12), + 94 more files |
+| **10px** | 236 | 77 files. Heaviest: `components/IssueChatThread.tsx` (17), `components/transcript/RunTranscriptView.tsx` (15), `pages/TeamCatalog.tsx` (14), `pages/IssueDetail.tsx` (11), `components/CommentThread.tsx` (9), + 72 more |
+| **13px** | 26 | `pages/IssueChatUxLab.tsx`, `pages/TeamCatalog.tsx`, `pages/Pipelines.tsx`, `pages/CompanySkills.tsx`, `pages/SystemNoticeUxLab.tsx`, `components/SidebarStarredProjects.tsx`, `components/SidebarAgents.tsx`, `components/SidebarProjects.tsx`, `components/SidebarAccountMenu.tsx`, `components/IssueChatThread.tsx`, `components/ArtifactsPanel.tsx`, `components/timeline/WorkTimelineChart.tsx`, `components/SidebarNavItem.tsx`, `components/Sidebar.tsx` |
+| **12px** | 25 | `pages/CompanySkills.tsx`, `pages/SystemNoticeUxLab.tsx`, `plugins/launchers.tsx`, `components/DocumentDiffModal.tsx`, `components/DevRestartBanner.tsx`, `components/IssueAssignedBacklogNotice.tsx`, `components/IssueBlockedNotice.tsx`, `components/JsonSchemaForm.tsx` |
+| **9px** | 13 | `pages/Secrets.tsx`, `pages/CompanySkills.tsx`, `components/AgentConfigForm.tsx`, `components/NewAgentDialog.tsx`, `components/OnboardingWizard.tsx`, `components/ActivityCharts.tsx`, `components/IssueFiltersPopover.tsx` |
+| **15px** | 9 | `pages/Pipelines.tsx`, `pages/PipelineSettings.tsx`, `pages/IssueDetail.tsx`, `components/IssueDocumentsSection.tsx`, `components/PipelineItemBodyDocument.tsx`, `components/routine-sections/editable-sections.tsx`, `components/IssueAttachmentsSection.tsx` |
+| **14px** | 4 | `components/IssueDocumentsSection.tsx`, `components/SourceResolvedFoldCallout.tsx`, `components/SystemNotice.tsx`, `components/IssueRecoveryActionCard.tsx` |
+
+**FLAGGED CLUSTER — near-duplicate micro type scale.** This is the single largest and most consequential drift cluster in the codebase. 9/10/11/12/13/14/15px are all used, frequently in the *same component* for what appears to be the same semantic role ("small metadata label" vs. Tailwind's own `text-xs` = 12px baseline, which would cover several of these already). Sidebars alone (`Sidebar.tsx`, `SidebarNavItem.tsx`, `SidebarAgents.tsx`, `SidebarProjects.tsx`, `SidebarStarredProjects.tsx`, `SidebarAccountMenu.tsx`) all independently use `text-[13px]`, suggesting one genuine shared intent ("sidebar row label size") implemented as six separate arbitrary values instead of one. **PRIOR-ART's drafted "9 named `.type-*` intent styles incl. `micro` 11px / `nano` 10px" (see PRIOR-ART.md) directly targets this cluster** — this audit confirms the cluster is still present at large scale (653 of the 730 sites are 10px or 11px alone) and is the strongest candidate for that scale decision. **Do not merge here** — verbatim-extract each occurrence's exact px value into its own token per DESIGN.md Phase 2 guardrails; the human scale-collapse step (README "after the run" step 2) is where 9/10/11/12/13/14/15 get resolved into a real scale.
+
+### 3.2 Letter-spacing — `tracking-[N em]` (202 sites)
+
+| Value | Count |
+|---|---:|
+| 0.18em | 67 |
+| 0.14em | 40 |
+| 0.16em | 38 |
+| 0.2em | 16 |
+| 0.12em | 12 |
+| 0.22em | 10 |
+| 0.08em | 10 |
+| 0.24em | 6 |
+| 0.1em | 3 |
+
+**FLAGGED CLUSTER** — 9 distinct tracking values across ~40 files, all in the 0.08–0.24em band (uppercase eyebrow/label letter-spacing, judging by co-occurrence with `text-[10/11px] uppercase` in the same class strings observed during sampling). Likely another case of "one intent, many literal values" — needs human collapse decision, not this run's job.
+
+### 3.3 Width/height/min/max — arbitrary bracket values
+
+`w-[...]`: 124 sites. `h-[...]`: 166 sites. `min-w/max-w/min-h/max-h-[...]`: 194 sites. Combined ~484 sites across roughly 90 files. Values are overwhelmingly **not near-duplicates of each other** in the way font-size is — they're bespoke per-surface panel/dialog/sidebar dimensions (`320px`, `220px`, `12rem`, `calc(100dvh-2rem)`, `85vh`, `var(--radix-popover-trigger-width)`, `var(--new-issue-dialog-height)`). A few small clusters worth flagging:
+
+- **`30px`** appears as both a `w-[30px]` (4 sites) and `h-[30px]` (7 sites) — likely a consistent "icon button" footprint; check if these should route through a `size-*` token instead of duplicated w/h pairs.
+- **`88px`** appears in both `w-[88px]` (2) and `h-[88px]` (4) — possibly the same avatar/tile footprint.
+- **`220px`** (`h-[220px]`, 9 sites) and **`120px`** (`h-[120px]`, 7 sites) recur across otherwise-unrelated components (dialog/panel min-heights) — candidate for a semantic "compact panel min-height" token but flagged, not merged.
+- `env(safe-area-inset-*)` and `var(--radix-*-trigger-width/height)` sites (≈15 total) are **not candidates for tokenization** — they reference runtime platform/library values, not design decisions; recommend allowlisting them explicitly rather than trying to wrap them in a token.
+
+Representative file hotspots: `pages/CompanySkills.tsx` (16 `h-[`, 3 `w-[`), `pages/Pipelines.tsx` (9 `h-[`, 8 `w-[`), `components/OnboardingWizard.tsx` (6 `h-[`), `pages/CompanyImport.tsx`/`CompanyExport.tsx` (5 each).
+
+### 3.4 Padding/margin — arbitrary bracket values (14 sites, small)
+
+Mostly platform-safe-area handling, not design values:
+- `pages/IssueDetail.tsx`, `components/MobileBottomNav.tsx`, `components/Layout.tsx` (×2), `components/RoutineRunVariablesDialog.tsx` — all `env(safe-area-inset-*)` — **recommend allowlisting**, not tokenizing (platform-derived, not a design value).
+- `components/ActivityFeed.tsx:p-[18px]`, `components/FeedCard.tsx:p-[18px]` — exact-duplicate 18px padding across 2 files, no token match — small clean mint candidate.
+- `components/ui/tabs.tsx:p-[3px]` — **stock shadcn value** (verified against current shadcn/ui registry — not local drift).
+- `components/IssueChatThread.tsx:p-[15px]`, `components/IssueChatThread.test.tsx:p-[15px]` — matched pair.
+- `components/IssueRow.tsx` — two `calc(theme(spacing.N)-2px)` expressions — these reference Tailwind's own spacing scale via `theme()`, arguably already "tokenized" in the loosest sense (derived from the Tailwind default scale, not a raw literal), but the `-2px` offset itself is a raw magic number. Flag for human review of intent.
+
+### 3.5 Radius — arbitrary bracket values (25 sites)
+
+| Value | Sites |
+|---|---|
+| `rounded-[28px]`, `rounded-[32px]`, `rounded-[24px]` | `pages/IssueChatUxLab.tsx`, `pages/ProfileSettings.tsx`, `pages/SystemNoticeUxLab.tsx`, `pages/InviteUxLab.tsx` (×6), `pages/CompanySettings.tsx` (`14px`) — all showcase/demo hero-card radii, no two pages agree on 24 vs 28 vs 32 |
+| `rounded-[8px]` | `components/artifacts/ArtifactCard.tsx` (+test), `components/artifacts/ArtifactGroupCard.tsx` (×3) — internally consistent within the artifacts family |
+| `rounded-[4px]` | `components/StatusBadge.tsx`, `components/ui/checkbox.tsx` (**stock shadcn value**, verified against registry) |
+| `rounded-br-[4px]` / `rounded-bl-[4px]` | `components/IssueChatThread.tsx` — chat-bubble corner-clip, intentional asymmetric radius (speech-tail effect) |
+| `rounded-[2px]` | `components/ui/tooltip.tsx` (**stock shadcn value** — tooltip arrow) |
+| `rounded-[inherit]` | `components/ui/scroll-area.tsx` (not a literal value — keyword, skip) |
+
+**Conflict with DESIGN.md — see section 6.** `--radius-lg` and `--radius-xl` are hard-set to `0px` in `index.css`'s `@theme inline` block, meaning every plain `rounded-lg` (188 uses) and `rounded-xl` (97 uses) class in the whole app currently renders **square, not rounded** — this is a live, current-state fact about the token layer itself, not a component-level drift issue, but it means the ~285 sites using `rounded-lg`/`rounded-xl` are silently at 0px and any future "fix" to those tokens will be a highly visible, non-zero visual change across most of the app.
+
+### 3.6 Shadow — arbitrary bracket values (38 sites, 21 files)
+
+Every value is a unique multi-stop `box-shadow` (drop shadows for hero cards, mostly `rgba(15,23,42,0.0X)` "cool black" tints at varying blur/spread). No two files share an identical shadow string except:
+- `shadow-[0_24px_60px_rgba(15,23,42,0.08)]` (5 sites) and `shadow-[0_30px_80px_rgba(15,23,42,0.10)]` (3 sites) — both cluster around UxLab hero cards.
+- `shadow-[0_-12px_28px_rgba(15,23,42,0.08)]` (3) and `shadow-[0_-12px_28px_rgba(0,0,0,0.28)]` (3) — same geometry, different color-mode tint (likely a light/dark pair that should have been expressed as one token with mode-aware color, not two separate arbitrary strings).
+- `shadow-[0_1px_0_rgba(15,23,42,0.02)]` (3), `shadow-[0_0_0_2px_hsl(var(--background))]` (3) — the latter is interesting: it already references a CSS var (`--background`) inside an arbitrary value rather than a literal, i.e. partially tokenized.
+
+Concentrated in: `pages/IssueChatUxLab.tsx`, `pages/RunTranscriptUxLab.tsx`, `pages/ProfileSettings.tsx`, `pages/InviteUxLab.tsx`, `pages/SystemNoticeUxLab.tsx`, `pages/AgentDetail.tsx`, `components/IssueThreadInteractionCard.tsx`, `components/ChatComposer.tsx`, `components/SourceResolvedFoldCallout.tsx`, `components/KeyboardShortcutsCheatsheet.tsx`, `components/LiveRunWidget.tsx`, `components/BudgetPolicyCard.tsx`, `components/BudgetSidebarMarker.tsx`, `components/SidebarNavItem.tsx`, `components/IssueRecoveryActionCard.tsx`, `components/environment-variables-editor/index.tsx`, `components/IssueChatThread.tsx`, `components/DocumentAnnotationLayer.tsx`, `components/CompanyPatternIcon.tsx`, `components/ActiveAgentsPanel.tsx`, `components/SystemNotice.tsx`.
+
+**Needs human decision** — no existing shadow tokens exist in `index.css` at all (zero `--shadow-*` custom properties defined); every one of these 38 arbitrary shadows needs a brand-new token, and given how few are exact duplicates, this is close to "38 tokens for 38 sites" unless a human collapses them by visual similarity first.
+
+### 3.7 Other bracket categories (small)
+
+- `top/left/right/bottom-[...]` (14 sites): mostly `env(safe-area-inset-*)`, `50%`/`-50%` dialog-centering (shared with the stock shadcn `dialog.tsx`/`alert-dialog.tsx` pattern — **not local drift**), and one `top-[1px]` (`components/EntityRow.tsx:53`) hairline-alignment nudge.
+- `z-[...]` (10 sites): `z-[1]`, `z-[2]`, `z-[9999]`, `z-[60]`, `z-[120]`, `z-[200]` — an ad hoc z-index scale with no documented tiers. **Flag**: no `--z-*` tokens exist; recommend a human-reviewed z-index scale decision, not in scope for this run's verbatim extraction beyond listing.
+- `scale-[0.98]` (4 sites, all `pages/Inbox.tsx`) — consistent value, single file, easy mint.
+- `blur-[2px]` (`components/IssueChatThread.tsx:3868`), `blur-[1px]` (`components/ChatComposer.tsx:253`) — 2 sites, 2 distinct values.
+- `stroke-[2.3]` (`components/MobileBottomNav.tsx:109`) — SVG stroke-width, singleton.
+
+---
+
+## 4. Inline `style={{ }}` literals (58 files contain `style={{`)
+
+Not every inline `style` is a hardcoded value — many pass through dynamic props (`style={{ width: size }}`). Filtering to literal-value cases:
+
+- **Project-color fallback pattern** (`backgroundColor: x.color ?? "#6366f1"` / `"#64748b"`) — see section 1.3, 14 sites, already counted there.
+- `components/AsciiArtAnimation.tsx:344` — `style={{ fontSize: "11px", fontFamily: "monospace" }}` — duplicates the 11px cluster (3.1) via inline style instead of Tailwind class; same value, different mechanism — worth noting Phase 2's codemod needs to handle both `text-[11px]` AND `fontSize: "11px"` forms.
+- `components/MarkdownBody.tsx:193,197` — `borderRadius: "calc(var(--radius) - 4px)"`, `fontSize: "0.7rem"` — the radius line already routes through the `--radius` token (good pattern, not drift); the `fontSize: "0.7rem"` (=11.2px) is a **new near-duplicate of the 11px cluster** in yet another unit (rem vs. px) — flag for the human scale decision.
+- `pages/CompanyEnvironments.tsx:422` — `fontSize: 12` (numeric, xterm.js option, third-party config — recommend allowlist).
+- `pages/CompanySkills.tsx:579` — `fontSize: Math.round(size * 0.42)` — computed at runtime from a prop, not tokenizable as a static value.
+- `components/WorktreeBanner.tsx:25` — `boxShadow: \`inset 0 -1px 0 ${branding.textColor}18\`` — dynamically computed from user branding color, not tokenizable.
+
+---
+
+## 5. Font-weight
+
+No raw numeric `font-weight:` or `fontWeight:` declarations were found in component/page source outside `index.css` itself (which has 6 legitimate `font-weight: 500/600/700` declarations inside `.paperclip-markdown`/`.paperclip-markdown-codeblock-action` rules — these are the token layer, not drift). All font-weight in components goes through Tailwind's built-in `font-medium`/`font-semibold`/`font-bold` classes, which is compliant with DESIGN.md (weight isn't a token gap here). **No action needed for font-weight.**
+
+---
+
+## 6. Conflicts with DESIGN.md
+
+1. **`--radius-lg` / `--radius-xl` are pinned to `0px`, and the base `--radius` is `0`, in the current `index.css`.** DESIGN.md principle 3 says "the final scale is a design decision made by a human after reviewing the token audit," implying the scale is still open — but the *current* values already silently zero out two full tiers of the radius scale sitewide (188 `rounded-lg` + 97 `rounded-xl` sites render square today). This isn't a conflict in the sense of a bug, but it does mean: (a) any component using `rounded-lg`/`xl` believing it gets a rounded corner is visually wrong today, and (b) `rounded-2xl`/`rounded-3xl` are NOT overridden (still Tailwind's stock 1rem/1.5rem), so the scale is non-monotonic as configured (`sm`=6px, `md`=8px, `lg`=0px, `xl`=0px, `2xl`=16px stock, `3xl`=24px stock) — a real inconsistency in the token file itself, not just in components. **Recorded here per DESIGN.md instruction to log conflicts rather than guess a fix.**
+2. **`agentStatusBadge` and `brandChipBadge` in `lib/status-colors.ts` are literal duplicate objects** (see 1.1) — this isn't a DESIGN.md violation per se (DESIGN.md doesn't forbid duplicate non-visual code), but it directly undercuts principle 1 ("one way to say each thing") and inflates the token-migration site count; flagged here since Phase 2's codemods will otherwise "fix" the same value twice under two different export names.
+3. **No `--shadow-*` tokens exist at all** in `index.css`, despite 38 arbitrary shadow values in components (3.6). DESIGN.md principle 2 lists "shadow" explicitly as a category that must route through tokens — today there is no token family for it to route through. Not a contradiction of DESIGN.md so much as a gap DESIGN.md anticipates Phase 2 will need to fill from scratch (mint, don't normalize).
+4. **Tailwind palette utility classes** (`bg-red-500`, `text-amber-600`, etc., 3,115 sites) are a form of hardcoded value DESIGN.md's principle 2 language ("no hex, no raw px") doesn't unambiguously cover — these aren't hex literals or raw px, they're named utility classes backed by Tailwind's *own* built-in oklch palette, entirely separate from `index.css`'s token values. Whether this counts as "in scope" for the zero-hardcoded-value gate is genuinely ambiguous from the text of DESIGN.md and is the single biggest scope question for Phase 2. **See "Needs human decision" below.**
+
+No other conflicts found — the rest of the codebase's approach (semantic tier for chrome, brand tier for agent/status colors, domain tier for chips/annotations) is followed consistently by the parts of the app that DO use tokens (e.g., `.status-chip`/`.status-fill` color-mix helpers, `.paperclip-mdxeditor` CSS-var bridge).
+
+---
+
+## 7. Off-limits / out-of-scope areas
+
+- No `ui/src/components/theme-editor/` directory exists on this branch (confirmed via `find`) — KNOWN-DUPLICATES.md's off-limits note is currently moot here but preserved for when/if that code lands.
+- No playground/experimental-theme paths found under `ui/src/` on this branch.
+- Everything outside `ui/` (server, adapters framework config, CLI) is out of scope and was not scanned.
+- `ui/storybook/` was inventoried only for the Phase-0 baseline-scope question (existing stories), not scanned for hardcoded values — it is fixture/test infrastructure, not shipped product UI.
+
+---
+
+## 8. Needs human decision (required section)
+
+1. **Tailwind palette-class scope question** — are `bg-red-500`-style classes (3,115 sites / 145 files) in scope for Phase 2 token extraction? This is the largest single decision blocking Phase 2's actual size estimate. Recommend a separate, explicit ruling before Phase 2 starts, since it 10x's the mechanical work if in-scope.
+2. **Micro type-size cluster (9/10/11/12/13/14/15px, 730+ sites)** — do not merge; this audit only inventories. PRIOR-ART's drafted 9-style `.type-*` system (incl. `micro`/`nano`) is the leading candidate for the eventual collapse decision. Needs a human to pick the real scale.
+3. **Letter-spacing cluster (0.08–0.24em, 9 distinct values, 202 sites)** — same treatment as #2; no scale currently exists to collapse into.
+4. **Radius token conflict (`--radius-lg`/`-xl` = 0px while `2xl`/`3xl` are untouched Tailwind stock)** — is the 0px lg/xl a deliberate brand choice (square corners) that should be preserved as-is, or a regression that should be fixed as part of the eventual radius-scale decision? PRIOR-ART's drafted scale (`sm 6 / md 8 / lg 10 / xl 14 / 2xl 16 / full`) assumes non-zero lg/xl — reconciling that draft with the current 0px reality is a human call.
+5. **Project-color fallback duplication** (`#6366f1` indigo vs `#64748b` slate, 14 sites, section 1.3) — one token or two? File-level pattern suggests two distinct intents (new-project seed color vs. no-project-assigned muted slate) but this needs confirmation from whoever owns that UI, not an inference from this audit.
+6. **`agentStatusBadge` vs `brandChipBadge` literal duplicate maps** (`lib/status-colors.ts`) — collapse to one export? This is a code-dedup call, adjacent to but not strictly a token-value question; flagged here because it changes Phase 2's site count.
+7. **One-off decorative gradients/shadows on production surfaces** (Dashboard, Costs, AccountingModelCard, SidebarAccountMenu, BudgetIncidentCard — section 2; all of section 3.6) — mint ~20 bespoke, never-reused tokens (satisfies the letter of "tokens are the only source of visual values") or add a documented allowlist entry for "intentional one-off decoration" (satisfies the spirit of not inflating the token file with singletons)? DESIGN.md permits allowlisting "third-party overrides" but these are first-party decorative choices, so the allowlist criteria need a human ruling on whether it stretches to cover them.
+8. **Chart color palettes disagree with the canonical status system** — `ActivityCharts.tsx`'s per-status hex map does not match `lib/status-colors.ts`'s hue mapping (e.g. `in_progress` renders violet-ish in the chart, blue in chips/icons elsewhere). Is this an intentional "charts get their own palette" design decision, or drift that should eventually re-point at `--status-task-*`? Flagging only — not resolving, per DESIGN.md's out-of-scope "no visual redesign" rule.
+9. **Contrast-pair triplication** (`color-contrast.ts`, `worktree-branding.ts`, `ThemeContext.tsx` all define their own light/dark text or theme-color hex pairs, section 1.2) — candidates for one shared constant, but each has slightly different call-site semantics (WCAG contrast math vs. `<meta theme-color>` vs. branding fallback); needs a human to confirm they're actually meant to be identical before consolidating.
+10. **Test-file hardcoded values (56 hex sites, plus proportional shares of the other categories)** — Phase 2's codemods will need a policy on whether test files get rewritten in lockstep with the components they assert against, or left alone (asserting against literal values that no longer appear verbatim in source once tokenized). Not addressed here since DESIGN.md's Phase 2 spec is silent on test files.
+
+---
+
+## Phase 2 extraction log — Batch 1 (colors)
+
+Codemod: `scripts/codemod-extract-colors.mjs` (table-driven, idempotent — see script header for rationale on why a blind hex-regex sweep was rejected: it false-positives on strings like `acme/web#241` and `React #10140`). Scope: `ui/src/components/**` and `ui/src/pages/**`, including `*.test.tsx` companions, color literals only (hex / rgb / rgba / hsl / hsla / oklch). Shadow-embedded colors (`shadow-[...rgba(...)...]`) were explicitly left untouched per the batch mandate (Batch 3's job).
+
+**Sites rewritten:** 69, across 31 files (30 component/page files + 1 test file, `IssueChatThread.test.tsx`, whose assertion string was updated in lockstep with the component it tests).
+
+**Tokens minted: 41 new + 2 existing reused.**
+- New verbatim tokens: 17 `--hex-*` (independent-palette status dots/priority/chart colors + the two project-color-fallback families) + 24 `--gradient-extract-*` (one per distinct gradient string; all 24 are pixel-verbatim, none normalized — two pairs of sites shared an identical gradient string and reused the same token: `--gradient-extract-9` used at IssueChatUxLab.tsx:139 + InviteUxLab.tsx:700; `--gradient-extract-10` at IssueChatUxLab.tsx:203 + InviteUxLab.tsx:909).
+- Reused existing tokens (exact case-insensitive match, mode-independent — no `.dark` override in index.css for either): `#2563EB` → `var(--status-task-in_progress)` (IssueChatThread.tsx "Liveness blue" bubble); `#22c55e` → `var(--status-task-done)` (was not actually hit by a component site in this batch's table — flagged as available for Batch 2+ if a matching site turns up; the number above counts sites where a REUSE mapping fired, which was only the `#2563EB` family, at 2 sites: component + test assertion).
+- All new tokens and the allowlist doc-comment live in a single non-`@theme` `:root { ... }` block appended to `ui/src/index.css`, headed `/* ── Extracted verbatim tokens (Phase 2, design/token-extraction) ── */`, per DESIGN.md (runtime-tunable, not baked into `@theme inline`).
+
+**Sites allowlisted (8 files, inline `token-extraction: allowlisted` comment at each site) — functional/third-party, converting would change behavior, not just pixels:**
+1. `pages/CompanyEnvironments.tsx` — xterm.js terminal theme option object (`background`/`foreground`/`cursor`/`cursorAccent`/`selectionBackground`); third-party config consumed by the terminal library, not rendered CSS.
+2. `pages/CompanySettings.tsx` — `<input type="color">` value; the DOM color-picker control requires a real hex string.
+3. `components/issue-properties/IssueProperties.tsx` — `newLabelColor` picker-seed state, persisted into the label-create payload sent to the backend.
+4. `pages/CompanySkills.tsx` — `DISCOVERY_ACCENTS` palette array; `skillAccentColor()`'s return value is written into `SkillCreateDraft.color` (persisted/compared data), not just used as a rendered value.
+5. `components/IssueColumns.tsx` — `accentColor` fallback also feeds `pickTextColorForPillBg()` contrast math (from `lib/color-contrast.ts`), which needs a real hex string to compute luminance.
+6. `components/CompanyPatternIcon.tsx` — canvas 2D `fillStyle` built from a runtime-computed template literal (`rgb(${r} ${g} ${b})`), not a static literal at all (excluded from the site table for this reason, not just allowlisted).
+7. `components/FileViewerSheet.tsx` — `bg-[var(--paperclip-code-highlight-bg,rgba(250,204,21,0.12))]` / `border-[var(--paperclip-code-highlight-border,rgb(234,179,8))]` — a half-migrated `var(--x, fallback)` pattern where `--paperclip-code-highlight-bg`/`-border` don't exist in `index.css` yet (see section 2 above). Left alone rather than guessed at, since minting the var changes the semantics of an existing fallback expression rather than being a 1:1 literal swap — flagged below as "Needs human decision."
+8. `pages/InviteUxLab.tsx` — `brandColor="#114488"` (×2, demo/showcase page) feeds `CompanyPatternIcon`'s `hexToHue()` color math via the same canvas-fill code path as #6, not a rendered CSS value.
+
+**Verify results:** `rg` gate clean (zero hex/rgb/hsl/oklch literals in Tailwind class strings or inline styles in `ui/src/components/**` / `ui/src/pages/**` outside the 8 allowlisted files); `pnpm build-storybook` exit 0; Storybook visual snapshot suite **510/510 passed, 0 failed** (`npx playwright test --config tests/storybook-visual/playwright.config.ts`); `pnpm typecheck` exit 0.
+
+**Bug caught and fixed during verification (documented for future batches):** the first codemod pass minted gradient tokens by copying Tailwind's bracket-arbitrary-value syntax verbatim, including underscore-for-space escaping (e.g. `radial-gradient(circle_at_top,...)`). That escaping is Tailwind's own class-name convention — real CSS custom properties are not parsed the way Tailwind parses bracket values, so `circle_at_top` inside a `--gradient-extract-N` declaration is invalid `radial-gradient()` syntax and the browser drops the whole background-image. Caught by the Playwright visual suite (`ux-labs-converted-test-pages--invite-and-access-flow [light]` failed, 6% pixel diff, dark hero panel rendered as plain gray). Fixed by converting all underscores back to literal spaces in the 24 gradient token values before re-running. This is now a standing gotcha for Batches 2-4: any bracket-value string being lifted into a CSS custom property must have Tailwind's `_`→` ` escaping reversed first.
+
+**Needs human decision (new, from this batch):**
+- `components/FileViewerSheet.tsx`'s `--paperclip-code-highlight-bg`/`-border` half-migrated var-with-fallback pattern (allowlist item 7 above) — TOKEN-AUDIT.md section 2 already recommended "this becomes the actual token"; this batch deliberately did NOT act on that recommendation because defining the var changes what `var(--x, fallback)` resolves to structurally (from "always the literal fallback" to "the var if defined, else the fallback") even though the *value* would be identical today — a human should confirm this is the intended direction before Batch 2+ touches it, alongside the sibling `--paperclip-code-bg`/`--paperclip-code-gutter-fg` vars in the same file that use `theme(colors.muted...)` fallbacks (out of scope for colors, relevant to a future spacing/type batch).
+- The `#2563EB` reuse (`IssueChatThread.tsx`'s "Liveness blue" chat bubble → `--status-task-in_progress`) is a **semantic coincidence**, not a designed relationship — the original code comment explicitly called it "Liveness blue" independently of the task-status system. Batch 1 reused the token per the exact-match rule, but a human should confirm a chat-bubble liveness color is supposed to be permanently coupled to the task `in_progress` status hue going forward (if a future redesign changes one, does the other move too?).
+
+---
+
+## Phase 2 extraction log — Batch 2 (type)
+
+Codemod: `scripts/codemod-extract-type.mjs`. Unlike Batch 1's hand-audited site table (needed to avoid hex-like false positives such as issue references), this batch's patterns — `text-[Npx]`/`text-[N.Nrem]` Tailwind font-size, `tracking-[N em]` letter-spacing, `leading-[...]` line-height, and `fontSize: "Npx"`/`fontSize: "N.Nrem"` inline-style string literals — are unambiguous, so the codemod does a blanket regex sweep scoped to `ui/src/components/**` and `ui/src/pages/**` (including `*.test.tsx` companions; a full scan found **zero** test files containing any of these patterns, so no test file needed a lockstep update this batch). Verified idempotent (second run: 0 sites, 0 files changed).
+
+**Sites rewritten: 932**, across 143 files.
+- Font-size Tailwind class utilities (`text-[Npx]`): 728 sites (matches TOKEN-AUDIT.md section 3.1's count almost exactly — 730 vs. 728, negligible drift from audit-vs-extraction timing). No rem-unit or line-height-suffixed (`text-[N]/[N]`) forms were found in class strings; none existed to convert.
+- Letter-spacing (`tracking-[N em]`): 202 sites, matching TOKEN-AUDIT.md section 3.2 exactly (9 distinct values).
+- `leading-[...]` line-height brackets: 0 sites found (confirmed via full sweep; TOKEN-AUDIT.md did not call this out as a populated cluster either).
+- Inline-style `fontSize` string literals: 2 sites — `components/AsciiArtAnimation.tsx:344` (`fontSize: "11px"`, reused the same `--fs-11` token minted by the class-based sites — no duplicate) and `components/MarkdownBody.tsx:197` (`fontSize: "0.7rem"`, new rem-unit token).
+
+**Tokens minted: 17 new** (0 reused from Batch 1 — font-size/letter-spacing/line-height had no prior tokens to match against).
+- 8 `--fs-*` (font-size): `--fs-9`, `--fs-10`, `--fs-11`, `--fs-12`, `--fs-13`, `--fs-14`, `--fs-15` (px, one per distinct value found) + `--fs-0_7rem` (0.7rem, `MarkdownBody.tsx`'s inline style — kept in rem per DESIGN.md "no normalizing/unit-converting" rule, NOT collapsed into the 11px-ish px cluster even though 0.7rem ≈ 11.2px).
+- 9 `--ls-*` (letter-spacing): `--ls-0_08`, `--ls-0_1`, `--ls-0_12`, `--ls-0_14`, `--ls-0_16`, `--ls-0_18`, `--ls-0_2`, `--ls-0_22`, `--ls-0_24` — one per distinct em value, matching TOKEN-AUDIT.md 3.2's 9-value cluster exactly.
+- 0 `--lh-*` (line-height) — no sites required one; the token-registration code path exists in the codemod (and was exercised in the Step 0 syntax spike) for forward-compatibility but minted nothing this batch.
+- All new tokens live in a second non-`@theme` `:root { ... }` block appended to `ui/src/index.css` immediately after Batch 1's color block, headed `/* ── Extracted verbatim TYPE tokens (Phase 2 Batch 2, design/token-extraction) ── */`, per DESIGN.md (runtime-tunable). **No normalizing performed** — 9/10/11/12/13/14/15px and the 9 distinct tracking values all remain distinct tokens; the human scale-collapse decision (TOKEN-AUDIT.md "Needs human decision" #2/#3, PRIOR-ART's draft `.type-*` scale) is explicitly deferred, per mandate.
+
+**Tailwind v4 rewrite forms used** (confirmed via mandatory Step-0 syntax spike — scratch story + `pnpm build-storybook` + grep of emitted CSS, then deleted before the real codemod ran):
+- `text-[11px]` → `text-(length:--fs-11)` — emits `font-size:var(--fs-11)`. The `length:` hint is REQUIRED; a bare `text-(--fs-11)` would be interpreted as a color utility.
+- `tracking-[0.18em]` → `tracking-(--ls-0_18)` — emits `--tw-tracking:var(--ls-0_18);letter-spacing:var(--ls-0_18)`. Unambiguous, no hint needed.
+- `leading-[...]` (numeric/unit forms only) → `leading-(--lh-*)` — verified to emit `--tw-leading:var(--lh-*);line-height:var(--lh-*)` in the spike; not exercised on a real site since 0 sites existed.
+- All variant/modifier prefixes preserved verbatim by construction (the regex only rewrites the bracket portion): confirmed sites include `sm:text-[11px]` (`components/BlockedReasonChip.tsx`), a compound arbitrary-variant `group-data-[size=xs]/avatar:text-[10px]` (`components/ui/avatar.tsx`), and an `!important`-marked bracket-selector `[&>span:last-child]:!text-[11px]` (`components/ActiveAgentsPanel.tsx`) — all rewrote correctly to `sm:text-(length:--fs-11)`, `group-data-[size=xs]/avatar:text-(length:--fs-10)`, and `[&>span:last-child]:!text-(length:--fs-11)` respectively.
+
+**Sites allowlisted (2 sites, both already covered by Batch 1's allowlist doc-comment structure for their files, no new inline comments needed since neither is a bracket-literal or class-string site):**
+1. `pages/CompanyEnvironments.tsx:422` — `fontSize: 12` inside the xterm.js terminal theme option object (same object Batch 1 allowlisted for its color literals). Numeric, functional third-party config — not a rendered CSS value, not a string literal the codemod's regex targets.
+2. `pages/CompanySkills.tsx:580` — `fontSize: Math.round(size * 0.42)` — computed at runtime from a prop; not a static literal, nothing to extract.
+
+**Verify results:**
+- `rg` gates clean in `ui/src/components/**` / `ui/src/pages/**`: zero `text-[Npx]`/`text-[N.Nrem]` arbitrary font-size, zero `tracking-[N em]`, zero numeric `leading-[...]`, zero raw `fontSize: "..."` string literals remain (the only two `fontSize:` string-literal grep hits left are the already-converted `fontSize: "var(--fs-11)"` / `fontSize: "var(--fs-0_7rem)"` sites).
+- `pnpm build-storybook` exit 0.
+- Storybook visual snapshot suite: **510/510 passed, 0 failed**, first attempt, no retries needed (`npx playwright test --config tests/storybook-visual/playwright.config.ts --reporter=line`).
+- `pnpm typecheck` exit 0.
+- Codemod re-run confirmed idempotent: second invocation reports 0 sites rewritten, 0 files changed, token block already present.
+
+**Needs human decision:** none new from this batch beyond the already-logged #2 (micro type-size cluster) and #3 (letter-spacing cluster) in section 8 above — this batch's 17 minted tokens are exactly the verbatim inventory those two items describe, now materialized as CSS custom properties ready for a human to collapse into a real scale.
+
+---
+
+## Phase 2 extraction log — Batch 3 (sizes/spacing/radius/shadows)
+
+Codemod: `scripts/codemod-extract-sizes.mjs`. Blanket regex sweep (like Batch 2 — these bracket-utility families are unambiguous), scoped to `ui/src/components/**` and `ui/src/pages/**` including `*.test.tsx` companions. Covers `w-[...] h-[...] size-[...] min-w/max-w/min-h/max-h-[...]`, `p*/m*-[...]`, `gap-[...]`/`gap-x/y-[...]`, `inset/inset-x/inset-y/top/left/right/bottom-[...]`, `translate-x/y-[...]`, `rounded-[...]` (incl. directional `rounded-t/r/b/l/tl/tr/bl/br-[...]`), `shadow-[...]`, `ring-[...]`, `outline-[...]`. Verified idempotent (second run: 0 sites, 0 files changed).
+
+**Sites rewritten: 407**, across 140 files (127 component/page files + 13 test files rewritten in lockstep: `ChatComposer.test.tsx`, `FileViewerSheet.test.tsx`, `IssueChatThread.test.tsx`, `IssueFiltersPopover.test.tsx`, `IssueSiblingNavigation.test.tsx`, `MarkdownBody.test.tsx`, `MarkdownEditor.test.tsx`, `NewIssueDialog.test.tsx`, `RoutineRunVariablesDialog.test.tsx`, `SidebarAccountMenu.test.tsx`, `artifacts/ArtifactCard.test.tsx`, `Agents.test.tsx`, `IssueDetail.test.tsx`).
+
+**Tokens minted: 163 new** (127 `--sz-*` + 8 `--rad-*` + 5 `--pct-*` + 23 `--shadow-extract-*`; 0 reused from Batches 1-2 — no existing size/radius/shadow tokens existed to match against, and DESIGN.md/TOKEN-AUDIT.md section 6.3 already noted zero `--shadow-*` tokens existed pre-Phase-2).
+- **`--sz-*` (127 tokens)** — ONE shared family across width/height/min/max, padding/margin, gap, inset/top/left/right/bottom, and translate, so identical literal values dedupe regardless of which property used them (e.g. a `220px` used as both `h-[220px]` and `w-[220px]` in different files collapses to one `--sz-220px`). Includes:
+ - 85 simple numeric length tokens (`--sz-320px`, `--sz-18rem`, `--sz-85vh`, `--sz-24ch`, etc. — px/rem/em/vh/vw/dvh/dvw/ch units, verbatim, no rounding).
+ - 42 `--sz-calc-N` tokens for `calc()`/`min()`/`max()`/`clamp()` compound expressions (sequentially numbered since content isn't safely nameable); 2 sites reused an existing `--sz-calc-N` where the exact string recurred (`min(calc(100dvh - 2rem),42rem)`-style forms did not recur verbatim, but `theme(spacing.N)` resolution below did feed distinct calcs — no cross-file duplicate calc strings were found this batch).
+ - 2 `--sz-safe-*` tokens (`--sz-safe-top`, `--sz-safe-bottom`) for bare `env(safe-area-inset-*)` forms with no arithmetic — `Layout.tsx`, `MobileBottomNav.tsx`. `env()` forms MIXED into a `calc()`/`min()`/`max()` (e.g. `calc(5rem+env(safe-area-inset-bottom))`, `max(1rem,env(safe-area-inset-top))`) were folded into the `--sz-calc-N` family instead, verbatim (`env()` is valid inside a runtime custom property — confirmed in the Step 0 spike).
+- **`--rad-*` (8 tokens)** — shared across radius, ring-width, and outline-width (`--rad-2` through `--rad-32`, bare-number naming to match Batch 1/2's `--fs-11`-style convention since every site here used px). Two directional-radius sites (`IssueChatThread.tsx`'s `rounded-br-[4px]`/`rounded-bl-[4px]` speech-tail corners) reuse the same `--rad-4` token minted from `StatusBadge.tsx`'s bare `rounded-[4px]`.
+- **`--pct-*` (5 tokens)** — `--pct-50`, `--pct-72`, `--pct-85`, `--pct-90` (bare percentages) + `--pct-neg-50` (kept as a DISTINCT token from `--pct-50`, not a negated reference, because the source bracket already carries the minus sign inside the value itself — `translate-x-[-50%]`, not `-translate-x-[50%]` — confirmed via the Step 0 spike that both the `-utility-(--x)` prefix-negation form AND a literal negative-value token both compile correctly, and the codebase's actual sites are all the latter form).
+- **`--shadow-extract-*` (23 tokens)** for 38 sites (dedup: `--shadow-extract-15` = `0 24px 60px rgba(15,23,42,0.08)` reused at 5 sites; `--shadow-extract-17` = `0 30px 80px rgba(15,23,42,0.10)` reused at 3 sites — matching the two clusters TOKEN-AUDIT.md section 3.6 flagged). Underscore-to-space reversal applied to every shadow value per Batch 1's gradient gotcha, generalized (`shadow-[0_0_0_2px_hsl(var(--background))]` → `0 0 0 2px hsl(var(--background))`). Two sites are `dark:` variant pairs sharing the same base shadow token family but pointing at different tokens (`ChatComposer.tsx`/`IssueChatThread.tsx`/`ChatComposer.test.tsx`: light `shadow-(--shadow-extract-4)`, `dark:shadow-(--shadow-extract-5)`).
+- All new tokens live in a third non-`@theme` `:root { ... }` block appended to `ui/src/index.css` immediately after Batch 2's type block, headed `/* ── Extracted verbatim SIZE/SPACING/RADIUS/SHADOW tokens (Phase 2 Batch 3, design/token-extraction) ── */`, per DESIGN.md (runtime-tunable).
+
+**var()-only passthrough (11 sites, 0 new tokens minted per DESIGN.md's special case)** — bracket values that only wrap a runtime library/component variable are rewritten straight to the bare paren form with no token mint: `w-[var(--radix-popover-trigger-width)]` → `w-(--radix-popover-trigger-width)` (`SearchableSelect.tsx` ×1, `OnboardingWizard.tsx` ×1, `AgentConfigForm.tsx` ×3), `h-[var(--radix-select-trigger-height)]` / `min-w-[var(--radix-select-trigger-width)]` → same form (`ui/select.tsx` ×2), `h-[var(--new-issue-dialog-height)]` / `max-h-[var(--new-issue-dialog-height)]` → same form (`NewIssueDialog.tsx` ×2, `NewIssueDialog.test.tsx` ×2 in lockstep).
+
+**`theme(spacing.N)` resolution (`components/IssueRow.tsx`, 3 sites)** — `theme()` is a Tailwind build-time function and does not work inside a runtime CSS custom property. Resolved using Tailwind v4's default `--spacing: 0.25rem` base (confirmed no `--spacing` override exists in `index.css`, and the BUILT CSS for these exact classes was inspected before the codemod ran: `padding-left:calc(.5rem - 2px)` / `calc(.25rem - 2px)` for `theme(spacing.2)`/`theme(spacing.1)` respectively, and a plain `margin-left:1.25rem` for the fully-constant `theme(spacing.3)+theme(spacing.2)` expression). Minted as `--sz-calc-11: calc(0.5rem - 2px)`, `--sz-calc-12: calc(0.25rem - 2px)`, `--sz-calc-13: calc(0.75rem + 0.5rem)` — byte-equivalent computed output verified via headless-browser spike (`6px`/`4px`/`1.25rem` respectively, matching the pre-codemod built CSS exactly).
+
+**Sites allowlisted / intentionally skipped (2 items):**
+1. `components/ui/scroll-area.tsx` — `rounded-[inherit]` is a CSS **keyword**, not a literal value; the codemod explicitly detects and skips it (no rewrite, no token). Documented in the `index.css` block comment.
+2. `components/CompanyPatternIcon.tsx` — `drop-shadow-[0_1px_2px_rgba(0,0,0,0.65)]` is a **different Tailwind utility** (`drop-shadow`, a CSS `filter` function) than the batch mandate's `shadow-[...]` (`box-shadow`) pattern; left untouched as out of the batch's explicit scope (TOKEN-AUDIT.md section 3.6 also only inventoried `shadow-[...]`, not `drop-shadow-[...]`) — flagged here for a future batch or human decision on whether `drop-shadow` should be folded into the same `--shadow-extract-*` family or get its own.
+
+**BOUNDARY BUG caught and fixed during this batch (documented for future batches):** the first codemod pass used a bare `\b` word-boundary regex for `top/left/right/bottom-[...]`, which false-positived on Tailwind's own compound animation utilities `slide-out-to-top-[1%]` / `slide-in-from-top-[1%]` (`components/ui/dialog.tsx`, `components/ui/alert-dialog.tsx`) — `\b` matches at the `-to-top` boundary since `-` is not a word character, so the regex silently corrupted `slide-out-to-top-[1%]` into `slide-out-to-top-(--pct-1)`, which Tailwind does not recognize as the `slide-out-to-top-*` utility at all (a real, silent visual/behavioral regression, not just a naming nit — caught by manual inspection before the Playwright run, not by the snapshot suite itself, since the corrupted form simply drops the animation rather than changing a static rendered pixel in a way the frozen-time/reduced-motion snapshot harness would catch). Fixed by requiring the utility name to start at a genuine class-token boundary (preceded by whitespace, a quote/backtick, template-literal `${`, colon `:` for variant prefixes, or start-of-string) rather than a bare `\b`.
+
+**CALC-SPACING BUG caught and fixed during this batch (second gotcha, generalizing Batch 1's underscore lesson):** two distinct spacing problems in calc() expressions, both caught via the Step 0 spike and a subsequent live headless-browser check:
+1. `calc(100%-2rem)`-style brackets (NO space around the operator at all, not even underscore-escaped) are syntactically INVALID once lifted verbatim into a CSS custom property — a headless-browser test confirmed `calc(100%-2rem)` silently drops (computed value falls back to the containing block's own size) while `calc(100% - 2rem)` computes correctly. Fixed with a `normalizeCalcSpacing()` helper that inserts spacing around top-level `+`/`-` operators.
+2. The first version of that helper was too broad (matched any letter-hyphen-letter sequence) and corrupted `env(safe-area-inset-bottom)` into `env(safe - area - inset - bottom)` inside `calc(1.5rem+5rem+env(safe-area-inset-bottom))` — caught via manual `grep`/inspection of the generated token block before the Playwright run (the malformed token would have made the whole value invalid, again a silent drop rather than a pixel diff the snapshot suite would flag directly, though it likely would have surfaced as a layout diff on `ScrollToBottom.tsx`'s stories). Fixed by narrowing the operator-spacing regex to only fire when the LEFT side is a number/number-with-unit/closing-paren and the RIGHT side is a number or the start of a known CSS value-function call (`env(`, `var(`, `calc(`, `min(`, `max(`, `clamp(`) — this excludes any hyphen sitting between two bare identifier characters.
+
+**COMMENT-SYNTAX BUG caught and fixed during this batch (third gotcha, new category — a lesson for future codemods' generated CSS comments, not the token values themselves):** the codemod's own generated `index.css` doc-comment originally read "`--rad-* is likewise shared across rounded-*/ring/outline widths.`" — the literal two-character sequence `*/` inside "rounded-\*/ring" prematurely closed the enclosing CSS block comment, and everything from that point to the real intended `*/` several lines later was parsed as raw (garbled, non-declaration) CSS. This didn't just corrupt the comment — it desynced the CSS parser badly enough that the ENTIRE Batch 3 `:root { ... }` token block (all 163 tokens) was silently dropped from the compiled Storybook CSS, while the hundreds of `var(--sz-*)`/`var(--rad-*)` REFERENCES in component class names still compiled fine (Tailwind generates utility classes independent of whether the referenced custom property is actually declared anywhere) — so every `--sz-*`/`--rad-*`/`--pct-*`/`--shadow-extract-*` reference resolved to nothing (`unset`, i.e. `0` for lengths), which is what produced the initial 222-test Playwright failure (all length/radius/shadow values silently collapsing to their initial/zero value). Caught by: (a) the Playwright run failing far more broadly than a mechanical rename should cause, (b) isolating a single-file change that passed in isolation but failed in the full batch, (c) directly querying `getComputedStyle(...).marginTop` in a live headless-browser session against the built Storybook static output, which showed `0px` instead of the expected `7px`, and (d) a manual `/*`/`*/` balance count over the generated CSS block, which found the block was one `*/` short of balanced. Fixed by rephrasing the comment to avoid a bare `*/`-forming substring ("rounded, ring, and outline widths" instead of "rounded-\*/ring/outline widths") and adding an inline guard-comment in the codemod script itself warning future editors never to let generated CSS-comment prose contain a literal `*/` sequence.
+
+**Verify results:**
+- `rg` gates clean in `ui/src/components/**` / `ui/src/pages/**`: zero remaining `w-[...]/h-[...]/size-[...]/min-w-[...]/max-w-[...]/min-h-[...]/max-h-[...]`, zero `p*/m*-[...]`, zero `gap-[...]`/`gap-x/y-[...]`, zero `inset/inset-x/inset-y/top/left/right/bottom-[...]` (except Tailwind's own `slide-out-to-top-[1%]`/`slide-in-from-top-[1%]` compound utilities, which are NOT this batch's target pattern), zero `translate-x/y-[...]`, zero `rounded*-[...]` (except the documented `rounded-[inherit]` keyword skip), zero `shadow-[...]` (except the out-of-scope `drop-shadow-[...]` noted above), zero `ring-[...]`, zero `outline-[...]`.
+- `pnpm build-storybook` exit 0.
+- Storybook visual snapshot suite: **510/510 passed** on the final verification run (509 passed clean + 1 known-benign flaky retry — `product-documents-annotations--integrated-desktop-open [dark]`, the exact flake called out in the batch mandate as expected-benign — passed on Playwright's automatic retry, exit code 0). An earlier run with the COMMENT-SYNTAX BUG present failed 222/510 (all attributable to the single root cause above, not 222 independent regressions); after the fix, first clean re-run passed 510/510 with zero retries needed, and the final verification run (rebuilt from scratch a second time) reproduced the single known-benign flaky retry only.
+- `pnpm typecheck` exit 0.
+- Codemod re-run confirmed idempotent: second invocation reports 0 sites rewritten, 0 files changed, token block already present.
+
+**Needs human decision (new, from this batch):**
+- **`drop-shadow-[...]` vs `shadow-[...]` token family** (`components/CompanyPatternIcon.tsx`, 1 site) — should `drop-shadow` values share the `--shadow-extract-*` family this batch minted, or get their own `--drop-shadow-extract-*` family? Left untouched this batch since TOKEN-AUDIT.md section 3.6 only inventoried `box-shadow` (`shadow-[...]`) sites, and the mission mandate for this batch was explicitly `shadow-[...]` only.
+- **`theme(spacing.N)` resolution direction** (`components/IssueRow.tsx`) — this batch resolved `calc(theme(spacing.N)±Mpx)` to its Tailwind-v4-default-scale rem equivalent (verbatim, byte-equivalent verified) rather than leaving it as a build-time-only expression. If a future change to Tailwind's `--spacing` base ever happens, these 3 tokens will silently stop tracking that base (since they're now baked rem literals, not `theme()` calls) — a human should confirm this is the intended tradeoff, or decide these 3 sites should instead reference the Tailwind spacing scale by a different mechanism.
+- **`--pct-neg-50` vs prefix-negation form** — this batch mints distinct positive/negative percentage tokens (`--pct-50` / `--pct-neg-50`) rather than using Tailwind's `-utility-(--x)` prefix-negation shorthand, because every negative-percentage site in this codebase already carries the minus sign inside the bracket value itself (`translate-x-[-50%]`), not as a separate utility-level negation (`-translate-x-[50%]`). A human doing the eventual scale-collapse pass should be aware both forms exist in Tailwind v4 and this codebase consistently uses the former.
+
+---
+
+## Phase 2 extraction log — Batch 4 (final sweep + gates)
+
+Codemod: `scripts/codemod-extract-misc.mjs`. Blanket regex sweep (same style as Batches 2-3 — these remaining bracket-utility families are unambiguous), scoped to `ui/src/components/**` and `ui/src/pages/**` including `*.test.tsx` companions. Covers `grid-cols-[...]`/`grid-rows-[...]`, `transition-[...]`, `z-[...]`, `scale-[...]`, `ease-[...]`, `align-[...]`, `stroke-[...]`, `blur-[...]`/`backdrop-blur-[...]`, `drop-shadow-[...]`, `bg|text|border-[var(--x)]` (with and without a `,fallback`), and — discovered during this batch's own bracket sweep, not in the original task list — 2 `bg-[linear-gradient(...)]` sites that Batch 1's hand-audited color-literal table did not catch (see "scope correction" below). Verified idempotent (second run: 0 sites, 0 files changed).
+
+**MANDATORY STEP 0 SYNTAX SPIKE (scratch stories + `pnpm build-storybook` + grep of emitted CSS, deleted before the real codemod ran):** every paren form in the batch mandate was confirmed byte-equivalent before any component was touched:
+- `grid-cols-(--gtc-N)` with a multi-part track list containing `minmax()` → `grid-template-columns:var(--gtc-N)`. Confirmed.
+- `transition-(--tp-N)` → `transition-property:var(--tp-N)` (plus the timing-function/duration vars Tailwind always emits alongside). Confirmed it sets `transition-property`, not some other longhand.
+- `z-(--z-N)` → `z-index:var(--z-N)`. Confirmed.
+- `scale-(--s-N)` → `scale:var(--s-N)`. Confirmed.
+- `ease-(--e-N)` → `transition-timing-function:var(--e-N)` (and `--tw-ease`). Confirmed.
+- `align-(--va-N)` → `vertical-align:var(--va-N)`. Confirmed.
+- `stroke-(length:--sw-N)` → `stroke-width:var(--sw-N)`. Confirmed the `length:` hint is REQUIRED — a bare `stroke-(--x)` would be ambiguous with the `stroke` COLOR utility, same reasoning as Batch 3's `ring`/`outline` hint requirement.
+- `backdrop-blur-(--blur-N)` → `--tw-backdrop-blur:blur(var(--blur-N))`. Confirmed (spiked separately after discovering the batch's 2 real sites are `backdrop-blur-[...]`, not bare `blur-[...]` — see gotcha below).
+- Fallback-comma paren form (`bg-(--x,fallback)`): **NOT SUPPORTED.** Tailwind v4's paren shorthand only accepts a single custom-property reference (optionally with a `type:` hint); a literal comma-separated fallback inside the parens does not parse as a fallback expression. Per the mission's fallback plan, a wrapper token (`--code-highlight-bg-resolved: var(--paperclip-code-highlight-bg, rgba(250, 204, 21, 0.12));`) was minted instead and referenced via the plain `bg-(--code-highlight-bg-resolved)` form — confirmed this compiles to `background-color:var(--code-highlight-bg-resolved)`.
+- Plugin utilities (`zoom-in-[0.97]`, `zoom-out-[0.97]`, `slide-in-from-top-[1%]`, `slide-out-to-top-[1%]`, plus their siblings `animate-in`/`animate-out`/`fade-in-0`/`fade-out-0`): **DEAD CLASSES, zero rendered CSS.** Grepping the built `storybook-static` CSS for any of these class names (in escaped or unescaped form) returns nothing — not even the base `animate-in` machinery they depend on. Confirmed via `package.json`/`node_modules` inspection that the `tw-animate-css` plugin is not installed anywhere in this repo, and `ui/src/index.css` defines no matching `@utility` overrides. These utilities have had zero visual effect since before this run started; nothing to tokenize without changing (from nothing to something) a currently inert class, which is out of this batch's zero-visual-change mandate. Left untouched, allowlisted with the reasoning above.
+- `theme(colors.muted.DEFAULT)` / `theme(colors.muted.foreground)` fallback resolution: inspected the ALREADY-BUILT `ui/storybook-static/assets/*.css` before writing the codemod (per the mission's instruction to check build output first, since `theme()` is a build-time function) — confirmed byte-for-byte that Tailwind compiles `bg-[var(--paperclip-code-bg,theme(colors.muted.DEFAULT))]` to `background-color:var(--paperclip-code-bg,var(--muted))` and the gutter-fg sibling to `color:var(--paperclip-code-gutter-fg,var(--muted-foreground))`. Minted `--code-bg-resolved: var(--paperclip-code-bg, var(--muted));` and `--code-gutter-fg-resolved: var(--paperclip-code-gutter-fg, var(--muted-foreground));` reproducing that exact resolved form.
+
+**Sites rewritten: 198**, across 84 files (79 component/page files + 3 test files rewritten in lockstep — `IssueDocumentAnnotations.test.tsx` (`z-[60]` → `z-(--z-60)`, 2 assertion strings), `MarkdownBody.test.tsx` (`align-[-0.125em]` → `align-(--va-0_125em)`, 3 assertion strings), `SidebarShell.test.tsx` (`transition-[width]` → `transition-(--tp-width)`, 1 negative assertion) — plus `AGENTS.md`/`package.json`/`ui/src/index.css` for the gate script wiring and doc updates).
+
+**Tokens minted: 96 new** (58 `--gtc-*` + 3 `--gtr-*` + 19 `--tp-*` + 6 `--z-*` + 1 `--s-*` + 1 `--e-*` + 1 `--va-*` + 1 `--sw-*` + 2 `--blur-*` + 1 `--drop-shadow-extract-*` + 4 `*-resolved` wrapper tokens + 2 `--gradient-extract-*` continuing Batch 1's counter as `-25`/`-26`; 0 reused from Batches 1-3 — no existing token in any prior family matched these new value shapes).
+- **`--gtc-*` (58) / `--gtr-*` (3)** — grid-template-columns/rows track lists, verbatim (underscore-to-space reversal applied per Batch 1's gotcha), sequentially numbered (content like `minmax(0,1fr)_auto` isn't safely nameable). Deduped on exact string match: e.g. `--gtr-2`/`--gtr-3` (`1fr`/`0fr`) each reused across both `CompanySkills.tsx` `expanded`/collapsed sites. One pre-existing source oddity preserved verbatim, not "fixed": `pages/Costs.tsx`'s `grid-cols-[1.3fr,1fr]`/`[1.25fr,0.95fr]`/`[1.2fr,0.95fr]` use a literal COMMA between track values (not the standard space-separated `grid-template-columns` syntax) — confirmed via the built CSS that this is exactly what ships today (`grid-template-columns:1.3fr,1fr`), so the token values (`--gtc-31`/`-32`/`-33`) preserve the comma byte-for-byte rather than "correcting" it to a space, per DESIGN.md's no-normalizing rule.
+- **`--tp-*` (19)** — `transition-property` lists, slugged from the comma-joined property names (e.g. `--tp-width-background-color: width,background-color;`), one token per distinct property-list string.
+- **`--z-*` (6)** — `--z-1`, `--z-2`, `--z-60`, `--z-120`, `--z-200`, `--z-9999`, bare numeric values matching TOKEN-AUDIT.md section 3.7's ad hoc z-index inventory exactly. Still no z-index TIER/scale decision made (per that section's original flag) — these are 6 independent verbatim values, not a scale.
+- **`--s-0_98`, `--e-cubic-bezier-0_16-1-0_3-1`, `--va-0_125em`, `--sw-2_3`** — one token each (scale/ease/vertical-align/stroke-width all had exactly one distinct value in scope).
+- **`--blur-1px` / `--blur-2px`** — 2 sites, 2 distinct values (`ChatComposer.tsx`'s `backdrop-blur-[1px]`, `IssueChatThread.tsx`'s `backdrop-blur-[2px]`); confirmed both are `backdrop-blur`, not bare `blur` (see gotcha below).
+- **`--drop-shadow-extract-1`** — `CompanyPatternIcon.tsx`'s `drop-shadow-[0_1px_2px_rgba(0,0,0,0.65)]`, its own family per Batch 3's logged "needs human decision" (kept separate from `--shadow-extract-*`, which is `box-shadow`; `drop-shadow` is a `filter` function, a different CSS property).
+- **4 `*-resolved` wrapper tokens** (`--code-bg-resolved`, `--code-highlight-bg-resolved`, `--code-gutter-fg-resolved`, `--code-highlight-border-resolved`) — all four `FileViewerSheet.tsx` half-migrated `var(--paperclip-code-*, fallback)` sites Batch 1 explicitly deferred as "needs human decision" (see Batch 1's log above) are now resolved: the `--paperclip-code-highlight-bg`/`-border` sites keep their literal rgba/rgb fallback verbatim; the `--paperclip-code-bg`/`-gutter-fg` sites' `theme(colors.muted...)` fallbacks are resolved to the build's own `var(--muted)`/`var(--muted-foreground)` equivalent (see Step 0 spike above). The inline `token-extraction: allowlisted` comment at the site and Batch 1's allowlist doc-comment entry for this file were both updated to note the resolution rather than silently deleting the historical note.
+- **`--gradient-extract-25` / `-26`** — SCOPE CORRECTION found during this batch's own bracket sweep, not called out in the original task list: `components/SidebarAccountMenu.tsx` and `pages/ProfileSettings.tsx` each had one `bg-[linear-gradient(...)]` site using `hsl(var(--primary))`/`color-mix(in_oklab,...)` CSS-native color functions rather than raw hex/rgb literals — which is exactly why Batch 1's hand-audited color-literal table (built to avoid false-positiving on issue references like `acme/web#241`) did not catch them; they were never scanned as "color literals" because they contain no hex/rgb/hsl numeric literal, only `var()`/`color-mix()` references. They ARE still value-bearing gradient brackets by gate 2's definition (a CSS value function), so this batch mints 2 more tokens CONTINUING Batch 1's `--gradient-extract-*` counter (picking up at 25, not restarting at 1) rather than creating a parallel family.
+- All new tokens live in a fourth non-`@theme` `:root { ... }` block appended to `ui/src/index.css` immediately after Batch 3's block, headed `/* ── Extracted verbatim MISC tokens (Phase 2 Batch 4, design/token-extraction) ── */`, per DESIGN.md (runtime-tunable).
+
+**GOTCHA — `backdrop-blur-[...]` vs bare `blur-[...]` boundary:** the task's "any `blur-[...]`" language and TOKEN-AUDIT.md section 3.7's inventory both describe the 2 sites as `blur-[Npx]`, but the actual class names are `backdrop-blur-[1px]`/`backdrop-blur-[2px]` (a `filter: backdrop-filter` utility, not the plain `filter: blur()` utility). A bare `blur-\[...\]` regex anchored at Batch 3's class-token BOUNDARY does not match `backdrop-blur-[...]` at all, since `blur` there doesn't start at a boundary (it's preceded by `backdrop-`, not whitespace/quote/colon) — caught immediately in this batch's dry run (0 blur sites found on the first pass despite 2 being expected from the inventory) rather than silently mis-tokenizing. Fixed by matching `(backdrop-blur|blur)-\[...\]` as two alternatives sharing one token family, confirmed both compile correctly in the Step 0 spike.
+
+**Sites allowlisted (added to the canonical machine-readable ALLOWLIST block in `ui/src/index.css`, consolidating and reformatting the prior per-batch prose lists into `* allow <path> — <reason>` lines for `scripts/check-token-gates.mjs` to parse):**
+1. `components/ui/dialog.tsx` / `components/ui/alert-dialog.tsx` — `zoom-in-[0.97]`/`zoom-out-[0.97]`/`slide-in-from-top-[1%]`/`slide-out-to-top-[1%]` (plus `animate-in`/`animate-out`/`fade-in-0`/`fade-out-0`): dead/no-op classes, no `tw-animate-css` plugin installed, confirmed via built-CSS grep (see Step 0 spike above).
+2. `components/ProjectWorkspaceSummaryCard.tsx` (`min-[420px]:`) / `components/FileTree.tsx` (`max-[480px]:`, 2 sites) — arbitrary BREAKPOINT VARIANTS, not values; the variant position cannot reference a CSS custom property (Tailwind resolves variants at build time), so there is nothing to tokenize without changing Tailwind's own variant syntax. Distinct from `rounded-[inherit]` (Batch 3, a keyword) but the same category of "syntactically cannot hold a token reference."
+3. **18 `*.test.tsx` files, 43 hex-literal sites (new policy ruling this batch, resolving TOKEN-AUDIT.md section 8 item 10):** `IssueFiltersPopover.test.tsx`, `IssueProperties.test.tsx`, `MarkdownBody.test.tsx`, `MarkdownEditor.test.tsx`, `NewIssueDialog.test.tsx`, `ProjectTile.test.tsx`, `RoutineRunVariablesDialog.test.tsx`, `SidebarCompanyMenu.test.tsx`, `SidebarProjects.test.tsx`, `SidebarStarredProjects.test.tsx`, `CompanyEnvironments.test.tsx`, `ExecutionWorkspaceDetail.test.tsx`, `InviteLanding.test.tsx`, `IssueDetail.test.tsx`, `ProjectDetail.test.tsx`, `ProjectWorkspaceDetail.test.tsx`, `Projects.test.tsx`, `Routines.test.tsx`. Every site is MOCK PROP / MOCK API-RESPONSE DATA (`color: "#hex"` label/project/routine fixtures, `brandColor`/`companyBrandColor` company fixtures, an xterm.js theme-mock assertion mirroring the already-allowlisted `CompanyEnvironments.tsx` production config) — none are Tailwind class strings or CSS-in-JS style declarations. This is the test-file counterpart of the exact category Batch 1 already allowlisted in production source (persisted/functional data, not a rendered CSS value); rewriting them to `var()` strings would make mock fixtures look unlike real API responses without touching a single rendered pixel. Ruling: test-fixture prop/mock-data hex literals are allowlisted as a standing category, one line per file for reviewability.
+4. **3 gate-1 false positives found and fixed in the gate script itself, not allowlisted (no real hex color involved):** `ExternalObjectPill.test.tsx`/`IssueProperties.test.tsx`'s `"acme/web#241"`-style issue-reference strings were initially flagged by a naive hex regex (`#241` is 3 valid hex digits) — the exact false-positive shape Batch 1's own color codemod header already documented. Fixed with a negative lookbehind requiring a hex color's `#` not be immediately preceded by an identifier character or `/` (a real CSS color is always preceded by a delimiter — quote, colon, paren, comma, whitespace, backtick, or string start — never glued directly to a slash-path or word).
+
+**Gate script: `scripts/check-token-gates.mjs`** (new, Part C of this batch). Implements the three DONE-WHEN gates over `ui/src/components/**` and `ui/src/pages/**`:
+- **Gate 1 (color literals):** hex colors (`#fff`/`#ffffff`/`#ffffffff`) and `rgb()`/`rgba()`/`hsl()`/`hsla()`/`oklch()` calls with a LITERAL first argument (not `var(...)`) — so `hsl(var(--primary)/0.16)` passes, `rgba(0,0,0,0.5)` fails.
+- **Gate 2 (arbitrary bracket values):** flags `word-[content]` where `content` carries a rendered value (digits+CSS-unit, bare hex, or a CSS value function — `calc`/`min`/`max`/`clamp`/`var`/`env`/`linear-gradient`/`radial-gradient`/`conic-gradient`/`cubic-bezier`/`rgba?`/`hsla?`/`oklch`/`color-mix`). **Selector/variant brackets are excluded BY DEFINITION** (documented in the script's header, matching the mission's Part B instruction), recognized structurally two ways: (a) known variant-keyword prefixes (`data`, `has`, `aria`, `supports`, `group-data`, `group-has-data`, `group-aria`, `peer-data`, `peer-aria`, `in`, `not`), and (b) any bracket immediately followed by `:` (the structural signature of a breakpoint/arbitrary-variant prefix like `max-[480px]:hidden`, since a value-bearing utility bracket is never itself followed by another `:`-prefixed segment). `rounded-[inherit]` is not flagged (a bare keyword, not a unit/hex/function shape) and is separately allowlisted per Batch 3's precedent for defense-in-depth.
+- **Gate 3 (raw font-size):** `text-[Npx]`/`text-[N.Nrem]` class brackets, plus `fontSize: "N..."` / `font-size: "N..."` string-literal declarations that BEGIN with a digit — deliberately excluding `fontSize: "var(--fs-11)"`-style token references (the desired post-extraction form) from matching as a violation.
+- **Allowlist parsing:** reads `* allow <repo-relative-path> — <reason>` lines from the canonical ALLOWLIST block appended to the end of `ui/src/index.css` (added this batch, consolidating the Batches 1-3 free-prose lists into this one machine-readable format while leaving the original prose blocks in place as historical narrative). A path suppresses a violation if the violating file's path CONTAINS the allowlisted path as a substring.
+- Exit code 0 with a per-gate summary when clean; exit code 1 listing every violation (file:line + snippet), grouped by gate, otherwise.
+- Wired as `pnpm check:token-gates` (`"check:token-gates": "node scripts/check-token-gates.mjs"` in the root `package.json`).
+
+**Verify results:**
+- Own full bracket sweep (`rg`-based, matching the gate script's boundary logic) over `ui/src/components/**`/`ui/src/pages/**`: only selector/variant brackets (`data-[...]`, `group-data-[...]`, `has-[...]`, `supports-[...]`, etc.) and the documented allowlisted exceptions (`rounded-[inherit]`, `max-[480px]`/`min-[420px]`, the 4 dead tw-animate-css classes) remain.
+- `node scripts/check-token-gates.mjs` → **exit 0**, "All gates clean" (Gate 1/2/3 all CLEAN; 468 files scanned; 31 allowlist entries loaded; 71 allowlisted issues correctly skipped rather than flagged).
+- `pnpm build-storybook` → exit 0.
+- Storybook visual snapshot suite: **510/510 passed** (`npx playwright test --config tests/storybook-visual/playwright.config.ts --reporter=line`) — 509 passed clean on the first attempt + 1 known-benign flaky retry (`product-documents-annotations--integrated-desktop-open [dark]`, the exact flake called out in the batch mandate as expected-benign) passed on Playwright's automatic retry.
+- `pnpm typecheck` (from `ui/`) → exit 0.
+- Codemod re-run confirmed idempotent: second invocation reports 0 sites rewritten, 0 files changed, token block already present.
+- Spot-checked 3 lockstep test-file rewrites directly with `npx vitest run` (`IssueDocumentAnnotations.test.tsx`, `MarkdownBody.test.tsx`, `SidebarShell.test.tsx`): 67/67 tests passed.
+
+**AGENTS.md:** the existing "Design system" section (added before Phase 2 began) was extended with one sentence naming `pnpm check:token-gates` as the required pre-commit check and clarifying the rule's exact scope (`ui/src/components/**`/`ui/src/pages/**`, allowlist-exempted) — kept to the section's existing brief tone, no new section added.
+
+**Remaining out-of-scope debt (explicitly NOT addressed by this run, flagged for whoever scopes the next one):**
+- **`ui/src/lib/`, `ui/src/context/`, `ui/src/plugins/`** were never in scope for any of the 4 batches (DESIGN.md/GOAL-PROMPT.md's Phase 2 spec and every batch mandate scoped strictly to `ui/src/components/**` and `ui/src/pages/**`). A quick count at the end of this batch: **36 hex-literal sites** remain in `lib`/`context`/`plugins` combined (`lib/color-contrast.ts`, `lib/worktree-branding.ts`, `context/ThemeContext.tsx` and others — the same "contrast-pair triplication" TOKEN-AUDIT.md section 8 item 9 already flagged). These are helper/logic modules, not component render code, so they were correctly out of this run's gate — but they are real remaining hardcoded-value debt in `ui/src/` overall, and DESIGN.md's "single token source" principle would eventually want them re-pointed at the same tokens too.
+- **The Tailwind-palette-class scope question** (TOKEN-AUDIT.md section 8 item 1: `bg-red-500`-style classes, ~3,115 sites / 145 files) was never resolved by any batch and remains exactly as open as it was after Phase 1 — none of Batches 1-4 touched Tailwind's own built-in palette utilities (only literal hex/rgb/bracket-arbitrary values were extracted). This is still the single largest scope decision a human needs to make before any further token-extraction work: whether Tailwind's own oklch palette counts as "hardcoded" under DESIGN.md principle 2, or is considered part of the token system already (Tailwind's palette is itself a fixed design-token set, just not `index.css`'s).
+- The micro type-size cluster (9-15px, TOKEN-AUDIT.md section 8 item 2), letter-spacing cluster (item 3), and radius 0px/lg/xl conflict (item 4) are all still open — this run intentionally minted verbatim tokens for every distinct value without collapsing any of them into a real scale, per DESIGN.md's explicit "ugly values stay ugly" instruction. The human scale-collapse decision (GOAL-PROMPT.md "after the run" step 2) is unchanged by Batch 4.
diff --git a/package.json b/package.json
index 0a7e30fffe..b9f040ef7e 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,7 @@
"release:rollback": "./scripts/rollback-latest.sh",
"release:bootstrap-package": "node scripts/bootstrap-npm-package.mjs",
"check:tokens": "node scripts/check-forbidden-tokens.mjs",
+ "check:token-gates": "node scripts/check-token-gates.mjs",
"check:no-git-push": "node scripts/check-no-git-push.mjs",
"test:check-no-git-push": "node --test scripts/check-no-git-push.test.mjs",
"test:hermes-gateway-smoke": "node --test scripts/smoke/hermes-gateway-smoke.test.mjs",
@@ -48,6 +49,9 @@
"smoke:pipelines-tutorial": "./scripts/smoke/pipelines-tutorial-smoke.sh",
"smoke:terminal-bench-loop-skill": "node scripts/smoke/terminal-bench-loop-skill-smoke.mjs",
"test:release-registry": "node --test scripts/verify-release-registry-state.test.mjs scripts/release-package-map.test.mjs scripts/check-release-package-bootstrap.test.mjs scripts/check-no-git-push.test.mjs scripts/release-lib.test.mjs scripts/link-plugin-dev-sdk.test.js",
+ "storybook-visual:baseline": "node scripts/storybook-visual-baseline.mjs",
+ "test:storybook-visual": "node scripts/storybook-visual-baseline.mjs download && node scripts/storybook-visual-baseline.mjs verify && pnpm build-storybook && npx playwright test --config tests/storybook-visual/playwright.config.ts",
+ "test:storybook-visual:update": "node scripts/storybook-visual-baseline.mjs download && pnpm build-storybook && npx playwright test --config tests/storybook-visual/playwright.config.ts --update-snapshots && node scripts/storybook-visual-baseline.mjs pack",
"test:e2e": "npx playwright test --config tests/e2e/playwright.config.ts",
"test:e2e:headed": "npx playwright test --config tests/e2e/playwright.config.ts --headed",
"test:e2e:multiuser-authenticated": "npx playwright test --config tests/e2e/playwright-multiuser-authenticated.config.ts",
diff --git a/scripts/__tests__/storybook-visual-baseline.test.mjs b/scripts/__tests__/storybook-visual-baseline.test.mjs
new file mode 100644
index 0000000000..9d541d6ccc
--- /dev/null
+++ b/scripts/__tests__/storybook-visual-baseline.test.mjs
@@ -0,0 +1,114 @@
+import assert from "node:assert/strict";
+import { createHash } from "node:crypto";
+import {
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ rmSync,
+ statSync,
+ unlinkSync,
+ writeFileSync,
+} from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { spawnSync } from "node:child_process";
+import test from "node:test";
+
+const script = new URL("../storybook-visual-baseline.mjs", import.meta.url).pathname;
+
+test("downloads and verifies a checksum-pinned local baseline archive", () => {
+ const root = mkdtempSync(join(tmpdir(), "storybook-visual-baseline-test-"));
+ try {
+ const source = join(root, "source");
+ const cache = join(root, "cache");
+ const snapshots = join(root, "snapshots");
+ const manifest = join(root, "manifest.json");
+ mkdirSync(source, { recursive: true });
+ writeFileSync(join(source, "one.png"), "png-one");
+ writeFileSync(join(source, "two.png"), "png-two");
+ const archive = join(root, "snapshots.tgz");
+ run("tar", ["--sort=name", "--mtime=@0", "--owner=0", "--group=0", "--numeric-owner", "-czf", archive, "-C", source, "."]);
+ const sha256 = createHash("sha256").update(readFileSync(archive)).digest("hex");
+ const byteSize = statSync(archive).size;
+ writeFileSync(
+ manifest,
+ JSON.stringify(
+ {
+ version: 1,
+ baselineId: "test-baseline",
+ snapshotCount: 2,
+ archive: {
+ url: `file://${archive}`,
+ sha256,
+ byteSize,
+ },
+ environment: {
+ browser: "chromium",
+ viewport: "1200x800",
+ deviceScaleFactor: 1,
+ platform: "test",
+ },
+ },
+ null,
+ 2,
+ ),
+ );
+
+ const env = {
+ ...process.env,
+ STORYBOOK_VISUAL_BASELINE_MANIFEST: manifest,
+ STORYBOOK_VISUAL_BASELINE_CACHE_DIR: cache,
+ STORYBOOK_VISUAL_SNAPSHOT_DIR: snapshots,
+ };
+ const download = spawnSync(process.execPath, [script, "download"], { env, encoding: "utf8" });
+ assert.equal(download.status, 0, download.stderr);
+ const verify = spawnSync(process.execPath, [script, "verify"], { env, encoding: "utf8" });
+ assert.equal(verify.status, 0, verify.stderr);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test("verify fails closed on snapshot count mismatch", () => {
+ const root = mkdtempSync(join(tmpdir(), "storybook-visual-baseline-test-"));
+ try {
+ const snapshots = join(root, "snapshots");
+ const manifest = join(root, "manifest.json");
+ mkdirSync(snapshots, { recursive: true });
+ writeFileSync(join(snapshots, "one.png"), "png-one");
+ const archive = join(root, "snapshots.tgz");
+ run("tar", ["--sort=name", "--mtime=@0", "--owner=0", "--group=0", "--numeric-owner", "-czf", archive, "-C", snapshots, "."]);
+ const sha256 = createHash("sha256").update(readFileSync(archive)).digest("hex");
+ const manifestBody = {
+ version: 1,
+ baselineId: "test-baseline",
+ snapshotCount: 1,
+ archive: {
+ url: `file://${archive}`,
+ sha256,
+ byteSize: statSync(archive).size,
+ },
+ };
+ writeFileSync(manifest, JSON.stringify(manifestBody));
+ const env = {
+ ...process.env,
+ STORYBOOK_VISUAL_BASELINE_MANIFEST: manifest,
+ STORYBOOK_VISUAL_BASELINE_CACHE_DIR: root,
+ STORYBOOK_VISUAL_SNAPSHOT_DIR: snapshots,
+ };
+ const download = spawnSync(process.execPath, [script, "download"], { env, encoding: "utf8" });
+ assert.equal(download.status, 0, download.stderr);
+ writeFileSync(manifest, JSON.stringify({ ...manifestBody, snapshotCount: 2 }));
+ unlinkSync(join(snapshots, "one.png"));
+ const result = spawnSync(process.execPath, [script, "verify"], { env, encoding: "utf8" });
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /snapshot count mismatch/i);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
+function run(cmd, args) {
+ const result = spawnSync(cmd, args, { stdio: "pipe", encoding: "utf8" });
+ assert.equal(result.status, 0, result.stderr);
+}
diff --git a/scripts/check-token-gates.mjs b/scripts/check-token-gates.mjs
new file mode 100644
index 0000000000..26722d70d3
--- /dev/null
+++ b/scripts/check-token-gates.mjs
@@ -0,0 +1,315 @@
+#!/usr/bin/env node
+/**
+ * check-token-gates.mjs
+ *
+ * Phase 2 (extraction) DONE-WHEN gate check for the design-token-extraction
+ * run (branch design/token-extraction; see DESIGN.md, GOAL-PROMPT.md,
+ * TOKEN-AUDIT.md). Scans `ui/src/components/**` and `ui/src/pages/**`
+ * (excluding `ui/src/lib|context|plugins`, which are explicitly out of
+ * scope for this run per TOKEN-AUDIT.md's Batch 4 log) for three gates:
+ *
+ * Gate 1 — zero hardcoded COLOR LITERALS: hex colors (#fff, #ffffff,
+ * #ffffffff) and rgb()/rgba()/hsl()/hsla()/oklch() value literals
+ * (i.e. NOT a var() reference, and not merely referencing a CSS
+ * variable inside one of those functions, e.g. hsl(var(--primary)) is
+ * fine — only a literal numeric color argument fails the gate).
+ *
+ * Gate 2 — zero VALUE-BEARING arbitrary Tailwind bracket utilities:
+ * bracket contents (`utility-[...]`) that carry a rendered CSS value
+ * (digits with CSS units, bare numbers, color literals, or CSS value
+ * functions like calc()/min()/max()/clamp()/var()/linear-gradient()/
+ * cubic-bezier()/rgba()/env()). This is checked on the UTILITY
+ * position, i.e. `word-[...]` where `word` is not itself a selector/
+ * variant keyword.
+ *
+ * SELECTOR/VARIANT BRACKETS ARE EXCLUDED BY DEFINITION, not by
+ * omission: `data-[...]`, `group-data-[...]`, `has-[...]`,
+ * `group-has-data-[...]`, `aria-[...]`, `supports-[...]`, and
+ * `max-[...]`/`min-[...]` used as a BREAKPOINT VARIANT PREFIX (i.e.
+ * immediately followed by `:`, such as `max-[480px]:hidden`) are CSS
+ * SELECTOR CONDITIONS or responsive variant prefixes, not visual
+ * values applied to a property — they describe WHEN a rule applies,
+ * not WHAT value it sets. A variant's bracket cannot reference a CSS
+ * custom property (Tailwind resolves variants at build time, before
+ * any `var()` could be evaluated), so there is nothing to tokenize;
+ * tokenizing would require changing Tailwind's own variant syntax,
+ * which is out of scope. These are recognized structurally: a
+ * bracket immediately followed by `:` (not part of a class string's
+ * trailing utility) is a variant, not a utility value.
+ *
+ * True exceptions that DO carry a value but cannot be tokenized are
+ * ALLOWLISTED, not silently excluded (see ALLOWLIST parsing below):
+ * `max-[480px]`/`min-[420px]` breakpoint variants (variant position
+ * cannot reference a var), and `rounded-[inherit]` (a CSS-wide
+ * keyword, not a literal value, cannot come from a custom property).
+ *
+ * Gate 3 — zero raw FONT-SIZE declarations: `text-[Npx]`/`text-[N.Nrem]`
+ * Tailwind arbitrary font-size utilities (a subset of gate 2, checked
+ * explicitly since font-size is its own DESIGN.md-named category) and
+ * `fontSize: "..."` / `font-size:` string-literal declarations in
+ * inline styles or css-in-js.
+ *
+ * The ALLOWLIST is parsed from the machine-readable block in
+ * ui/src/index.css (search for "── ALLOWLIST" below it), one entry per
+ * line in the form:
+ * * allow <repo-relative-path> — <reason>
+ * A violation at a path is suppressed if the path CONTAINS (substring
+ * match) any allowlisted path. This intentionally allowlists the whole
+ * file for simplicity/reviewability, matching how Batches 1-3 allowlisted
+ * entire sites' surrounding functional code rather than individual
+ * characters.
+ *
+ * Exit code: 0 if all three gates are clean (prints a per-gate summary).
+ * Exit code: 1 if any gate has violations (lists them, grouped by gate).
+ *
+ * Usage: node scripts/check-token-gates.mjs
+ */
+
+import { readFileSync, readdirSync } from "node:fs";
+import { resolve, dirname, join, relative } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(__dirname, "..");
+const UI_SRC = resolve(REPO_ROOT, "ui/src");
+const SCAN_DIRS = ["components", "pages"];
+const CSS_PATH = resolve(UI_SRC, "index.css");
+
+// ── Allowlist parsing ────────────────────────────────────────────────────
+// Reads the machine-readable "* allow <path> — <reason>" lines from the
+// ALLOWLIST block in ui/src/index.css. Tolerant of either em-dash (—) or
+// a plain hyphen-minus as the path/reason separator, and of the historical
+// per-batch prose blocks NOT being in this format (they are not parsed;
+// only lines starting with "* allow " are).
+function loadAllowlist(cssPath) {
+ const css = readFileSync(cssPath, "utf8");
+ const entries = [];
+ const lineRe = /^\s*\*\s*allow\s+(\S+)\s+(?:—|-{1,2})\s*(.*)$/;
+ for (const rawLine of css.split("\n")) {
+ const m = rawLine.match(lineRe);
+ if (m) {
+ entries.push({ path: m[1], reason: m[2].trim() });
+ }
+ }
+ return entries;
+}
+
+function isAllowlisted(relPath, allowlist) {
+ return allowlist.some((entry) => relPath.includes(entry.path));
+}
+
+// ── File walking ─────────────────────────────────────────────────────────
+function walk(dir, out) {
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const p = join(dir, entry.name);
+ if (entry.isDirectory()) walk(p, out);
+ else if (/\.(tsx?|jsx?)$/.test(entry.name)) out.push(p);
+ }
+}
+
+function listFiles() {
+ const files = [];
+ for (const dir of SCAN_DIRS) walk(resolve(UI_SRC, dir), files);
+ files.sort();
+ return files;
+}
+
+// ── Gate 1: color literals ───────────────────────────────────────────────
+// Hex colors: #abc, #aabbcc, #aabbccdd — word-boundary guarded so it
+// doesn't match inside identifiers, and NOT preceded by another hex digit
+// (avoids over-matching truncated substrings of longer non-color tokens,
+// though `#` itself is a strong enough anchor in practice).
+// A genuine CSS hex color is never glued directly to an identifier
+// character (letter/digit/underscore) or `/` immediately before the `#` —
+// that shape is an issue/PR reference like "acme/web#241" or "acme/web#12"
+// (Batch 1's codemod header documented this exact false-positive risk for
+// its own hex-literal sweep; the same guard applies here). A real color
+// literal is preceded by a delimiter (quote, colon, paren, comma,
+// whitespace, backtick, template `${`) or sits at the start of the string.
+const HEX_COLOR_RE = /(?<![a-zA-Z0-9_/])#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\b/g;
+
+// rgb()/rgba()/hsl()/hsla()/oklch() with a LITERAL first argument (a digit,
+// a `.` decimal, or a `%` — i.e. not `var(` or `calc(` immediately inside).
+// `hsl(var(--x)/0.16)` must NOT match (var() reference); `rgba(0,0,0,0.5)`
+// MUST match (literal numeric channels).
+const COLOR_FN_LITERAL_RE = /\b(?:rgb|rgba|hsl|hsla|oklch)\(\s*(?!var\()[0-9.%-]/g;
+
+function findColorLiteralIssues(content) {
+ const issues = [];
+ for (const m of content.matchAll(HEX_COLOR_RE)) {
+ issues.push({ index: m.index, snippet: m[0] });
+ }
+ for (const m of content.matchAll(COLOR_FN_LITERAL_RE)) {
+ issues.push({ index: m.index, snippet: m[0] });
+ }
+ return issues;
+}
+
+// ── Gate 2: value-bearing arbitrary bracket utilities ───────────────────
+// Matches `word-[content]` (optionally prefixed by `!`, and optionally
+// preceded by a Tailwind variant chain like `sm:` / `dark:` / `hover:` /
+// `data-[state=open]:` etc. — the regex only needs to find the utility's
+// OWN bracket, not parse the whole variant chain, since VARIANT_KEYWORDS
+// below excludes variant-shaped words directly at the match site).
+//
+// A bracket is a VARIANT (excluded by definition, see header) if:
+// (a) the word immediately before `-[` is one of the known variant
+// keywords (data, group-data, has, group-has-data, aria, supports,
+// group-aria, peer-data, peer-aria, in, not), OR
+// (b) the bracket is immediately followed by `:` (a breakpoint-style
+// variant prefix, e.g. `max-[480px]:hidden` — the `:` right after
+/// `]` is the structural signal that this bracket is a CONDITION,
+// not a value).
+const BRACKET_RE = /(!?)([a-zA-Z][a-zA-Z0-9-]*)-\[([^\[\]]*)\]/g;
+
+const VARIANT_WORD_RE =
+ /(?:^|[\s"'`{])(?:group-|peer-)?(?:data|has|aria|supports|in|not)(?:-[a-zA-Z0-9]+)*$/;
+
+// A bracket carries a VALUE (not just a keyword/selector fragment) if its
+// content looks like: a number (optionally with a CSS unit or %), a CSS
+// color literal (# hex or a color function), OR a known CSS value function
+// call (calc/min/max/clamp/var/env/linear-gradient/radial-gradient/
+// conic-gradient/cubic-bezier/rgba/rgb/hsl/hsla/oklch). Pure CSS KEYWORDS
+// (e.g. `inherit`, `auto`, `pointer`) do NOT match and are not gated here
+// (they're a separate, allowlisted concern — see `rounded-[inherit]`).
+const VALUE_UNIT_RE = /^-?[0-9.]+(?:px|rem|em|vh|vw|dvh|dvw|svh|svw|ch|%|deg|s|ms|fr)?$/;
+const VALUE_FUNC_RE =
+ /^(?:calc|min|max|clamp|var|env|linear-gradient|radial-gradient|conic-gradient|cubic-bezier|rgba?|hsla?|oklch|color-mix)\(/;
+const HEX_ONLY_RE = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
+
+function bracketCarriesValue(raw) {
+ const trimmed = raw.trim();
+ if (VALUE_UNIT_RE.test(trimmed)) return true;
+ if (HEX_ONLY_RE.test(trimmed)) return true;
+ if (VALUE_FUNC_RE.test(trimmed)) return true;
+ // A bracket containing an embedded CSS value function anywhere (e.g. a
+ // grid track list `56px_56px_24px_minmax(0,1fr)` that doesn't itself
+ // start with one of the above, or `translate-y-[-50%]`-style negative
+ // percentages already covered by VALUE_UNIT_RE) also counts.
+ if (/[0-9](?:px|rem|em|vh|vw|dvh|dvw|svh|svw|ch|%|deg|fr)\b/.test(trimmed)) return true;
+ if (/\b(?:calc|min|max|clamp|var|env|linear-gradient|radial-gradient|conic-gradient|cubic-bezier|rgba?|hsla?|oklch|color-mix)\(/.test(trimmed)) return true;
+ if (HEX_COLOR_RE.test(trimmed)) return true;
+ return false;
+}
+
+function findArbitraryBracketIssues(content) {
+ const issues = [];
+ for (const m of content.matchAll(BRACKET_RE)) {
+ const [full, , word, raw] = m;
+ const matchEnd = m.index + full.length;
+ const followedByColon = content[matchEnd] === ":";
+ if (followedByColon) continue; // breakpoint/arbitrary-variant prefix, not a utility value
+
+ // Reject if `word` itself IS (or ends in) a variant keyword shape, e.g.
+ // a match that accidentally captured "...data" as the utility name for
+ // some malformed/edge case. In practice BRACKET_RE's utility-name
+ // capture group only ever contains real utility names (data-[...] etc.
+ // are matched with `word` = "data", "group-data", "has", etc.).
+ const precedingContext = content.slice(Math.max(0, m.index - 1), m.index + word.length + 1);
+ if (VARIANT_WORD_RE.test(precedingContext)) continue;
+ if (/^(?:data|has|aria|supports|group-data|group-has-data|group-aria|peer-data|peer-aria|group-has-data-slot|in|not)$/.test(word)) {
+ continue;
+ }
+
+ if (!raw.includes("[") && bracketCarriesValue(raw)) {
+ issues.push({ index: m.index, snippet: `${word}-[${raw}]` });
+ }
+ }
+ return issues;
+}
+
+// ── Gate 3: raw font-size declarations ──────────────────────────────────
+const FONT_SIZE_CLASS_RE = /\btext-\[(?:[0-9.]+(?:px|rem|em)|[0-9.]+\/[0-9.]+)\]/g;
+// A raw literal font-size value: starts with a digit (px/rem/em number) —
+// EXCLUDES `fontSize: "var(--text-micro)"`-style token references, which start
+// with `var(` and are the desired post-extraction form, not a violation.
+const FONT_SIZE_INLINE_RE = /\bfontSize\s*:\s*["'][0-9][^"']*["']/g;
+const FONT_SIZE_CSS_PROP_RE = /(?<!-)\bfont-size\s*:\s*["'`][0-9][^"'`]*["'`]/g;
+
+function findFontSizeIssues(content) {
+ const issues = [];
+ for (const m of content.matchAll(FONT_SIZE_CLASS_RE)) {
+ issues.push({ index: m.index, snippet: m[0] });
+ }
+ for (const m of content.matchAll(FONT_SIZE_INLINE_RE)) {
+ issues.push({ index: m.index, snippet: m[0] });
+ }
+ for (const m of content.matchAll(FONT_SIZE_CSS_PROP_RE)) {
+ issues.push({ index: m.index, snippet: m[0] });
+ }
+ return issues;
+}
+
+function lineNumberAt(content, index) {
+ return content.slice(0, index).split("\n").length;
+}
+
+function main() {
+ const allowlist = loadAllowlist(CSS_PATH);
+ const files = listFiles();
+
+ const violations = { gate1: [], gate2: [], gate3: [] };
+ let allowlistedSkips = 0;
+
+ for (const filePath of files) {
+ const content = readFileSync(filePath, "utf8");
+ const relPathPosix = relPathToPosix(filePath);
+
+ const allowed = isAllowlisted(relPathPosix, allowlist);
+
+ const g1 = findColorLiteralIssues(content);
+ const g2 = findArbitraryBracketIssues(content);
+ const g3 = findFontSizeIssues(content);
+
+ if (allowed) {
+ allowlistedSkips += g1.length + g2.length + g3.length;
+ continue;
+ }
+
+ for (const issue of g1) {
+ violations.gate1.push({ file: relPathPosix, line: lineNumberAt(content, issue.index), snippet: issue.snippet });
+ }
+ for (const issue of g2) {
+ violations.gate2.push({ file: relPathPosix, line: lineNumberAt(content, issue.index), snippet: issue.snippet });
+ }
+ for (const issue of g3) {
+ violations.gate3.push({ file: relPathPosix, line: lineNumberAt(content, issue.index), snippet: issue.snippet });
+ }
+ }
+
+ const totalViolations = violations.gate1.length + violations.gate2.length + violations.gate3.length;
+
+ console.log("check-token-gates summary");
+ console.log(` Files scanned: ${files.length}`);
+ console.log(` Allowlist entries loaded: ${allowlist.length}`);
+ console.log(` Allowlisted issues skipped: ${allowlistedSkips}`);
+ console.log("");
+ console.log(` Gate 1 (color literals): ${violations.gate1.length === 0 ? "CLEAN" : `${violations.gate1.length} violation(s)`}`);
+ console.log(` Gate 2 (arbitrary bracket vals): ${violations.gate2.length === 0 ? "CLEAN" : `${violations.gate2.length} violation(s)`}`);
+ console.log(` Gate 3 (raw font-size): ${violations.gate3.length === 0 ? "CLEAN" : `${violations.gate3.length} violation(s)`}`);
+
+ if (totalViolations > 0) {
+ console.log("\nViolations:\n");
+ for (const [gateName, list] of Object.entries(violations)) {
+ if (list.length === 0) continue;
+ console.log(`── ${gateName} ──`);
+ for (const v of list) {
+ console.log(` ${v.file}:${v.line} ${v.snippet}`);
+ }
+ console.log("");
+ }
+ process.exitCode = 1;
+ return;
+ }
+
+ console.log("\nAll gates clean.");
+ process.exitCode = 0;
+}
+
+// Windows path separators never appear in this repo's CI, but keep relative
+// paths POSIX-style for allowlist substring matching regardless of platform.
+function relPathToPosix(filePath) {
+ return ("ui/src/" + relative(UI_SRC, filePath)).split("\\").join("/");
+}
+
+main();
diff --git a/scripts/codemod-extract-colors.mjs b/scripts/codemod-extract-colors.mjs
new file mode 100644
index 0000000000..49d595c3ed
--- /dev/null
+++ b/scripts/codemod-extract-colors.mjs
@@ -0,0 +1,470 @@
+#!/usr/bin/env node
+/**
+ * codemod-extract-colors.mjs
+ *
+ * Phase 2 (extraction), Batch 1/4 of the design-token audit
+ * (branch design/token-extraction). Replaces hardcoded COLOR literals
+ * (hex / rgb() / rgba() / hsl() / hsla() / oklch()) in Tailwind class
+ * strings and inline style objects, in `ui/src/components/**` and
+ * `ui/src/pages/**` (including their *.test.tsx companions), with
+ * references to CSS custom-property tokens defined in `ui/src/index.css`.
+ *
+ * Scope is deliberately a fixed, manually-audited SITE TABLE rather than a
+ * blind hex-matching regex sweep: a generic `#[0-9a-f]{3,8}` regex produces
+ * false positives on this codebase (issue references like "acme/web#241",
+ * PR/comment numbers like "React #10140", etc.). Every entry below was
+ * verified by hand against TOKEN-AUDIT.md section 1 (see repo root) to
+ * confirm it is (a) a real color value, (b) consumed as a rendered CSS
+ * value (not fed into contrast math, canvas painting, or persisted /
+ * compared JS state), and (c) safe to swap for `var(--token)` without any
+ * visual difference.
+ *
+ * Idempotent: every site's `find` string is the ORIGINAL literal-bearing
+ * form; once rewritten the file no longer contains that string, so
+ * re-running the script is a no-op (each replace() call only fires if the
+ * exact original substring is still present).
+ *
+ * Usage: node scripts/codemod-extract-colors.mjs [--check]
+ * --check Report what WOULD change without writing files (dry run).
+ */
+
+import { readFileSync, writeFileSync } from "node:fs";
+import { resolve, dirname } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(__dirname, "..");
+const UI_SRC = resolve(REPO_ROOT, "ui/src");
+
+const DRY_RUN = process.argv.includes("--check");
+
+/**
+ * Token table — every new token minted by this batch, value VERBATIM.
+ * `name` is the CSS custom-property name (without leading --).
+ * `value` is the exact literal value from the source site.
+ * `comment` documents where it came from / why, emitted above the
+ * declaration in ui/src/index.css.
+ */
+const NEW_TOKENS = [
+ // --- Tailwind bracket color-class hex sites (section: bracket hex) ---
+ { name: "hex-959596", value: "#959596", comment: "Muted feed actor/verb/title text (ActivityFeed.tsx, FeedCard.tsx) — PRIOR-ART-flagged gap cluster, no existing token match." },
+ { name: "hex-1d1d1d", value: "#1d1d1d", comment: "OnboardingWizard.tsx dark decorative panel background, singleton." },
+
+ // --- OrgChart.tsx status dot colors (independent from --status-agent-* hues) ---
+ { name: "hex-22d3ee", value: "#22d3ee", comment: "OrgChart.tsx agent status dot — 'running' (independent palette from --status-agent-*, see TOKEN-AUDIT.md 1.2)." },
+ { name: "hex-4ade80", value: "#4ade80", comment: "OrgChart.tsx agent status dot — 'active'." },
+ { name: "hex-facc15", value: "#facc15", comment: "OrgChart.tsx agent status dot — 'paused' / 'idle' (shared value)." },
+ { name: "hex-f87171", value: "#f87171", comment: "OrgChart.tsx agent status dot — 'error'." },
+ { name: "hex-a3a3a3", value: "#a3a3a3", comment: "OrgChart.tsx agent status dot — 'terminated' + defaultDotColor fallback." },
+
+ // --- ActivityCharts.tsx priority + status color maps (independent palette, see TOKEN-AUDIT.md 1.2) ---
+ { name: "hex-ef4444", value: "#ef4444", comment: "ActivityCharts.tsx — priority 'critical' + status 'blocked' (shared value); also the <0.5 success-rate bar tint." },
+ { name: "hex-f97316", value: "#f97316", comment: "ActivityCharts.tsx — priority 'high'." },
+ { name: "hex-eab308", value: "#eab308", comment: "ActivityCharts.tsx — priority 'medium'; also the 0.5-0.8 success-rate bar tint." },
+ { name: "hex-6b7280", value: "#6b7280", comment: "ActivityCharts.tsx — priority 'low' + status 'cancelled' + statusColors fallback (shared value)." },
+ { name: "hex-3b82f6", value: "#3b82f6", comment: "ActivityCharts.tsx — status 'todo' (independent from --status-task-todo which is #f59e0b)." },
+ { name: "hex-8b5cf6", value: "#8b5cf6", comment: "ActivityCharts.tsx — status 'in_progress' (independent from --status-task-in_progress which is #2563eb — flagged inconsistency, TOKEN-AUDIT.md 1.2)." },
+ { name: "hex-a855f7", value: "#a855f7", comment: "ActivityCharts.tsx — status 'in_review'." },
+ { name: "hex-10b981", value: "#10b981", comment: "ActivityCharts.tsx — status 'done'; also the >=0.8 success-rate bar tint." },
+ { name: "hex-64748b", value: "#64748b", comment: "ActivityCharts.tsx status 'backlog'; also the widely-repeated 'no project assigned' muted-slate fallback color (TOKEN-AUDIT.md 1.3) across Routines/MarkdownEditor/RoutineRunVariablesDialog/RoutineList/IssueColumns/editable-sections." },
+
+ // --- Project-color-fallback indigo cluster (TOKEN-AUDIT.md 1.3) ---
+ { name: "hex-6366f1", value: "#6366f1", comment: "Project-color-fallback indigo seed default (ProjectDetail/PipelineSettings/IssueProperties/NewIssueDialog) — new-project-color-picker-seed family per TOKEN-AUDIT.md 1.3." },
+
+ // --- Gradient tokens (verbatim, one per distinct gradient string; DESIGN.md: mint, don't collapse) ---
+ { name: "gradient-extract-1", value: "linear-gradient(180deg,rgba(255,80,80,0.12),rgba(255,255,255,0.02))", comment: "Dashboard.tsx budget-alert card gradient." },
+ { name: "gradient-extract-2", value: "linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02))", comment: "Costs.tsx subtle white card gradient." },
+ { name: "gradient-extract-3", value: "radial-gradient(circle at top left,rgba(244,114,182,0.08),transparent 35%),radial-gradient(circle at bottom right,rgba(56,189,248,0.1),transparent 32%)", comment: "AccountingModelCard.tsx decorative overlay." },
+ { name: "gradient-extract-4", value: "linear-gradient(180deg,rgba(255,70,70,0.10),rgba(255,255,255,0.02))", comment: "BudgetIncidentCard.tsx incident-card gradient." },
+ { name: "gradient-extract-5", value: "radial-gradient(circle at top left,rgba(8,145,178,0.08),transparent 36%),radial-gradient(circle at bottom right,rgba(245,158,11,0.10),transparent 28%)", comment: "RunTranscriptUxLab.tsx:78 hero gradient." },
+ { name: "gradient-extract-6", value: "linear-gradient(135deg,rgba(8,145,178,0.08),transparent 28%),linear-gradient(180deg,rgba(245,158,11,0.08),transparent 40%),var(--background)", comment: "RunTranscriptUxLab.tsx:203 hero-card gradient." },
+ { name: "gradient-extract-7", value: "radial-gradient(circle at top right,rgba(255,255,255,0.22),transparent 34%),radial-gradient(circle at bottom left,rgba(255,255,255,0.08),transparent 36%)", comment: "ProfileSettings.tsx:162 decorative overlay." },
+ { name: "gradient-extract-8", value: "radial-gradient(circle at top,rgba(8,145,178,0.18),transparent 48%),linear-gradient(180deg,rgba(15,23,42,0.96),rgba(2,6,23,1))", comment: "InviteUxLab.tsx:510 dark hero gradient." },
+ { name: "gradient-extract-9", value: "linear-gradient(135deg,rgba(8,145,178,0.10),transparent 28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent 44%),var(--background)", comment: "IssueChatUxLab.tsx:139 + InviteUxLab.tsx:700 hero-card gradient (identical string, 2 sites)." },
+ { name: "gradient-extract-10", value: "linear-gradient(180deg,rgba(168,85,247,0.06),transparent 28%),var(--background)", comment: "IssueChatUxLab.tsx:203 + InviteUxLab.tsx:909 accent gradient (identical string, 2 sites)." },
+ { name: "gradient-extract-11", value: "linear-gradient(180deg,rgba(16,185,129,0.06),transparent 28%),var(--background)", comment: "IssueChatUxLab.tsx:226 accent gradient." },
+ { name: "gradient-extract-12", value: "linear-gradient(180deg,rgba(6,182,212,0.05),transparent 28%),var(--background)", comment: "IssueChatUxLab.tsx:263 accent gradient." },
+ { name: "gradient-extract-13", value: "linear-gradient(180deg,rgba(59,130,246,0.06),transparent 28%),var(--background)", comment: "IssueChatUxLab.tsx:294 accent gradient." },
+ { name: "gradient-extract-14", value: "linear-gradient(180deg,rgba(168,85,247,0.05),transparent 26%),var(--background)", comment: "IssueChatUxLab.tsx:315 accent gradient." },
+ { name: "gradient-extract-15", value: "linear-gradient(180deg,rgba(245,158,11,0.08),transparent 26%),var(--background)", comment: "IssueChatUxLab.tsx:339 accent gradient." },
+ { name: "gradient-extract-16", value: "linear-gradient(135deg,rgba(245,158,11,0.10),transparent 28%),linear-gradient(180deg,rgba(8,145,178,0.08),transparent 44%),var(--background)", comment: "SystemNoticeUxLab.tsx:140 hero-card gradient." },
+ { name: "gradient-extract-17", value: "linear-gradient(180deg,rgba(245,158,11,0.05),transparent 28%),var(--background)", comment: "SystemNoticeUxLab.tsx:193 accent gradient." },
+ { name: "gradient-extract-18", value: "linear-gradient(180deg,rgba(8,145,178,0.05),transparent 28%),var(--background)", comment: "SystemNoticeUxLab.tsx:225 accent gradient." },
+ { name: "gradient-extract-19", value: "linear-gradient(180deg,rgba(244,63,94,0.05),transparent 28%),var(--background)", comment: "SystemNoticeUxLab.tsx:289 accent gradient." },
+ { name: "gradient-extract-20", value: "linear-gradient(180deg,rgba(16,185,129,0.05),transparent 28%),var(--background)", comment: "SystemNoticeUxLab.tsx:331 accent gradient." },
+ { name: "gradient-extract-21", value: "linear-gradient(180deg,rgba(59,130,246,0.05),transparent 30%),var(--background)", comment: "InviteUxLab.tsx:753 accent gradient." },
+ { name: "gradient-extract-22", value: "linear-gradient(180deg,rgba(234,179,8,0.06),transparent 28%),var(--background)", comment: "InviteUxLab.tsx:807 accent gradient." },
+ { name: "gradient-extract-23", value: "linear-gradient(180deg,rgba(16,185,129,0.06),transparent 30%),var(--background)", comment: "InviteUxLab.tsx:884 accent gradient." },
+ { name: "gradient-extract-24", value: "linear-gradient(180deg,rgba(244,114,182,0.06),transparent 28%),var(--background)", comment: "InviteUxLab.tsx:921 accent gradient." },
+];
+
+/**
+ * Existing-token reuse map — hardcoded value -> existing index.css token,
+ * used ONLY where the value exact-matches (case-insensitive) a token whose
+ * value is IDENTICAL in :root and .dark (mode-independent brand tier per
+ * DESIGN.md). Both matches found in this batch are status hues with no
+ * `.dark` override in index.css.
+ */
+const REUSE = {
+ "#2563EB": "var(--status-task-in_progress)", // == --status-agent-running, both #2563eb, mode-independent
+ "#22c55e": "var(--status-task-done)",
+};
+
+/**
+ * SITE TABLE — [relative file path, find, replace]. Order-independent;
+ * every find/replace pair is applied with a single non-global `.replace()`
+ * per occurrence count noted, so duplicate literal strings within one file
+ * (e.g. the three `text-[#959596]` in ActivityFeed.tsx) are handled via
+ * `replaceAll` where explicitly marked.
+ */
+const SITES = [
+ // ── Tailwind bracket hex-class sites ──────────────────────────────
+ {
+ file: "components/ActivityFeed.tsx",
+ replaceAll: [
+ ['className="font-medium text-[#959596] group-hover:text-white"', 'className="font-medium text-(--hex-959596) group-hover:text-white"'],
+ ['className="ml-1 text-[#959596]"', 'className="ml-1 text-(--hex-959596)"'],
+ ['className="ml-1 text-[#959596] group-hover:text-white"', 'className="ml-1 text-(--hex-959596) group-hover:text-white"'],
+ ],
+ },
+ {
+ file: "components/FeedCard.tsx",
+ replaceAll: [
+ ['isMuted ? "text-muted-foreground/70" : "text-[#959596]"', 'isMuted ? "text-muted-foreground/70" : "text-(--hex-959596)"'],
+ ],
+ },
+ {
+ file: "components/OnboardingWizard.tsx",
+ replaceAll: [
+ ['"hidden md:block overflow-hidden bg-[#1d1d1d] transition-[width,opacity] duration-500 ease-in-out"', '"hidden md:block overflow-hidden bg-(--hex-1d1d1d) transition-[width,opacity] duration-500 ease-in-out"'],
+ ],
+ },
+ {
+ file: "components/IssueChatThread.tsx",
+ replaceAll: [
+ ['// Liveness blue (#2563EB) for the human\'s own messages (PAP-95 rev 5).', '// Liveness blue (--status-task-in_progress) for the human\'s own messages (PAP-95 rev 5).'],
+ ['? "bg-[#2563EB] text-white"', '? "bg-(--status-task-in_progress) text-white"'],
+ ],
+ },
+ {
+ file: "components/IssueChatThread.test.tsx",
+ replaceAll: [
+ ['expect(bubble?.className).not.toContain("bg-[#2563EB]");', 'expect(bubble?.className).not.toContain("bg-(--status-task-in_progress)");'],
+ ],
+ },
+
+ // ── OrgChart.tsx status dot color map (pure style render) ─────────
+ {
+ file: "pages/OrgChart.tsx",
+ replaceAll: [
+ ['running: "#22d3ee",', 'running: "var(--hex-22d3ee)",'],
+ ['active: "#4ade80",', 'active: "var(--hex-4ade80)",'],
+ ['paused: "#facc15",\n idle: "#facc15",', 'paused: "var(--hex-facc15)",\n idle: "var(--hex-facc15)",'],
+ ['error: "#f87171",', 'error: "var(--hex-f87171)",'],
+ ['terminated: "#a3a3a3",', 'terminated: "var(--hex-a3a3a3)",'],
+ ['const defaultDotColor = "#a3a3a3";', 'const defaultDotColor = "var(--hex-a3a3a3)";'],
+ ],
+ },
+
+ // ── ActivityCharts.tsx priority + status color maps (pure style render) ──
+ {
+ file: "components/ActivityCharts.tsx",
+ replaceAll: [
+ ['critical: "#ef4444",', 'critical: "var(--hex-ef4444)",'],
+ ['high: "#f97316",', 'high: "var(--hex-f97316)",'],
+ ['medium: "#eab308",', 'medium: "var(--hex-eab308)",'],
+ ['low: "#6b7280",', 'low: "var(--hex-6b7280)",'],
+ ['todo: "#3b82f6",', 'todo: "var(--hex-3b82f6)",'],
+ ['in_progress: "#8b5cf6",', 'in_progress: "var(--hex-8b5cf6)",'],
+ ['in_review: "#a855f7",', 'in_review: "var(--hex-a855f7)",'],
+ ['done: "#10b981",', 'done: "var(--hex-10b981)",'],
+ ['blocked: "#ef4444",', 'blocked: "var(--hex-ef4444)",'],
+ ['cancelled: "#6b7280",', 'cancelled: "var(--hex-6b7280)",'],
+ ['backlog: "#64748b",', 'backlog: "var(--hex-64748b)",'],
+ ['backgroundColor: statusColors[s] ?? "#6b7280"', 'backgroundColor: statusColors[s] ?? "var(--hex-6b7280)"'],
+ ['color: statusColors[s] ?? "#6b7280"', 'color: statusColors[s] ?? "var(--hex-6b7280)"'],
+ ['rate >= 0.8 ? "#10b981" : rate >= 0.5 ? "#eab308" : "#ef4444"', 'rate >= 0.8 ? "var(--hex-10b981)" : rate >= 0.5 ? "var(--hex-eab308)" : "var(--hex-ef4444)"'],
+ ],
+ },
+
+ // ── Project-color-fallback pure-style-render sites (indigo #6366f1) ──
+ {
+ file: "pages/ProjectDetail.tsx",
+ replaceAll: [
+ ['backgroundColor: project.color ?? "#6366f1"', 'backgroundColor: project.color ?? "var(--hex-6366f1)"'],
+ ],
+ },
+ {
+ file: "pages/PipelineSettings.tsx",
+ replaceAll: [
+ ['backgroundColor: selectedAutomationProject.color ?? "#6366f1"', 'backgroundColor: selectedAutomationProject.color ?? "var(--hex-6366f1)"'],
+ ['backgroundColor: project?.color ?? "#6366f1"', 'backgroundColor: project?.color ?? "var(--hex-6366f1)"'],
+ ],
+ },
+ {
+ file: "components/issue-properties/IssueProperties.tsx",
+ replaceAll: [
+ ['backgroundColor: orderedProjects.find((p) => p.id === issue.projectId)?.color ?? "#6366f1"', 'backgroundColor: orderedProjects.find((p) => p.id === issue.projectId)?.color ?? "var(--hex-6366f1)"'],
+ ['backgroundColor: option.color ?? "#6366f1"', 'backgroundColor: option.color ?? "var(--hex-6366f1)"'],
+ ],
+ },
+ {
+ file: "components/NewIssueDialog.tsx",
+ replaceAll: [
+ ['backgroundColor: currentProject.color ?? "#6366f1"', 'backgroundColor: currentProject.color ?? "var(--hex-6366f1)"'],
+ ['backgroundColor: project?.color ?? "#6366f1"', 'backgroundColor: project?.color ?? "var(--hex-6366f1)"'],
+ ],
+ },
+
+ // ── Project-color-fallback pure-style-render sites (slate #64748b) ──
+ {
+ file: "pages/Routines.tsx",
+ replaceAll: [
+ ['backgroundColor: currentProject.color ?? "#64748b"', 'backgroundColor: currentProject.color ?? "var(--hex-64748b)"'],
+ ['backgroundColor: project?.color ?? "#64748b"', 'backgroundColor: project?.color ?? "var(--hex-64748b)"'],
+ ],
+ },
+ {
+ file: "components/MarkdownEditor.tsx",
+ replaceAll: [
+ ['backgroundColor: option.projectColor ?? "#64748b"', 'backgroundColor: option.projectColor ?? "var(--hex-64748b)"'],
+ ],
+ },
+ {
+ file: "components/RoutineRunVariablesDialog.tsx",
+ replaceAll: [
+ ['backgroundColor: selectedProject.color ?? "#64748b"', 'backgroundColor: selectedProject.color ?? "var(--hex-64748b)"'],
+ ['backgroundColor: project?.color ?? "#64748b"', 'backgroundColor: project?.color ?? "var(--hex-64748b)"'],
+ ],
+ },
+ {
+ file: "components/RoutineList.tsx",
+ replaceAll: [
+ ['backgroundColor: project?.color ?? "#64748b"', 'backgroundColor: project?.color ?? "var(--hex-64748b)"'],
+ ],
+ },
+ {
+ file: "components/routine-sections/editable-sections.tsx",
+ replaceAll: [
+ ['backgroundColor: currentProject.color ?? "#64748b"', 'backgroundColor: currentProject.color ?? "var(--hex-64748b)"'],
+ ['backgroundColor: project?.color ?? "#64748b"', 'backgroundColor: project?.color ?? "var(--hex-64748b)"'],
+ ],
+ },
+
+ // ── Gradient sites (verbatim value -> --gradient-extract-N token) ─
+ {
+ file: "pages/Dashboard.tsx",
+ replaceAll: [
+ ['bg-[linear-gradient(180deg,rgba(255,80,80,0.12),rgba(255,255,255,0.02))]', 'bg-(image:--gradient-extract-1)'],
+ ],
+ },
+ {
+ file: "pages/Costs.tsx",
+ replaceAll: [
+ ['bg-[linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02))]', 'bg-(image:--gradient-extract-2)'],
+ ],
+ },
+ {
+ file: "components/AccountingModelCard.tsx",
+ replaceAll: [
+ ['bg-[radial-gradient(circle_at_top_left,rgba(244,114,182,0.08),transparent_35%),radial-gradient(circle_at_bottom_right,rgba(56,189,248,0.1),transparent_32%)]', 'bg-(image:--gradient-extract-3)'],
+ ],
+ },
+ {
+ file: "components/BudgetIncidentCard.tsx",
+ replaceAll: [
+ ['bg-[linear-gradient(180deg,rgba(255,70,70,0.10),rgba(255,255,255,0.02))]', 'bg-(image:--gradient-extract-4)'],
+ ],
+ },
+ {
+ file: "pages/RunTranscriptUxLab.tsx",
+ replaceAll: [
+ ['bg-[radial-gradient(circle_at_top_left,rgba(8,145,178,0.08),transparent_36%),radial-gradient(circle_at_bottom_right,rgba(245,158,11,0.10),transparent_28%)]', 'bg-(image:--gradient-extract-5)'],
+ ['bg-[linear-gradient(135deg,rgba(8,145,178,0.08),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.08),transparent_40%),var(--background)]', 'bg-(image:--gradient-extract-6)'],
+ ],
+ },
+ {
+ file: "pages/ProfileSettings.tsx",
+ replaceAll: [
+ ['bg-[radial-gradient(circle_at_top_right,rgba(255,255,255,0.22),transparent_34%),radial-gradient(circle_at_bottom_left,rgba(255,255,255,0.08),transparent_36%)]', 'bg-(image:--gradient-extract-7)'],
+ ],
+ },
+ {
+ file: "pages/InviteUxLab.tsx",
+ replaceAll: [
+ ['bg-[radial-gradient(circle_at_top,rgba(8,145,178,0.18),transparent_48%),linear-gradient(180deg,rgba(15,23,42,0.96),rgba(2,6,23,1))]', 'bg-(image:--gradient-extract-8)'],
+ ['bg-[linear-gradient(135deg,rgba(8,145,178,0.10),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent_44%),var(--background)]', 'bg-(image:--gradient-extract-9)'],
+ ['bg-[linear-gradient(180deg,rgba(59,130,246,0.05),transparent_30%),var(--background)]', 'bg-(image:--gradient-extract-21)'],
+ ['bg-[linear-gradient(180deg,rgba(234,179,8,0.06),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-22)'],
+ ['bg-[linear-gradient(180deg,rgba(16,185,129,0.06),transparent_30%),var(--background)]', 'bg-(image:--gradient-extract-23)'],
+ ['bg-[linear-gradient(180deg,rgba(168,85,247,0.06),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-10)'],
+ ['bg-[linear-gradient(180deg,rgba(244,114,182,0.06),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-24)'],
+ ],
+ },
+ {
+ file: "pages/IssueChatUxLab.tsx",
+ replaceAll: [
+ ['bg-[linear-gradient(135deg,rgba(8,145,178,0.10),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent_44%),var(--background)]', 'bg-(image:--gradient-extract-9)'],
+ ['bg-[linear-gradient(180deg,rgba(168,85,247,0.06),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-10)'],
+ ['bg-[linear-gradient(180deg,rgba(16,185,129,0.06),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-11)'],
+ ['bg-[linear-gradient(180deg,rgba(6,182,212,0.05),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-12)'],
+ ['bg-[linear-gradient(180deg,rgba(59,130,246,0.06),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-13)'],
+ ['bg-[linear-gradient(180deg,rgba(168,85,247,0.05),transparent_26%),var(--background)]', 'bg-(image:--gradient-extract-14)'],
+ ['bg-[linear-gradient(180deg,rgba(245,158,11,0.08),transparent_26%),var(--background)]', 'bg-(image:--gradient-extract-15)'],
+ ],
+ },
+ {
+ file: "pages/SystemNoticeUxLab.tsx",
+ replaceAll: [
+ ['bg-[linear-gradient(135deg,rgba(245,158,11,0.10),transparent_28%),linear-gradient(180deg,rgba(8,145,178,0.08),transparent_44%),var(--background)]', 'bg-(image:--gradient-extract-16)'],
+ ['bg-[linear-gradient(180deg,rgba(245,158,11,0.05),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-17)'],
+ ['bg-[linear-gradient(180deg,rgba(8,145,178,0.05),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-18)'],
+ ['bg-[linear-gradient(180deg,rgba(244,63,94,0.05),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-19)'],
+ ['bg-[linear-gradient(180deg,rgba(16,185,129,0.05),transparent_28%),var(--background)]', 'bg-(image:--gradient-extract-20)'],
+ ],
+ },
+];
+
+// ── Allowlist — sites intentionally NOT rewritten (functional / third-party) ──
+// One entry per file; each also gets an inline
+// `/* token-extraction: allowlisted — ... */` comment injected at the site
+// (idempotent: only injected if not already present).
+const ALLOWLIST_COMMENTS = [
+ {
+ file: "pages/CompanyEnvironments.tsx",
+ anchor: 'background: "#0a0a0a",',
+ commentLine: " // token-extraction: allowlisted — xterm.js terminal theme config; functional third-party option object, not a rendered CSS value.",
+ },
+ {
+ file: "pages/CompanySettings.tsx",
+ anchor: ' <input\n type="color"',
+ commentLine: " {/* token-extraction: allowlisted — <input type=\"color\"> value must be a real hex string, not a var() reference. */}",
+ },
+ {
+ file: "components/issue-properties/IssueProperties.tsx",
+ anchor: 'const [newLabelColor, setNewLabelColor] = useState("#6366f1");',
+ commentLine: " // token-extraction: allowlisted — color-picker seed state, persisted into label-create payload; a var() string would break that payload.",
+ },
+ {
+ file: "pages/CompanySkills.tsx",
+ anchor: "const DISCOVERY_ACCENTS = [",
+ commentLine: "// token-extraction: allowlisted — skill.color is persisted/compared JS data (SkillCreateDraft), not just a rendered value; a var() string would corrupt it.",
+ },
+ {
+ file: "components/IssueColumns.tsx",
+ anchor: 'const accentColor = projectColor ?? "#64748b";',
+ commentLine: " // token-extraction: allowlisted — accentColor also feeds pickTextColorForPillBg() contrast math; a var() string can't be parsed as a hex color there.",
+ },
+ {
+ file: "components/CompanyPatternIcon.tsx",
+ anchor: "ctx.fillStyle = `rgb(${offR} ${offG} ${offB})`;",
+ commentLine: " // token-extraction: allowlisted — canvas 2D fillStyle computed at runtime from numeric channel props; not a static literal.",
+ },
+ {
+ file: "components/FileViewerSheet.tsx",
+ anchor: 'isHighlighted && "bg-[var(--paperclip-code-highlight-bg,rgba(250,204,21,0.12))]",',
+ commentLine: " // token-extraction: allowlisted — half-migrated var(--x, fallback) pattern; --paperclip-code-highlight-bg/-border don't exist in index.css yet. Needs human decision (see TOKEN-AUDIT.md 2) before minting, since defining the var changes a fallback-CSS-var-expression, not a plain literal swap.",
+ },
+ {
+ file: "pages/InviteUxLab.tsx",
+ anchor: ' <div className="flex items-start gap-4">\n <CompanyPatternIcon\n companyName="Acme Robotics"\n logoUrl="/api/invites/pcp_invite_test/logo"\n brandColor="#114488"\n className="h-16 w-16 rounded-none border border-zinc-800"',
+ commentLine: " {/* token-extraction: allowlisted — brandColor feeds CompanyPatternIcon's hexToHue() color math via a canvas fill; demo/showcase-only prop, not a rendered CSS value. */}",
+ },
+ {
+ file: "pages/InviteUxLab.tsx",
+ anchor: ' <div className="flex items-center gap-3">\n <CompanyPatternIcon\n companyName="Acme Robotics"\n logoUrl="/api/invites/pcp_invite_test/logo"\n brandColor="#114488"\n className="h-12 w-12 rounded-none border border-zinc-800"',
+ commentLine: " {/* token-extraction: allowlisted — brandColor feeds CompanyPatternIcon's hexToHue() color math via a canvas fill; demo/showcase-only prop, not a rendered CSS value. */}",
+ },
+];
+
+function applyReplacements(content, pairs, filePath) {
+ let next = content;
+ let count = 0;
+ for (const [find, replace] of pairs) {
+ if (next.includes(find)) {
+ next = next.split(find).join(replace);
+ count += 1;
+ } else if (!next.includes(replace)) {
+ // Neither the original nor the replacement is present — likely a
+ // stale site table entry; flag loudly rather than silently no-op.
+ console.warn(` ! WARNING: pattern not found (and not already applied) in ${filePath}:\n ${find.slice(0, 100)}`);
+ }
+ }
+ return { next, count };
+}
+
+function injectAllowlistComment(content, anchor, commentLine, filePath) {
+ if (content.includes(commentLine.trim())) return { next: content, injected: false }; // idempotent
+ const idx = content.indexOf(anchor);
+ if (idx === -1) {
+ console.warn(` ! WARNING: allowlist anchor not found in ${filePath}:\n ${anchor}`);
+ return { next: content, injected: false };
+ }
+ const lineStart = content.lastIndexOf("\n", idx) + 1;
+ const next = content.slice(0, lineStart) + commentLine + "\n" + content.slice(lineStart);
+ return { next, injected: true };
+}
+
+function main() {
+ let totalSitesRewritten = 0;
+ let filesChanged = 0;
+ const changedFiles = [];
+
+ for (const site of SITES) {
+ const filePath = resolve(UI_SRC, site.file);
+ const original = readFileSync(filePath, "utf8");
+ const { next, count } = applyReplacements(original, site.replaceAll, site.file);
+ if (next !== original) {
+ filesChanged += 1;
+ changedFiles.push(site.file);
+ if (!DRY_RUN) writeFileSync(filePath, next, "utf8");
+ }
+ totalSitesRewritten += count;
+ }
+
+ let allowlistInjections = 0;
+ for (const entry of ALLOWLIST_COMMENTS) {
+ const filePath = resolve(UI_SRC, entry.file);
+ const original = readFileSync(filePath, "utf8");
+ const { next, injected } = injectAllowlistComment(original, entry.anchor, entry.commentLine, entry.file);
+ if (injected) {
+ allowlistInjections += 1;
+ if (!DRY_RUN) writeFileSync(filePath, next, "utf8");
+ if (!changedFiles.includes(entry.file)) {
+ filesChanged += 1;
+ changedFiles.push(entry.file);
+ }
+ }
+ }
+
+ // ── index.css token block ──────────────────────────────────────────
+ const cssPath = resolve(UI_SRC, "index.css");
+ const cssOriginal = readFileSync(cssPath, "utf8");
+ const marker = "/* ── Extracted verbatim tokens (Phase 2, design/token-extraction) ── */";
+ let cssNext = cssOriginal;
+ let cssChanged = false;
+
+ if (!cssOriginal.includes(marker)) {
+ const tokenLines = NEW_TOKENS.map((t) => ` --${t.name}: ${t.value}; /* ${t.comment} */`).join("\n");
+ const block = `\n${marker}\n/* Batch 1/4: color literals only. Reused-from-existing-token sites (see\n TOKEN-AUDIT.md section 1.1) are NOT duplicated here — they reference\n --status-task-in_progress / --status-task-done directly at the call site.\n\n Allowlist (sites intentionally left as hardcoded / functional literals,\n NOT converted to tokens — each also carries an inline\n \`token-extraction: allowlisted\` comment at the site):\n - pages/CompanyEnvironments.tsx — xterm.js terminal theme config; functional JS values, third-party.\n - pages/CompanySettings.tsx — <input type="color"> value; functional form control, not a rendered value.\n - components/issue-properties/IssueProperties.tsx (newLabelColor) — color-picker seed persisted into label-create payload.\n - pages/CompanySkills.tsx (DISCOVERY_ACCENTS) — persisted/compared skill.color JS data, not just rendered.\n - components/IssueColumns.tsx (accentColor fallback) — also feeds pickTextColorForPillBg() contrast math.\n - components/CompanyPatternIcon.tsx — canvas fillStyle computed at runtime from numeric props, not a static literal.\n - components/FileViewerSheet.tsx — half-migrated var(--paperclip-code-highlight-*, fallback) pattern; needs human decision, see TOKEN-AUDIT.md section 2.\n - pages/InviteUxLab.tsx (brandColor prop, x2) — demo/showcase-only prop feeding CompanyPatternIcon's hexToHue() color math, not a rendered CSS value.\n*/\n:root {\n${tokenLines}\n}\n`;
+ cssNext = cssOriginal + block;
+ cssChanged = true;
+ }
+
+ if (cssChanged && !DRY_RUN) writeFileSync(cssPath, cssNext, "utf8");
+
+ // ── Summary ─────────────────────────────────────────────────────────
+ console.log(`\n${DRY_RUN ? "[DRY RUN] " : ""}codemod-extract-colors summary`);
+ console.log(` Sites rewritten: ${totalSitesRewritten}`);
+ console.log(` Component/page files changed: ${filesChanged}`);
+ console.log(` Allowlist comments injected: ${allowlistInjections}`);
+ console.log(` New tokens minted: ${NEW_TOKENS.length}`);
+ console.log(` Existing tokens reused: ${Object.keys(REUSE).length} (${Object.values(REUSE).join(", ")})`);
+ console.log(` index.css token block: ${cssChanged ? "added" : "already present (idempotent no-op)"}`);
+ if (changedFiles.length) {
+ console.log(`\n Changed files:`);
+ for (const f of changedFiles) console.log(` - ui/src/${f}`);
+ }
+}
+
+main();
diff --git a/scripts/codemod-extract-misc.mjs b/scripts/codemod-extract-misc.mjs
new file mode 100644
index 0000000000..f5a02b2795
--- /dev/null
+++ b/scripts/codemod-extract-misc.mjs
@@ -0,0 +1,599 @@
+#!/usr/bin/env node
+/**
+ * codemod-extract-misc.mjs
+ *
+ * Phase 2 (extraction), Batch 4/4 (final sweep) of the design-token audit
+ * (branch design/token-extraction). Replaces the remaining value-bearing
+ * arbitrary Tailwind bracket utilities in `ui/src/components/**` and
+ * `ui/src/pages/**` (including their *.test.tsx companions) with references
+ * to CSS custom-property tokens defined in `ui/src/index.css`.
+ *
+ * Patterns covered this batch:
+ * grid-cols-[...] / grid-rows-[...] -> --gtc-<n> / --gtr-<n> (track lists,
+ * deduped on exact string match)
+ * transition-[...] -> --tp-<slug> (property lists,
+ * deduped on exact string match)
+ * z-[...] -> --z-<n> (bare z-index scale values)
+ * scale-[...] -> --s-<slug>
+ * ease-[cubic-bezier(...)] -> --e-<slug>
+ * align-[...] -> --va-<slug> (vertical-align)
+ * stroke-[...] -> --sw-<slug> (SVG stroke-WIDTH,
+ * requires the `length:` hint)
+ * blur-[...] -> --blur-<slug>
+ * drop-shadow-[...] -> --drop-shadow-extract-<n> (its own
+ * family, separate from Batch 3's
+ * --shadow-extract-* box-shadow
+ * family — filter vs. box-shadow are
+ * different CSS properties, see
+ * TOKEN-AUDIT.md Batch 3 "Needs human
+ * decision")
+ * bg-[linear|radial|conic-gradient(...)] -> --gradient-extract-<n>,
+ * CONTINUING Batch 1's counter (not
+ * restarting it) - 2 sites that use
+ * hsl(var(...))/color-mix(...)
+ * CSS-native color functions rather
+ * than raw hex/rgb literals, so
+ * Batch 1's hand-audited color table
+ * did not catch them even though
+ * they are the same gradient-bracket
+ * shape.
+ * bg|text|border-[var(--x)] -> bare paren passthrough, no new
+ * (no fallback) token minted (same rule as Batch
+ * 3's var()-only case)
+ * bg|text|border-[var(--x,fallback)] -> mints a --*-resolved wrapper token
+ * (fallback form) whose value is `var(--x, fallback)`
+ * verbatim (paren-with-fallback-comma
+ * does not parse in Tailwind v4 —
+ * confirmed in the Step 0 spike --
+ * so the fallback expression itself
+ * must live in the CSS token, not in
+ * the utility). theme(colors.a.b)
+ * fallbacks are resolved to their
+ * BUILT-CSS equivalent var(...) form
+ * first (inspected from
+ * storybook-static output before
+ * writing this codemod - theme() is
+ * a Tailwind build-time function).
+ *
+ * NOT rewritten (documented, not a bug):
+ * - Selector/variant brackets (data-[...], group-data-[...], has-[...],
+ * aria-[...], supports-[...], etc.) are CSS selector conditions, not
+ * visual values - out of scope for this codemod BY DEFINITION (see
+ * check-token-gates.mjs header for the same distinction, gate 2).
+ * - tw-animate/animate-plugin arbitrary utilities (zoom-in-[0.97],
+ * zoom-out-[0.97], slide-in-from-top-[1%], slide-out-to-top-[1%]) plus
+ * their siblings (animate-in, animate-out, fade-in-0, fade-out-0):
+ * confirmed via the Step 0 spike that NONE of these compile to any CSS
+ * at all in this repo's build (no tw-animate-css plugin is installed,
+ * and no @utility overrides exist in index.css) - grep of the built
+ * storybook-static CSS shows zero occurrences of "animate-in", "zoom",
+ * "slide-in-from-top", etc. These are dead, no-op class names with zero
+ * rendered visual value today, so there is nothing to tokenize; touching
+ * them would not preserve OR change any pixel. Left untouched and
+ * allowlisted (third-party plugin syntax, retained for whenever
+ * tw-animate-css is actually installed) rather than silently deleted,
+ * since deleting dead classes is itself a (no-op but non-mechanical)
+ * edit outside this batch's mandate.
+ * - max-[480px] / min-[420px] breakpoint variants and rounded-[inherit]:
+ * documented allowlist entries, not code the codemod touches (variant
+ * position cannot reference a CSS custom property; `inherit` is a
+ * keyword). See ALLOWLIST block in index.css.
+ *
+ * Idempotent: the FIND regexes only match the ORIGINAL bracket-literal form;
+ * once rewritten the pattern no longer matches, so re-running is a no-op.
+ *
+ * Usage: node scripts/codemod-extract-misc.mjs [--check]
+ * --check Report what WOULD change without writing files (dry run).
+ */
+
+import { readFileSync, writeFileSync, readdirSync } from "node:fs";
+import { resolve, dirname, join, relative } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(__dirname, "..");
+const UI_SRC = resolve(REPO_ROOT, "ui/src");
+const SCAN_DIRS = ["components", "pages"];
+
+const DRY_RUN = process.argv.includes("--check");
+
+// ── Helpers ────────────────────────────────────────────────────────────
+function walk(dir, out) {
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const p = join(dir, entry.name);
+ if (entry.isDirectory()) walk(p, out);
+ else if (/\.(tsx?|jsx?)$/.test(entry.name)) out.push(p);
+ }
+}
+
+// Tailwind bracket-escaping uses `_` for literal spaces; reverse it before
+// writing into a real CSS custom property value (Batch 1's gradient gotcha,
+// generalized in Batch 3, applies again here for grid track lists / calc
+// expressions embedded in transition/ease values).
+function unescapeSpaces(value) {
+ return value.replace(/_/g, " ");
+}
+
+// "320" "0.7rem" "-50" "auto_minmax(0,1fr)" etc -> safe token-name suffix.
+// Dots become underscores, spaces/commas/parens/percent become hyphens,
+// collapsed and trimmed (matches Batch 1-3's `--fs-0_7rem`-style convention
+// for numeric suffixes; grid/transition/ease values use a slug instead since
+// their content isn't a single number).
+function slugify(value) {
+ return value
+ .trim()
+ .replace(/_/g, " ")
+ .replace(/\./g, "_")
+ .replace(/[^a-zA-Z0-9_]+/g, "-")
+ .replace(/-+/g, "-")
+ .replace(/^-|-$/g, "")
+ .toLowerCase();
+}
+
+// ── Token registries ────────────────────────────────────────────────────
+const gtcTokens = new Map(); // --gtc-<n> grid-template-columns
+const gtrTokens = new Map(); // --gtr-<n> grid-template-rows
+const tpTokens = new Map(); // --tp-<slug> transition-property lists
+const zTokens = new Map(); // --z-<n>
+const sTokens = new Map(); // --s-<slug> scale
+const eTokens = new Map(); // --e-<slug> ease / timing-function
+const vaTokens = new Map(); // --va-<slug> vertical-align
+const swTokens = new Map(); // --sw-<slug> stroke-width
+const blurTokens = new Map(); // --blur-<slug>
+const dropShadowTokens = new Map(); // --drop-shadow-extract-<n>
+const resolvedVarTokens = new Map(); // --*-resolved wrapper tokens (fallback var() forms)
+// --gradient-extract-<n> continuing Batch 1's family/counter (these 2 sites
+// use hsl(var(...))/color-mix(...) CSS-native color functions rather than
+// raw hex/rgb literals, which is why Batch 1's hand-audited color-literal
+// table did not catch them - they're still a value-bearing gradient bracket,
+// in scope for this batch's "remaining bracket utilities" sweep).
+const gradientTokens = new Map();
+
+let gtcCounter = 0;
+let gtrCounter = 0;
+let dropShadowCounter = 0;
+// Batch 1 minted --gradient-extract-1 through --gradient-extract-24; this
+// batch's new gradient sites continue that numbering, not restart it.
+let gradientCounter = 24;
+
+const gtcByValue = new Map();
+function registerGtcToken(unescapedValue, sourceNote) {
+ if (gtcByValue.has(unescapedValue)) return gtcByValue.get(unescapedValue);
+ gtcCounter += 1;
+ const name = `gtc-${gtcCounter}`;
+ gtcTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ gtcByValue.set(unescapedValue, name);
+ return name;
+}
+
+const gtrByValue = new Map();
+function registerGtrToken(unescapedValue, sourceNote) {
+ if (gtrByValue.has(unescapedValue)) return gtrByValue.get(unescapedValue);
+ gtrCounter += 1;
+ const name = `gtr-${gtrCounter}`;
+ gtrTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ gtrByValue.set(unescapedValue, name);
+ return name;
+}
+
+function registerTpToken(unescapedValue, sourceNote) {
+ const slug = slugify(unescapedValue.replace(/,/g, " "));
+ const name = `tp-${slug}`;
+ if (!tpTokens.has(name)) tpTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+function registerZToken(rawNum, sourceNote) {
+ const name = `z-${rawNum}`;
+ if (!zTokens.has(name)) zTokens.set(name, { value: rawNum, comment: sourceNote });
+ return name;
+}
+
+function registerSToken(unescapedValue, sourceNote) {
+ const slug = slugify(unescapedValue);
+ const name = `s-${slug}`;
+ if (!sTokens.has(name)) sTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+function registerEToken(unescapedValue, sourceNote) {
+ const slug = slugify(unescapedValue);
+ const name = `e-${slug}`;
+ if (!eTokens.has(name)) eTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+function registerVaToken(unescapedValue, sourceNote) {
+ const slug = slugify(unescapedValue);
+ const name = `va-${slug}`;
+ if (!vaTokens.has(name)) vaTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+function registerSwToken(unescapedValue, sourceNote) {
+ const slug = slugify(unescapedValue);
+ const name = `sw-${slug}`;
+ if (!swTokens.has(name)) swTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+function registerBlurToken(unescapedValue, sourceNote) {
+ const slug = slugify(unescapedValue);
+ const name = `blur-${slug}`;
+ if (!blurTokens.has(name)) blurTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+const gradientByValue = new Map();
+function registerGradientToken(unescapedValue, sourceNote) {
+ if (gradientByValue.has(unescapedValue)) return gradientByValue.get(unescapedValue);
+ gradientCounter += 1;
+ const name = `gradient-extract-${gradientCounter}`;
+ gradientTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ gradientByValue.set(unescapedValue, name);
+ return name;
+}
+
+const dropShadowByValue = new Map();
+function registerDropShadowToken(unescapedValue, sourceNote) {
+ if (dropShadowByValue.has(unescapedValue)) return dropShadowByValue.get(unescapedValue);
+ dropShadowCounter += 1;
+ const name = `drop-shadow-extract-${dropShadowCounter}`;
+ dropShadowTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ dropShadowByValue.set(unescapedValue, name);
+ return name;
+}
+
+// Wrapper tokens for the var(--x, fallback) forms that can't use the
+// paren-with-fallback-comma shorthand (confirmed unsupported in the Step 0
+// spike). theme(colors.a.b) fallbacks are resolved to the equivalent
+// var(--token) form the Tailwind build already resolves them to today
+// (inspected in ui/storybook-static/assets/*.css before writing this
+// codemod - theme() is a Tailwind build-time function and cannot appear
+// inside a runtime custom property).
+const THEME_COLOR_MAP = {
+ "theme(colors.muted.DEFAULT)": "var(--muted)",
+ "theme(colors.muted.foreground)": "var(--muted-foreground)",
+};
+
+function resolveThemeColor(raw) {
+ let out = raw;
+ for (const [from, to] of Object.entries(THEME_COLOR_MAP)) {
+ out = out.split(from).join(to);
+ }
+ return out;
+}
+
+function registerResolvedVarToken(varName, fallbackRaw, sourceNote) {
+ // varName like "--paperclip-code-highlight-bg" -> token name
+ // "code-highlight-bg-resolved" (strip the leading "--paperclip-" prefix
+ // for readability, matching the mission's suggested name for the first
+ // site; other vars in the same family follow the same convention).
+ const bare = varName.replace(/^--paperclip-/, "").replace(/^--/, "");
+ const name = `${bare}-resolved`;
+ const fallback = resolveThemeColor(fallbackRaw);
+ const value = `var(${varName}, ${fallback})`;
+ if (!resolvedVarTokens.has(name)) resolvedVarTokens.set(name, { value, comment: sourceNote });
+ return name;
+}
+
+// ── Regexes ──────────────────────────────────────────────────────────────
+// Every regex requires the utility to start at a genuine class-token
+// boundary (preceded by whitespace, a quote/backtick, template-literal `${`,
+// or start-of-string) - see Batch 3's BOUNDARY GOTCHA. `:` is included for
+// variant prefixes (`data-[state=open]:`, `sm:`, etc.).
+const BOUNDARY = String.raw`(?<=^|[\s"'\`{:])`;
+
+const GRID_COLS_RE = new RegExp(`${BOUNDARY}(!?)grid-cols-\\[([^\\]]+)\\]`, "g");
+const GRID_ROWS_RE = new RegExp(`${BOUNDARY}(!?)grid-rows-\\[([^\\]]+)\\]`, "g");
+const TRANSITION_RE = new RegExp(`${BOUNDARY}(!?)transition-\\[([^\\]]+)\\]`, "g");
+const Z_RE = new RegExp(`${BOUNDARY}(!?)z-\\[([0-9]+)\\]`, "g");
+const SCALE_RE = new RegExp(`${BOUNDARY}(!?)scale-\\[([^\\]]+)\\]`, "g");
+const EASE_RE = new RegExp(`${BOUNDARY}(!?)ease-\\[([^\\]]+)\\]`, "g");
+const ALIGN_RE = new RegExp(`${BOUNDARY}(!?)align-\\[([^\\]]+)\\]`, "g");
+const STROKE_RE = new RegExp(`${BOUNDARY}(!?)stroke-\\[([^\\]]+)\\]`, "g");
+// NOTE: negative lookbehind isn't reliably portable across regex engines at
+// the boundary position used elsewhere, so drop-shadow is matched with its
+// own explicit prefix (drop-shadow-) which never collides with bare blur-.
+// Matches both bare `blur-[...]` and `backdrop-blur-[...]` (the latter's
+// `backdrop-` prefix means `blur` doesn't start at a class-token BOUNDARY,
+// so it needs its own alternative rather than relying on the shared
+// boundary-anchored pattern).
+const BLUR_RE = new RegExp(`${BOUNDARY}(!?)(backdrop-blur|blur)-\\[([^\\]]+)\\]`, "g");
+const DROP_SHADOW_RE = new RegExp(`${BOUNDARY}(!?)drop-shadow-\\[([^\\]]+)\\]`, "g");
+
+// bg-[linear-gradient(...)] / bg-[radial-gradient(...)] / bg-[conic-gradient(...)]
+// - continuing Batch 1's --gradient-extract-* family (see registerGradientToken).
+// Matched separately from the generic VAR_* regexes below since these are not
+// var() passthrough; they need the `image:` paren hint (Batch 1 convention).
+const GRADIENT_RE = new RegExp(
+ `${BOUNDARY}(!?)bg-\\[((?:linear|radial|conic)-gradient\\([^\\]]*\\))\\]`,
+ "g",
+);
+
+// bg|text|border-[var(--x)] (no fallback) and bg|text|border-[var(--x,fallback)]
+// (with fallback). The fallback variant's raw capture includes everything up
+// to the matching `)]` - since none of these fallback values contain nested
+// brackets, a simple `[^\]]+` capture is safe (verified by inspection of all
+// matching sites in this batch).
+const VAR_NOFALLBACK_RE = new RegExp(
+ `${BOUNDARY}(!?)(bg|text|border)-\\[var\\((--[a-zA-Z0-9-]+)\\)\\]`,
+ "g",
+);
+const VAR_FALLBACK_RE = new RegExp(
+ `${BOUNDARY}(!?)(bg|text|border)-\\[var\\((--[a-zA-Z0-9-]+),([^\\]]+)\\)\\]`,
+ "g",
+);
+
+function rewriteFile(filePath, relPath) {
+ const original = readFileSync(filePath, "utf8");
+ let content = original;
+ let siteCount = 0;
+
+ content = content.replace(GRID_COLS_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (grid-cols-[${raw}]).`;
+ const name = registerGtcToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}grid-cols-(--${name})`;
+ });
+
+ content = content.replace(GRID_ROWS_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (grid-rows-[${raw}]).`;
+ const name = registerGtrToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}grid-rows-(--${name})`;
+ });
+
+ content = content.replace(TRANSITION_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (transition-[${raw}]).`;
+ const name = registerTpToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}transition-(--${name})`;
+ });
+
+ content = content.replace(Z_RE, (match, bang, raw) => {
+ const sourceNote = `Extracted from ${relPath} (z-[${raw}]).`;
+ const name = registerZToken(raw, sourceNote);
+ siteCount++;
+ return `${bang}z-(--${name})`;
+ });
+
+ content = content.replace(SCALE_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (scale-[${raw}]).`;
+ const name = registerSToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}scale-(--${name})`;
+ });
+
+ content = content.replace(EASE_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (ease-[${raw}]).`;
+ const name = registerEToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}ease-(--${name})`;
+ });
+
+ content = content.replace(ALIGN_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (align-[${raw}]).`;
+ const name = registerVaToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}align-(--${name})`;
+ });
+
+ content = content.replace(STROKE_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (stroke-[${raw}]).`;
+ const name = registerSwToken(unescaped, sourceNote);
+ siteCount++;
+ // stroke-WIDTH requires the `length:` hint (bare stroke-(--x) is
+ // ambiguous with the stroke-COLOR utility) - confirmed in Step 0 spike.
+ return `${bang}stroke-(length:--${name})`;
+ });
+
+ content = content.replace(DROP_SHADOW_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (drop-shadow-[${raw}]).`;
+ const name = registerDropShadowToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}drop-shadow-(--${name})`;
+ });
+
+ // Gradient bg-[...] brackets must be rewritten BEFORE the generic var()
+ // passthrough regexes below (a gradient value can itself contain
+ // `var(--x)` sub-expressions, e.g. hsl(var(--primary)), which the generic
+ // VAR_NOFALLBACK_RE must not also try to match against the outer bg-[...]).
+ content = content.replace(GRADIENT_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (bg-[${raw}]).`;
+ const name = registerGradientToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}bg-(image:--${name})`;
+ });
+
+ content = content.replace(BLUR_RE, (match, bang, util, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (${util}-[${raw}]).`;
+ const name = registerBlurToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}${util}-(--${name})`;
+ });
+
+ // var(--x, fallback) forms MUST be rewritten before the no-fallback form
+ // (which would otherwise partially match the `var(--x` prefix of a
+ // fallback expression and corrupt it - the fallback regex requires a
+ // literal comma so there's no real ambiguity, but ordering fallback-first
+ // keeps the intent explicit and avoids relying on regex engine match order).
+ content = content.replace(VAR_FALLBACK_RE, (match, bang, util, varName, fallbackRaw) => {
+ const sourceNote = `Extracted from ${relPath} (${util}-[var(${varName},${fallbackRaw})]).`;
+ const name = registerResolvedVarToken(varName, fallbackRaw, sourceNote);
+ siteCount++;
+ return `${bang}${util}-(--${name})`;
+ });
+
+ content = content.replace(VAR_NOFALLBACK_RE, (match, bang, util, varName) => {
+ siteCount++;
+ // Bare var() passthrough - no new token minted, per DESIGN.md/Batch 3's
+ // special case for runtime library/component variables. Here the vars
+ // already exist as first-class design tokens in index.css (--chip-match-*),
+ // so this is a pure syntax modernization, not a token mint.
+ return `${bang}${util}-(${varName})`;
+ });
+
+ if (content !== original && !DRY_RUN) {
+ writeFileSync(filePath, content, "utf8");
+ }
+ return { changed: content !== original, siteCount };
+}
+
+function main() {
+ const files = [];
+ for (const dir of SCAN_DIRS) walk(resolve(UI_SRC, dir), files);
+ files.sort();
+
+ let totalSites = 0;
+ let filesChanged = 0;
+ const changedFiles = [];
+
+ for (const filePath of files) {
+ const relPath = "ui/src/" + relative(UI_SRC, filePath);
+ const { changed, siteCount } = rewriteFile(filePath, relPath);
+ if (changed) {
+ filesChanged++;
+ changedFiles.push(relPath);
+ }
+ totalSites += siteCount;
+ }
+
+ // ── index.css token block ──────────────────────────────────────────
+ const cssPath = resolve(UI_SRC, "index.css");
+ const cssOriginal = readFileSync(cssPath, "utf8");
+ const marker = "/* ── Extracted verbatim MISC tokens (Phase 2 Batch 4, design/token-extraction) ── */";
+ let cssNext = cssOriginal;
+ let cssChanged = false;
+
+ const anyTokens =
+ gtcTokens.size ||
+ gtrTokens.size ||
+ tpTokens.size ||
+ zTokens.size ||
+ sTokens.size ||
+ eTokens.size ||
+ vaTokens.size ||
+ swTokens.size ||
+ blurTokens.size ||
+ dropShadowTokens.size ||
+ resolvedVarTokens.size ||
+ gradientTokens.size;
+
+ if (!cssOriginal.includes(marker) && anyTokens) {
+ const lines = [];
+ lines.push(marker);
+ lines.push("/* Batch 4/4 (final sweep): grid track lists, transition-property");
+ lines.push(" lists, z-index, scale, easing, vertical-align, stroke-width, blur,");
+ lines.push(" drop-shadow, and half-migrated var(x, fallback) color forms,");
+ lines.push(" verbatim (no normalizing - the human scale-collapse decision comes");
+ lines.push(" later per DESIGN.md/TOKEN-AUDIT.md). --gtc-* and --gtr-* and --tp-* are");
+ lines.push(" sequentially numbered / slugged since their content (track lists,");
+ lines.push(" property lists) is not safely nameable by value alone.");
+ lines.push("");
+ lines.push(" drop-shadow (a CSS filter function) gets its own");
+ lines.push(" --drop-shadow-extract-* family, kept separate from Batch 3's");
+ lines.push(" --shadow-extract-* box-shadow family per that batch's logged");
+ lines.push(" human-decision note.");
+ lines.push("");
+ lines.push(" *-resolved wrapper tokens hold a verbatim var(--x, fallback)");
+ lines.push(" expression for sites where Tailwind v4's paren-with-fallback-comma");
+ lines.push(" shorthand does not parse (confirmed unsupported in this batch's");
+ lines.push(" Step 0 syntax spike). theme(colors.a.b) fallbacks were resolved to");
+ lines.push(" the equivalent var(--token) form the Tailwind build already");
+ lines.push(" compiles them to today (inspected byte-for-byte from the built");
+ lines.push(" storybook-static CSS before this codemod ran: theme(colors.muted.DEFAULT)");
+ lines.push(" -> var(--muted), theme(colors.muted.foreground) -> var(--muted-foreground)).");
+ lines.push("");
+ lines.push(" --gradient-extract-* here CONTINUES Batch 1's counter (Batch 1 minted");
+ lines.push(" 1 through 24) rather than restarting it - these 2 sites use");
+ lines.push(" hsl(var(...))/color-mix(...) CSS-native color functions rather than raw");
+ lines.push(" hex/rgb literals, which is why Batch 1's hand-audited color-literal");
+ lines.push(" table did not catch them, but they are still value-bearing gradient");
+ lines.push(" brackets in scope for this batch's final sweep.");
+ lines.push("");
+ lines.push(" Allowlist (sites intentionally left as-is - see ALLOWLIST doc-comment");
+ lines.push(" at the end of this file for the machine-readable list consumed by");
+ lines.push(" scripts/check-token-gates.mjs):");
+ lines.push(" allow ui/src/components/ui/dialog.tsx — tw-animate-css plugin utilities (zoom-in-[0.97] etc.) are dead/no-op classes today (plugin not installed, verified via built-CSS grep); nothing to tokenize without visually changing a currently-inert class");
+ lines.push(" allow ui/src/components/ui/alert-dialog.tsx — same tw-animate-css dead-class situation as dialog.tsx");
+ lines.push("*/");
+ lines.push(":root {");
+ for (const [name, { value, comment }] of gtcTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of gtrTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of tpTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of zTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of sTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of eTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of vaTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of swTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of blurTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of dropShadowTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of resolvedVarTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of gradientTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ lines.push("}");
+ const block = "\n" + lines.join("\n") + "\n";
+ cssNext = cssOriginal + block;
+ cssChanged = true;
+ }
+
+ if (cssChanged && !DRY_RUN) writeFileSync(cssPath, cssNext, "utf8");
+
+ // ── Summary ─────────────────────────────────────────────────────────
+ console.log(`\n${DRY_RUN ? "[DRY RUN] " : ""}codemod-extract-misc summary`);
+ console.log(` Sites rewritten: ${totalSites}`);
+ console.log(` Files changed: ${filesChanged}`);
+ console.log(` New --gtc-*: ${gtcTokens.size}`);
+ console.log(` New --gtr-*: ${gtrTokens.size}`);
+ console.log(` New --tp-*: ${tpTokens.size}`);
+ console.log(` New --z-*: ${zTokens.size}`);
+ console.log(` New --s-*: ${sTokens.size}`);
+ console.log(` New --e-*: ${eTokens.size}`);
+ console.log(` New --va-*: ${vaTokens.size}`);
+ console.log(` New --sw-*: ${swTokens.size}`);
+ console.log(` New --blur-*: ${blurTokens.size}`);
+ console.log(` New --drop-shadow-extract-*: ${dropShadowTokens.size}`);
+ console.log(` New *-resolved wrapper: ${resolvedVarTokens.size}`);
+ console.log(` New --gradient-extract-* (continuing Batch 1): ${gradientTokens.size}`);
+ console.log(` index.css token block: ${cssChanged ? "added" : "already present or nothing to add (idempotent no-op)"}`);
+ if (changedFiles.length) {
+ console.log(`\n Changed files:`);
+ for (const f of changedFiles) console.log(` - ${f}`);
+ }
+}
+
+main();
diff --git a/scripts/codemod-extract-sizes.mjs b/scripts/codemod-extract-sizes.mjs
new file mode 100644
index 0000000000..666c641e8a
--- /dev/null
+++ b/scripts/codemod-extract-sizes.mjs
@@ -0,0 +1,517 @@
+#!/usr/bin/env node
+/**
+ * codemod-extract-sizes.mjs
+ *
+ * Phase 2 (extraction), Batch 3/4 of the design-token audit
+ * (branch design/token-extraction). Replaces hardcoded SIZE / SPACING /
+ * RADIUS / SHADOW arbitrary Tailwind bracket values in
+ * `ui/src/components/**` and `ui/src/pages/**` (including their
+ * *.test.tsx companions) with references to CSS custom-property tokens
+ * defined in `ui/src/index.css`.
+ *
+ * Patterns covered (all unambiguous bracket-literal Tailwind utilities —
+ * like Batch 2's font-size/tracking sweep, a blanket regex is safe here
+ * because none of these utility prefixes have a non-dimensional meaning):
+ * w-[...] h-[...] size-[...] min-w-[...] max-w-[...] min-h-[...] max-h-[...]
+ * p-[...] pt/pb/pl/pr/px/py-[...] m-[...] mt/mb/ml/mr/mx/my-[...]
+ * gap-[...] gap-x-[...] gap-y-[...]
+ * inset-[...] inset-x/y-[...] top/left/right/bottom-[...]
+ * translate-x-[...] translate-y-[...]
+ * rounded-[...] and directional rounded-t/r/b/l/tl/tr/br/bl-[...]
+ * shadow-[...] ring-[...] outline-[...]
+ * `!`-important-prefixed utilities (`!max-w-[90%]`) and variant/arbitrary-
+ * variant prefixes (`sm:`, `dark:`, `[&>x]:`, etc.) are preserved verbatim —
+ * the regex only rewrites the bracket portion itself.
+ *
+ * BOUNDARY GOTCHA (found + fixed during this batch's dry run): a naive
+ * `\b(top|left|right|bottom)-\[...\]` regex false-positives on Tailwind's
+ * OWN compound animation utilities `slide-out-to-top-[1%]` /
+ * `slide-in-from-top-[1%]` (`components/ui/dialog.tsx`,
+ * `components/ui/alert-dialog.tsx`) — `\b` matches at the `-to-top`
+ * boundary because `-` is not a word character, so the regex would rewrite
+ * only the `top-[1%]` tail of a longer utility name and silently corrupt
+ * `slide-out-to-top-[1%]` into `slide-out-to-top-(--pct-1)` (which Tailwind
+ * would not recognize as the `slide-out-to-top-*` animation-direction
+ * utility at all — a real visual regression, not just a naming nit). Fixed
+ * by requiring the utility name to start at a genuine class-token boundary
+ * (preceded by whitespace, a quote character, backtick, template-literal
+ * `${`, or the start of the string) rather than a bare `\b`.
+ *
+ * Token naming (verbatim value, no normalizing/rounding/unit-conversion):
+ * --sz-<value><unit> width/height/spacing lengths — ONE shared family so
+ * identical values dedupe across w/h/p/m/gap/inset/etc.
+ * e.g. --sz-320: 320px; --sz-0_7rem: 0.7rem;
+ * --sz-85vh: 85vh; --sz-24ch: 24ch;
+ * --sz-calc-<n> calc(...)/min()/max()/clamp() forms, sequentially
+ * numbered (values are not safely nameable by content
+ * without ambiguity), each with an inline comment.
+ * --sz-safe-<edge> bare env(safe-area-inset-<edge>) forms, verbatim.
+ * --pct-<N> bare percentage values, e.g. --pct-50: 50%;
+ * --pct-neg-<N> negative percentage values as they literally
+ * appear in the bracket (e.g. translate-x-[-50%]),
+ * e.g. --pct-neg-50: -50%; (kept as a DISTINCT token
+ * from --pct-50 rather than negated at the utility
+ * level, since the source bracket already carries the
+ * minus sign inside the value, not as a utility
+ * prefix — see Step 0 spike notes in TOKEN-AUDIT.md).
+ * --rad-<value> radius/ring/outline width values (unitless numeric
+ * suffix, unit implied px unless the source used a
+ * different unit, in which case the unit is appended
+ * to the name for disambiguation), e.g. --rad-8: 8px;
+ * --shadow-extract-<n> shadow values verbatim (multi-stop shadows are not
+ * nameable by content), each with an inline comment.
+ * Underscore-to-space reversal applied (Tailwind's
+ * own bracket-escaping convention; see Batch 1's
+ * gradient gotcha, generalized here to shadows).
+ *
+ * CALC-SPACING GOTCHA (Batch 1's underscore lesson, generalized): Tailwind's
+ * bracket escaping uses `_` for literal spaces (`calc(-50%_-_2px)`), but
+ * `calc(100%-2rem)` (WITHOUT underscores, i.e. no space around the operator
+ * AT ALL in the original bracket) is *also* present in this codebase and is
+ * INVALID CSS once lifted verbatim into a custom property — verified via a
+ * headless-browser Step 0 spike: `calc(100%-2rem)` silently drops (falls
+ * back to the containing block's width) while `calc(100% - 2rem)` (spaces
+ * added) computes correctly. Every calc() lifted into a token by this
+ * codemod therefore has spaces normalized around its top-level `+`/`-`
+ * operators (percent/length arithmetic), in addition to underscore reversal.
+ *
+ * Tailwind v4 paren-shorthand rewrite forms used (confirmed via mandatory
+ * Step-0 syntax spike — scratch story + `pnpm build-storybook` + grep of
+ * emitted CSS, then deleted before this codemod ran):
+ * w-[320px] -> w-(--sz-320) width:var(--sz-320)
+ * max-h-[85vh] -> max-h-(--sz-85vh) max-height:var(...)
+ * p-[18px] -> p-(--sz-18) padding:var(...)
+ * gap-[3px] -> gap-(--sz-3) gap:var(...)
+ * rounded-[8px] -> rounded-(--rad-8) border-radius
+ * rounded-br-[4px] -> rounded-br-(--rad-4) border-bottom-right-radius
+ * shadow-[...] -> shadow-(--shadow-extract-N) box-shadow (bare
+ * form works — no `shadow:` hint needed; verified
+ * identical emitted rule to the hinted form).
+ * top-[50%] -> top-(--pct-50) top:var(...)
+ * translate-x-[-50%] -> translate-x-(--pct-neg-50) --tw-translate-x:var(...)
+ * pb-[env(safe-area-inset-bottom)] -> pb-(--sz-safe-bottom) padding-bottom
+ * w-[var(--radix-popover-trigger-width)] -> w-(--radix-popover-trigger-width)
+ * (brackets that only wrap a var() reference a runtime library variable
+ * directly — no new token minted, per DESIGN.md special-case guidance).
+ *
+ * ring-[Npx] / outline-[Npx] note: `ring`/`outline` are box-shadow/outline-
+ * width utilities whose bracket form sets a WIDTH, not a generic length or
+ * shadow value — and `ring`/`outline` ALSO have color-bracket forms
+ * (`ring-[#hex]`). The correct paren-shorthand hint is `ring-(length:--x)` /
+ * `outline-(length:--x)` (spiked and confirmed correct — a bare `ring-(--x)`
+ * would be ambiguous the same way `text-(--x)` is). No ring/outline color-
+ * bracket sites exist in this codebase (verified during Step 0 inventory),
+ * so only the width form is handled.
+ *
+ * `calc(theme(spacing.N)±Mpx)` forms (components/IssueRow.tsx): theme() is a
+ * Tailwind BUILD-TIME function and does not work inside a runtime CSS custom
+ * property. This codemod resolves theme(spacing.N) using Tailwind v4's
+ * default `--spacing: 0.25rem` base (confirmed via Step 0: no `--spacing`
+ * override exists in index.css, and the ACTUAL BUILT CSS for these exact
+ * classes was inspected before this codemod ran and shows
+ * `padding-left:calc(.5rem - 2px)` / `calc(.25rem - 2px)` for
+ * theme(spacing.2)/theme(spacing.1) respectively, and a plain
+ * `margin-left:1.25rem` for the fully-constant
+ * theme(spacing.3)+theme(spacing.2) expression, i.e. Tailwind pre-resolves
+ * it when both operands are compile-time constants). The resolved-equivalent
+ * calc() is minted as the token value (byte-equivalent computed output
+ * verified via headless-browser spike, see TOKEN-AUDIT.md Batch 3 log).
+ *
+ * Idempotent: the FIND regex only matches the ORIGINAL bracket-literal form;
+ * once rewritten the pattern no longer matches, so re-running is a no-op.
+ *
+ * Usage: node scripts/codemod-extract-sizes.mjs [--check]
+ * --check Report what WOULD change without writing files (dry run).
+ */
+
+import { readFileSync, writeFileSync, readdirSync } from "node:fs";
+import { resolve, dirname, join, relative } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(__dirname, "..");
+const UI_SRC = resolve(REPO_ROOT, "ui/src");
+const SCAN_DIRS = ["components", "pages"];
+
+const DRY_RUN = process.argv.includes("--check");
+
+// ── Helpers ────────────────────────────────────────────────────────────
+function walk(dir, out) {
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const p = join(dir, entry.name);
+ if (entry.isDirectory()) walk(p, out);
+ else if (/\.(tsx?|jsx?)$/.test(entry.name)) out.push(p);
+ }
+}
+
+// Tailwind bracket-escaping uses `_` for literal spaces; reverse it before
+// writing into a real CSS custom property value. No site in this batch uses
+// `\_` (escaped underscore meaning a LITERAL underscore) — verified by
+// inspection of every match — so a plain global replace is safe.
+function unescapeSpaces(value) {
+ return value.replace(/_/g, " ");
+}
+
+// Ensures whitespace around top-level +/- operators inside calc()/min()/
+// max()/clamp() so the expression is valid once it's the value of a runtime
+// custom property (see CALC-SPACING GOTCHA in the header comment).
+//
+// DELIBERATELY NARROW: only rewrites a +/- whose LEFT side is a number,
+// number+unit, or a closing paren `)`, and whose RIGHT side is a number or
+// the start of a known CSS value-function call (`env(`, `var(`, `calc(`,
+// `min(`, `max(`, `clamp(`). This excludes any hyphen that sits between two
+// bare identifier characters — critical because a naive "any letter-hyphen-
+// letter" rule corrupts `env(safe-area-inset-bottom)` into
+// `env(safe - area - inset - bottom)` (caught during this batch's dry run;
+// see CALC-SPACING GOTCHA). A leading unary minus right after `(`/`,`/start
+// (e.g. `min(-40px, ...)`) is also left untouched since nothing precedes it
+// on the left to match.
+const CALC_UNIT = "(?:px|rem|em|vh|vw|dvh|dvw|svh|svw|ch|%)";
+const CALC_NUM = "[0-9]*\\.?[0-9]+";
+const CALC_FUNC = "(?:env|var|calc|min|max|clamp)\\(";
+const CALC_SPACING_RE = new RegExp(
+ `(${CALC_NUM}${CALC_UNIT}|${CALC_NUM}|\\))\\s*([+-])\\s*(?=${CALC_NUM}|${CALC_FUNC})`,
+ "g",
+);
+function normalizeCalcSpacing(value) {
+ return value.replace(CALC_SPACING_RE, (m, left, op) => `${left} ${op} `);
+}
+
+// "320" "0.7rem" "-50" etc -> safe token-name suffix. Dots become
+// underscores (matches Batch 2's `--fs-0_7rem` convention); a leading minus
+// is spelled out as `neg-` for readability.
+function safeSuffix(value) {
+ let v = value;
+ const negative = v.startsWith("-");
+ if (negative) v = v.slice(1);
+ v = v.replace(/\./g, "_");
+ return negative ? `neg-${v}` : v;
+}
+
+// ── Token registries ────────────────────────────────────────────────────
+const szTokens = new Map(); // --sz-* (width/height/spacing/gap/inset lengths, shared family)
+const radTokens = new Map(); // --rad-* (radius/ring-width/outline-width, shared family)
+const pctTokens = new Map(); // --pct-* / --pct-neg-*
+const shadowTokens = new Map(); // --shadow-extract-*
+let calcCounter = 0;
+let shadowCounter = 0;
+
+function registerSzToken(rawValue, unit, sourceNote) {
+ const value = `${rawValue}${unit}`;
+ const name = `sz-${safeSuffix(rawValue)}${unit}`;
+ if (!szTokens.has(name)) szTokens.set(name, { value, comment: sourceNote });
+ return name;
+}
+
+// Percentages: --pct-50 for "50", --pct-neg-50 for "-50" (kept distinct per
+// DESIGN.md Step-0 spike guidance — the minus sign is IN the bracket value).
+function registerPctToken(rawNum, sourceNote) {
+ const name = `pct-${safeSuffix(rawNum)}`;
+ const value = `${rawNum}%`;
+ if (!pctTokens.has(name)) pctTokens.set(name, { value, comment: sourceNote });
+ return name;
+}
+
+// Radius / ring-width / outline-width family, shared. Unit is only appended
+// to the name when it's not a bare px number (px is the overwhelming
+// majority and matches Batch 1/2's bare-number convention, e.g. --fs-11).
+function registerRadToken(rawValue, unit, sourceNote) {
+ const value = `${rawValue}${unit}`;
+ const name = unit === "px" ? `rad-${safeSuffix(rawValue)}` : `rad-${safeSuffix(rawValue)}${unit}`;
+ if (!radTokens.has(name)) radTokens.set(name, { value, comment: sourceNote });
+ return name;
+}
+
+// calc()/env()/min()/max()/clamp() forms and any other compound expression:
+// minted 1:1 per distinct (already-unescaped, space-normalized) string into
+// the --sz-* family, named sequentially (content isn't safely nameable) with
+// a comment noting origin. Reused across sites if the exact string recurs.
+const calcByValue = new Map(); // normalized value -> token name
+function registerCalcToken(normalizedValue, sourceNote) {
+ if (calcByValue.has(normalizedValue)) return calcByValue.get(normalizedValue);
+ calcCounter += 1;
+ const name = `sz-calc-${calcCounter}`;
+ szTokens.set(name, { value: normalizedValue, comment: sourceNote });
+ calcByValue.set(normalizedValue, name);
+ return name;
+}
+
+function registerSafeAreaToken(edge, unescapedValue, sourceNote) {
+ const name = `sz-safe-${edge}`;
+ if (!szTokens.has(name)) szTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ return name;
+}
+
+const shadowByValue = new Map(); // unescaped shadow value -> token name
+function registerShadowToken(unescapedValue, sourceNote) {
+ if (shadowByValue.has(unescapedValue)) return shadowByValue.get(unescapedValue);
+ shadowCounter += 1;
+ const name = `shadow-extract-${shadowCounter}`;
+ shadowTokens.set(name, { value: unescapedValue, comment: sourceNote });
+ shadowByValue.set(unescapedValue, name);
+ return name;
+}
+
+// ── Classification of a raw bracket value ───────────────────────────────
+// Returns { tokenRef, isVarOnly } where tokenRef is the FULL replacement
+// content to place inside `(...)`, e.g. "--sz-320" or
+// "--radix-popover-trigger-width" (var-only passthrough, no new token).
+const SIMPLE_LENGTH_RE = /^(-?[0-9.]+)(px|rem|em|vh|vw|dvh|dvw|svh|svw|ch|%)$/;
+const VAR_ONLY_RE = /^var\((--[a-zA-Z0-9-]+)\)$/;
+const ENV_ONLY_RE = /^env\((safe-area-inset-[a-z]+)\)$/;
+const THEME_SPACING_RE = /theme\(spacing\.([0-9.]+)\)/g;
+
+// Tailwind v4 default spacing scale: --spacing: 0.25rem (confirmed via Step 0:
+// no --spacing override exists in ui/src/index.css).
+const TAILWIND_SPACING_BASE_REM = 0.25;
+
+function resolveThemeSpacing(raw) {
+ // Resolves theme(spacing.N) tokens to their rem equivalents so the
+ // expression can live inside a runtime CSS custom property (theme() is a
+ // Tailwind build-time function and does not work at runtime).
+ return raw.replace(THEME_SPACING_RE, (_m, n) => {
+ const rem = Number(n) * TAILWIND_SPACING_BASE_REM;
+ // Keep a leading zero (0.5rem, not .5rem) for readability; verified
+ // byte-equivalent computed output vs Tailwind's own `.5rem` form.
+ return `${rem}rem`;
+ });
+}
+
+function classifyBracketValue(raw, { kind, sourceNote }) {
+ // 1) Bare var() passthrough — no new token, per DESIGN.md special case.
+ const varOnly = raw.match(VAR_ONLY_RE);
+ if (varOnly) return { tokenRef: varOnly[1], isVarOnly: true };
+
+ // 2) Bare env(safe-area-inset-*) passthrough — mint a --sz-safe-<edge> token.
+ const envOnly = raw.match(ENV_ONLY_RE);
+ if (envOnly) {
+ const edge = envOnly[1].replace("safe-area-inset-", "");
+ const name = registerSafeAreaToken(edge, `env(${envOnly[1]})`, sourceNote);
+ return { tokenRef: `--${name}`, isVarOnly: false };
+ }
+
+ // 3) Simple numeric length / percentage.
+ const simple = raw.match(SIMPLE_LENGTH_RE);
+ if (simple) {
+ const [, num, unit] = simple;
+ if (unit === "%") {
+ const name = registerPctToken(num, sourceNote);
+ return { tokenRef: `--${name}`, isVarOnly: false };
+ }
+ if (kind === "radius") {
+ const name = registerRadToken(num, unit, sourceNote);
+ return { tokenRef: `--${name}`, isVarOnly: false };
+ }
+ const name = registerSzToken(num, unit, sourceNote);
+ return { tokenRef: `--${name}`, isVarOnly: false };
+ }
+
+ // 4) Everything else: calc()/min()/max()/clamp()/env()-mixed compound
+ // expressions. Reverse Tailwind's underscore-space escaping, normalize
+ // calc operator spacing, resolve any theme(spacing.N) build-time calls,
+ // and mint a sequential --sz-calc-N.
+ let normalized = unescapeSpaces(raw);
+ normalized = resolveThemeSpacing(normalized);
+ normalized = normalizeCalcSpacing(normalized);
+ const name = registerCalcToken(normalized, sourceNote);
+ return { tokenRef: `--${name}`, isVarOnly: false };
+}
+
+// ── Regexes for each utility family ──────────────────────────────────────
+// Every regex requires the utility to start at a genuine class-token
+// boundary — preceded by whitespace, a quote/backtick, template-literal
+// `${`, or the start of the string — NOT a bare `\b`, which would
+// false-positive inside compound utility names like
+// `slide-out-to-top-[1%]` (see BOUNDARY GOTCHA in the header comment).
+// Each captures: (1) optional `!important` prefix, (2) the utility name
+// (with any directional/axis suffix), (3) the raw bracket contents.
+// `:` is included because Tailwind variant prefixes (`sm:`, `dark:`,
+// `focus-visible:`, `data-[state=open]:`, etc.) always precede the utility
+// name with a colon — a safe class-token boundary, never part of a longer
+// utility's own name.
+const BOUNDARY = String.raw`(?<=^|[\s"'\`{:])`;
+
+const UTILITIES = [
+ // width/height/size family
+ { re: new RegExp(`${BOUNDARY}(!?)(w|h|size|min-w|max-w|min-h|max-h)-\\[([^\\]]+)\\]`, "g"), kind: "length" },
+ // padding/margin family
+ { re: new RegExp(`${BOUNDARY}(!?)(p|pt|pb|pl|pr|px|py|m|mt|mb|ml|mr|mx|my)-\\[([^\\]]+)\\]`, "g"), kind: "length" },
+ // gap family
+ { re: new RegExp(`${BOUNDARY}(!?)(gap|gap-x|gap-y)-\\[([^\\]]+)\\]`, "g"), kind: "length" },
+ // inset / top / left / right / bottom family
+ { re: new RegExp(`${BOUNDARY}(!?)(inset-x|inset-y|inset|top|left|right|bottom)-\\[([^\\]]+)\\]`, "g"), kind: "length" },
+ // translate family
+ { re: new RegExp(`${BOUNDARY}(!?)(translate-x|translate-y)-\\[([^\\]]+)\\]`, "g"), kind: "length" },
+];
+
+// Radius: bare `rounded-[...]` and directional `rounded-t/r/b/l/tl/tr/bl/br-[...]`.
+// `rounded-[inherit]` is a KEYWORD (not a numeric literal) — per the batch
+// mandate, skip it (documented in the extraction log / allowlist below).
+const ROUNDED_RE = new RegExp(`${BOUNDARY}(!?)rounded(-(?:tl|tr|bl|br|t|r|b|l))?-\\[([^\\]]+)\\]`, "g");
+
+// Shadow: bare `shadow-[...]`.
+const SHADOW_RE = new RegExp(`${BOUNDARY}(!?)shadow-\\[([^\\]]+)\\]`, "g");
+
+// Ring width: bare `ring-[Npx]` (color-bracket forms like `ring-[#hex]` are
+// NOT touched here — this batch is size/spacing/radius/shadow only, and no
+// ring color-bracket sites exist in this codebase; verified during Step 0
+// inventory). Requires the `length:` hint per the Step-0 spike (see header).
+const RING_RE = new RegExp(`${BOUNDARY}(!?)ring-\\[([^\\]]+)\\]`, "g");
+
+// Outline width (numeric only; no outline-[...] sites exist in this
+// codebase per Step 0 inventory, kept for forward-compatibility/completeness).
+const OUTLINE_RE = new RegExp(`${BOUNDARY}(!?)outline-\\[([^\\]]+)\\]`, "g");
+
+function rewriteFile(filePath, relPath) {
+ const original = readFileSync(filePath, "utf8");
+ let content = original;
+ let siteCount = 0;
+
+ for (const { re, kind } of UTILITIES) {
+ content = content.replace(re, (match, bang, util, raw) => {
+ const sourceNote = `Extracted from ${relPath} (${util}-[${raw}]).`;
+ const { tokenRef } = classifyBracketValue(raw, { kind, sourceNote });
+ siteCount++;
+ return `${bang}${util}-(${tokenRef})`;
+ });
+ }
+
+ // Radius (needs its own hint-free paren form + inherit skip).
+ content = content.replace(ROUNDED_RE, (match, bang, dir, raw) => {
+ if (raw === "inherit") return match; // keyword, not a literal — skip (see log)
+ const util = `rounded${dir || ""}`;
+ const sourceNote = `Extracted from ${relPath} (${util}-[${raw}]).`;
+ const { tokenRef } = classifyBracketValue(raw, { kind: "radius", sourceNote });
+ siteCount++;
+ return `${bang}${util}-(${tokenRef})`;
+ });
+
+ // Shadow (always unescape underscores + normalize calc spacing inside any
+ // embedded rgba()/hsl() var() args; bare paren form confirmed correct via
+ // Step 0 spike — no `shadow:` hint needed).
+ content = content.replace(SHADOW_RE, (match, bang, raw) => {
+ const unescaped = unescapeSpaces(raw);
+ const sourceNote = `Extracted from ${relPath} (shadow-[${raw}]).`;
+ const name = registerShadowToken(unescaped, sourceNote);
+ siteCount++;
+ return `${bang}shadow-(--${name})`;
+ });
+
+ // Ring width (length hint required — bare ring-(--x) is ambiguous with
+ // the color-bracket form per the Step-0 spike).
+ content = content.replace(RING_RE, (match, bang, raw) => {
+ const sourceNote = `Extracted from ${relPath} (ring-[${raw}]).`;
+ const { tokenRef, isVarOnly } = classifyBracketValue(raw, { kind: "radius", sourceNote });
+ siteCount++;
+ const hint = isVarOnly ? "" : "length:";
+ return `${bang}ring-(${hint}${tokenRef})`;
+ });
+
+ // Outline width (same length-hint treatment; 0 sites exist today).
+ content = content.replace(OUTLINE_RE, (match, bang, raw) => {
+ const sourceNote = `Extracted from ${relPath} (outline-[${raw}]).`;
+ const { tokenRef, isVarOnly } = classifyBracketValue(raw, { kind: "radius", sourceNote });
+ siteCount++;
+ const hint = isVarOnly ? "" : "length:";
+ return `${bang}outline-(${hint}${tokenRef})`;
+ });
+
+ if (content !== original && !DRY_RUN) {
+ writeFileSync(filePath, content, "utf8");
+ }
+ return { changed: content !== original, siteCount };
+}
+
+function main() {
+ const files = [];
+ for (const dir of SCAN_DIRS) walk(resolve(UI_SRC, dir), files);
+ files.sort();
+
+ let totalSites = 0;
+ let filesChanged = 0;
+ const changedFiles = [];
+
+ for (const filePath of files) {
+ const relPath = "ui/src/" + relative(UI_SRC, filePath);
+ const { changed, siteCount } = rewriteFile(filePath, relPath);
+ if (changed) {
+ filesChanged++;
+ changedFiles.push(relPath);
+ }
+ totalSites += siteCount;
+ }
+
+ // ── index.css token block ──────────────────────────────────────────
+ const cssPath = resolve(UI_SRC, "index.css");
+ const cssOriginal = readFileSync(cssPath, "utf8");
+ const marker = "/* ── Extracted verbatim SIZE/SPACING/RADIUS/SHADOW tokens (Phase 2 Batch 3, design/token-extraction) ── */";
+ let cssNext = cssOriginal;
+ let cssChanged = false;
+
+ const anyTokens = szTokens.size || radTokens.size || pctTokens.size || shadowTokens.size;
+ if (!cssOriginal.includes(marker) && anyTokens) {
+ const lines = [];
+ lines.push(marker);
+ lines.push("/* Batch 3/4: width/height/min/max, padding/margin/gap/inset/translate,");
+ lines.push(" radius, ring/outline-width, and shadow literals, verbatim (no");
+ lines.push(" normalizing — the human scale-collapse decision comes later per");
+ lines.push(" DESIGN.md/TOKEN-AUDIT.md). --sz-* is ONE shared family across");
+ lines.push(" w/h/p/m/gap/inset/translate so identical values dedupe regardless of");
+ lines.push(" which property used them. --rad-* is likewise shared across");
+ // NOTE: never write a literal "*/" sequence in this prose (e.g. from a
+ // "rounded-*" + "/ring" join) — it prematurely closes this CSS block
+ // comment and silently corrupts everything after it (caught during this
+ // batch's verification: the entire --sz-*/--rad-*/--pct-*/--shadow-*
+ // :root block was being dropped from the built CSS because of exactly
+ // this). Always phrase such utility-family lists with "and" instead of
+ // a bare slash-adjacent asterisk.
+ lines.push(" rounded, ring, and outline widths.");
+ lines.push("");
+ lines.push(" Allowlist (sites intentionally left as hardcoded / functional literals");
+ lines.push(" or var()-only passthrough with no new token minted):");
+ lines.push(" - components/ui/scroll-area.tsx (rounded-[inherit]) — CSS keyword, not a");
+ lines.push(" literal value; nothing to extract.");
+ lines.push(" - Bracket values that only wrap var(--radix-*-trigger-width/height) or");
+ lines.push(" var(--new-issue-dialog-height) etc. are rewritten to the bare paren");
+ lines.push(" form directly (e.g. w-(--radix-popover-trigger-width)) — these are");
+ lines.push(" runtime library/component variables, not design values, so no new");
+ lines.push(" --sz-* token is minted for them (see TOKEN-AUDIT.md extraction log");
+ lines.push(" for the full site list).");
+ lines.push("*/");
+ lines.push(":root {");
+ for (const [name, { value, comment }] of szTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of radTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of pctTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of shadowTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ lines.push("}");
+ const block = "\n" + lines.join("\n") + "\n";
+ cssNext = cssOriginal + block;
+ cssChanged = true;
+ }
+
+ if (cssChanged && !DRY_RUN) writeFileSync(cssPath, cssNext, "utf8");
+
+ // ── Summary ─────────────────────────────────────────────────────────
+ console.log(`\n${DRY_RUN ? "[DRY RUN] " : ""}codemod-extract-sizes summary`);
+ console.log(` Sites rewritten: ${totalSites}`);
+ console.log(` Files changed: ${filesChanged}`);
+ console.log(` New --sz-* tokens: ${szTokens.size}`);
+ console.log(` New --rad-* tokens: ${radTokens.size}`);
+ console.log(` New --pct-* tokens: ${pctTokens.size}`);
+ console.log(` New --shadow-extract-*: ${shadowTokens.size}`);
+ console.log(` index.css token block: ${cssChanged ? "added" : "already present or nothing to add (idempotent no-op)"}`);
+ if (changedFiles.length) {
+ console.log(`\n Changed files:`);
+ for (const f of changedFiles) console.log(` - ${f}`);
+ }
+}
+
+main();
diff --git a/scripts/codemod-extract-type.mjs b/scripts/codemod-extract-type.mjs
new file mode 100644
index 0000000000..ddd69980e5
--- /dev/null
+++ b/scripts/codemod-extract-type.mjs
@@ -0,0 +1,239 @@
+#!/usr/bin/env node
+/**
+ * codemod-extract-type.mjs
+ *
+ * Phase 2 (extraction), Batch 2/4 of the design-token audit
+ * (branch design/token-extraction). Replaces hardcoded TYPE values —
+ * arbitrary Tailwind font-size (`text-[11px]`), letter-spacing
+ * (`tracking-[0.18em]`), line-height (`leading-[...]`), and raw inline
+ * `fontSize` style literals — in `ui/src/components/**` and
+ * `ui/src/pages/**` (including their *.test.tsx companions) with
+ * references to CSS custom-property tokens defined in `ui/src/index.css`.
+ *
+ * Unlike Batch 1's color codemod (which used a hand-audited site table to
+ * avoid false-positiving on non-color hex-like strings such as issue
+ * references), this batch's patterns are unambiguous: `text-[Npx]`,
+ * `text-[N.Nrem]`, `tracking-[N em]`, and `leading-[...]` inside Tailwind
+ * class strings, and `fontSize: "Npx"` / `fontSize: "N.Nrem"` inline-style
+ * string literals, cannot mean anything other than a type-size/spacing
+ * value. A blanket regex sweep is therefore safe and is used here, scoped
+ * to `ui/src/components/**` and `ui/src/pages/**` only. Numeric or
+ * computed `fontSize` forms (e.g. `fontSize: 12`, `fontSize: Math.round(...)`)
+ * are functional (third-party config objects / runtime-computed values)
+ * and are left untouched — see ALLOWLIST_NOTES below.
+ *
+ * Token naming (verbatim value, no normalizing):
+ * --fs-<N> font-size, px values, e.g. --fs-11: 11px;
+ * --fs-0_<N>rem font-size, rem values, e.g. --fs-0_7rem: 0.7rem;
+ * --ls-0_<N> letter-spacing, em values, e.g. --ls-0_18: 0.18em;
+ * --lh-<N> line-height (px or unitless — none found this batch)
+ *
+ * Tailwind v4 paren-shorthand rewrite forms used:
+ * text-[Npx] -> text-(length:--fs-N) (length hint REQUIRED —
+ * bare text-(--x) means color)
+ * tracking-[N em] -> tracking-(--ls-0_N) (unambiguous, no hint)
+ * leading-[...] -> leading-(--lh-N) (unambiguous, no hint)
+ * All variant/modifier prefixes (`sm:`, `dark:`, `group-hover:`,
+ * `[&>x]:`, trailing `!important` marker, etc.) are preserved verbatim —
+ * the regex only rewrites the bracket portion itself.
+ *
+ * Idempotent: the FIND regex only matches the ORIGINAL bracket-literal
+ * form (`text-[11px]` etc.); once rewritten to `text-(length:--fs-11)` the
+ * pattern no longer matches, so re-running is a no-op. The inline-style
+ * FIND is likewise the literal `fontSize: "11px"` string form.
+ *
+ * Usage: node scripts/codemod-extract-type.mjs [--check]
+ * --check Report what WOULD change without writing files (dry run).
+ */
+
+import { readFileSync, writeFileSync, readdirSync, statSync } from "node:fs";
+import { resolve, dirname, join, relative } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(__dirname, "..");
+const UI_SRC = resolve(REPO_ROOT, "ui/src");
+const SCAN_DIRS = ["components", "pages"];
+
+const DRY_RUN = process.argv.includes("--check");
+
+// ── Helpers ────────────────────────────────────────────────────────────
+function walk(dir, out) {
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const p = join(dir, entry.name);
+ if (entry.isDirectory()) walk(p, out);
+ else if (/\.(tsx?|jsx?)$/.test(entry.name)) out.push(p);
+ }
+}
+
+function tokenSuffixForPx(value) {
+ // "11" -> "11", "0.65" -> "0_65"
+ return value.replace(".", "_");
+}
+
+function tokenSuffixForEm(value) {
+ // "0.18" -> "0_18"
+ return value.replace(".", "_");
+}
+
+// ── Token registries (populated as sites are discovered) ───────────────
+// Map of token name (without --) -> { value, comment, kind }
+const fsTokens = new Map(); // font-size
+const lsTokens = new Map(); // letter-spacing
+const lhTokens = new Map(); // line-height
+
+function registerFsToken(rawValue, unit, sourceNote) {
+ const name = unit === "px" ? `fs-${tokenSuffixForPx(rawValue)}` : `fs-${tokenSuffixForPx(rawValue)}rem`;
+ if (!fsTokens.has(name)) {
+ fsTokens.set(name, { value: `${rawValue}${unit}`, comment: sourceNote });
+ }
+ return name;
+}
+
+function registerLsToken(rawValue, sourceNote) {
+ const name = `ls-${tokenSuffixForEm(rawValue)}`;
+ if (!lsTokens.has(name)) {
+ lsTokens.set(name, { value: `${rawValue}em`, comment: sourceNote });
+ }
+ return name;
+}
+
+function registerLhToken(rawValue, sourceNote) {
+ // rawValue includes unit already stripped by caller; store as given
+ const safeName = rawValue.replace(/[^a-zA-Z0-9]/g, "_");
+ const name = `lh-${safeName}`;
+ if (!lhTokens.has(name)) {
+ lhTokens.set(name, { value: rawValue, comment: sourceNote });
+ }
+ return name;
+}
+
+// ── Regexes ──────────────────────────────────────────────────────────
+// text-[11px], text-[0.65rem], with optional /[Npx] line-height suffix
+// (none found in this codebase, but handled for completeness/future-proofing).
+const FS_RE = /text-\[([0-9.]+)(px|rem)\](?:\/\[([0-9.]+)(px|rem)\])?/g;
+const LS_RE = /tracking-\[([0-9.]+)em\]/g;
+const LEADING_RE = /leading-\[([^\]]+)\]/g;
+const FONTSIZE_STYLE_RE = /fontSize:\s*"([0-9.]+)(px|rem)"/g;
+
+function rewriteFile(filePath, relPath) {
+ const original = readFileSync(filePath, "utf8");
+ let content = original;
+ let siteCount = 0;
+
+ // -- font-size Tailwind class utilities --
+ content = content.replace(FS_RE, (match, num, unit, lhNum, lhUnit) => {
+ const fsName = registerFsToken(num, unit, `Extracted from ${relPath} (text-[${num}${unit}]).`);
+ let replacement = `text-(length:--${fsName})`;
+ if (lhNum) {
+ const lhName = registerLhToken(`${lhNum}${lhUnit}`, `Extracted from ${relPath} (text-[...]/[${lhNum}${lhUnit}] line-height suffix).`);
+ replacement += `/(--${lhName})`;
+ }
+ siteCount++;
+ return replacement;
+ });
+
+ // -- letter-spacing Tailwind class utilities --
+ content = content.replace(LS_RE, (match, num) => {
+ const lsName = registerLsToken(num, `Extracted from ${relPath} (tracking-[${num}em]).`);
+ siteCount++;
+ return `tracking-(--${lsName})`;
+ });
+
+ // -- line-height Tailwind class utilities (standalone leading-[...]) --
+ content = content.replace(LEADING_RE, (match, raw) => {
+ // Only rewrite numeric/unit literals (px, rem, unitless number). Skip
+ // keyword forms like leading-[inherit] or var()-based (already tokenized).
+ if (!/^[0-9.]+(px|rem)?$/.test(raw)) return match;
+ const lhName = registerLhToken(raw, `Extracted from ${relPath} (leading-[${raw}]).`);
+ siteCount++;
+ return `leading-(--${lhName})`;
+ });
+
+ // -- inline style fontSize string literals --
+ content = content.replace(FONTSIZE_STYLE_RE, (match, num, unit) => {
+ const fsName = registerFsToken(num, unit, `Extracted from ${relPath} (inline style fontSize: "${num}${unit}").`);
+ siteCount++;
+ return `fontSize: "var(--${fsName})"`;
+ });
+
+ if (content !== original && !DRY_RUN) {
+ writeFileSync(filePath, content, "utf8");
+ }
+ return { changed: content !== original, siteCount };
+}
+
+function main() {
+ const files = [];
+ for (const dir of SCAN_DIRS) walk(resolve(UI_SRC, dir), files);
+
+ let totalSites = 0;
+ let filesChanged = 0;
+ const changedFiles = [];
+
+ for (const filePath of files) {
+ const relPath = "ui/src/" + relative(UI_SRC, filePath);
+ const { changed, siteCount } = rewriteFile(filePath, relPath);
+ if (changed) {
+ filesChanged++;
+ changedFiles.push(relPath);
+ }
+ totalSites += siteCount;
+ }
+
+ // ── index.css token block ──────────────────────────────────────────
+ const cssPath = resolve(UI_SRC, "index.css");
+ const cssOriginal = readFileSync(cssPath, "utf8");
+ const marker = "/* ── Extracted verbatim TYPE tokens (Phase 2 Batch 2, design/token-extraction) ── */";
+ let cssNext = cssOriginal;
+ let cssChanged = false;
+
+ if (!cssOriginal.includes(marker) && (fsTokens.size || lsTokens.size || lhTokens.size)) {
+ const lines = [];
+ lines.push(marker);
+ lines.push("/* Batch 2/4: font-size + letter-spacing + line-height literals, verbatim");
+ lines.push(" (no normalizing — 9/10/11/12/13/14/15px and 0.08-0.24em all stay distinct;");
+ lines.push(" the human scale-collapse decision comes later per DESIGN.md/TOKEN-AUDIT.md).");
+ lines.push("");
+ lines.push(" Allowlist (sites intentionally left as hardcoded / functional literals,");
+ lines.push(" NOT converted to tokens — each also carries an inline");
+ lines.push(" `token-extraction: allowlisted` comment at the site):");
+ lines.push(" - pages/CompanyEnvironments.tsx (fontSize: 12) — xterm.js terminal theme");
+ lines.push(" config; functional third-party numeric option, not a rendered CSS value.");
+ lines.push(" Same allowlisted object as Batch 1's color entry for this file.");
+ lines.push(" - pages/CompanySkills.tsx (fontSize: Math.round(size * 0.42)) — computed at");
+ lines.push(" runtime from a prop; not a static literal, nothing to extract.");
+ lines.push("*/");
+ lines.push(":root {");
+ for (const [name, { value, comment }] of fsTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of lsTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ for (const [name, { value, comment }] of lhTokens) {
+ lines.push(` --${name}: ${value}; /* ${comment} */`);
+ }
+ lines.push("}");
+ const block = "\n" + lines.join("\n") + "\n";
+ cssNext = cssOriginal + block;
+ cssChanged = true;
+ }
+
+ if (cssChanged && !DRY_RUN) writeFileSync(cssPath, cssNext, "utf8");
+
+ // ── Summary ─────────────────────────────────────────────────────────
+ console.log(`\n${DRY_RUN ? "[DRY RUN] " : ""}codemod-extract-type summary`);
+ console.log(` Sites rewritten: ${totalSites}`);
+ console.log(` Files changed: ${filesChanged}`);
+ console.log(` New --fs-* tokens: ${fsTokens.size}`);
+ console.log(` New --ls-* tokens: ${lsTokens.size}`);
+ console.log(` New --lh-* tokens: ${lhTokens.size}`);
+ console.log(` index.css token block: ${cssChanged ? "added" : "already present or nothing to add (idempotent no-op)"}`);
+ if (changedFiles.length) {
+ console.log(`\n Changed files:`);
+ for (const f of changedFiles) console.log(` - ${f}`);
+ }
+}
+
+main();
diff --git a/scripts/codemod-type-ladder.mjs b/scripts/codemod-type-ladder.mjs
new file mode 100644
index 0000000000..7c954afe9f
--- /dev/null
+++ b/scripts/codemod-type-ladder.mjs
@@ -0,0 +1,197 @@
+#!/usr/bin/env node
+/**
+ * codemod-type-ladder.mjs
+ *
+ * DECISION-SHEET.md B3 (user-locked, preset-tune session): collapse the
+ * Batch 2 verbatim type tokens into the named ladder.
+ *
+ * FONT SIZES (8 --fs-* tokens -> 3 named tokens + 2 Tailwind scale classes):
+ * --fs-9, --fs-10 -> --text-nano: 10px (9 -> 10 bump)
+ * --fs-11, --fs-0_7rem -> --text-micro: 11px (0.7rem = 11.2px -> 11px)
+ * --fs-12 -> Tailwind `text-xs` (12px exact match;
+ * scale class preferred over token per DESIGN.md)
+ * --fs-13 -> --text-compact: 13px
+ * --fs-14, --fs-15 -> Tailwind `text-sm` (14px; 15 -> 14)
+ *
+ * LETTER-SPACING (9 --ls-* tokens -> 3 named steps, nearest-step mapping):
+ * 0.08em, 0.1em -> --tracking-label: 0.08em
+ * 0.12em, 0.14em, 0.16em -> --tracking-eyebrow: 0.14em
+ * 0.18em, 0.2em, 0.22em, 0.24em -> --tracking-caps: 0.2em
+ *
+ * The codemod rewrites every site under ui/src (components, pages, lib,
+ * context, plugins — all .ts/.tsx/.js/.jsx), replaces the --fs-* / --ls-*
+ * definitions in ui/src/index.css with the named-ladder block, and fails
+ * loudly if any --fs-* / --ls-* reference survives (e.g. a var(--fs-12) site,
+ * which has no token replacement because that bucket maps to a Tailwind
+ * scale class and would need a manual decision).
+ *
+ * Replacements are exact strings INCLUDING the closing paren, so prefix
+ * collisions (--ls-0_1 vs --ls-0_12, --fs-1* families) cannot mis-match.
+ *
+ * IDEMPOTENT: a second run finds no old references and the ladder marker
+ * already present in index.css, and changes nothing.
+ *
+ * Usage: node scripts/codemod-type-ladder.mjs
+ */
+
+import { readFileSync, writeFileSync, readdirSync } from "node:fs";
+import { resolve, dirname, join, relative } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(__dirname, "..");
+const UI_SRC = resolve(REPO_ROOT, "ui/src");
+const CSS_PATH = resolve(UI_SRC, "index.css");
+
+// ── Site replacement map (exact strings, closing paren included) ─────────
+const SITE_MAP = new Map([
+ // font sizes — Tailwind utility form (Batch 2 syntax)
+ ["text-(length:--fs-9)", "text-(length:--text-nano)"],
+ ["text-(length:--fs-10)", "text-(length:--text-nano)"],
+ ["text-(length:--fs-11)", "text-(length:--text-micro)"],
+ ["text-(length:--fs-0_7rem)", "text-(length:--text-micro)"],
+ ["text-(length:--fs-12)", "text-xs"],
+ ["text-(length:--fs-13)", "text-(length:--text-compact)"],
+ ["text-(length:--fs-14)", "text-sm"],
+ ["text-(length:--fs-15)", "text-sm"],
+ // font sizes — inline-style var() form
+ ["var(--fs-9)", "var(--text-nano)"],
+ ["var(--fs-10)", "var(--text-nano)"],
+ ["var(--fs-11)", "var(--text-micro)"],
+ ["var(--fs-0_7rem)", "var(--text-micro)"],
+ ["var(--fs-13)", "var(--text-compact)"],
+ // (var(--fs-12/14/15) intentionally absent: those buckets map to Tailwind
+ // scale classes; any such site trips the leftover guard for manual review)
+ // letter-spacing — Tailwind utility form
+ ["tracking-(--ls-0_08)", "tracking-(--tracking-label)"],
+ ["tracking-(--ls-0_1)", "tracking-(--tracking-label)"],
+ ["tracking-(--ls-0_12)", "tracking-(--tracking-eyebrow)"],
+ ["tracking-(--ls-0_14)", "tracking-(--tracking-eyebrow)"],
+ ["tracking-(--ls-0_16)", "tracking-(--tracking-eyebrow)"],
+ ["tracking-(--ls-0_18)", "tracking-(--tracking-caps)"],
+ ["tracking-(--ls-0_2)", "tracking-(--tracking-caps)"],
+ ["tracking-(--ls-0_22)", "tracking-(--tracking-caps)"],
+ ["tracking-(--ls-0_24)", "tracking-(--tracking-caps)"],
+ // letter-spacing — inline-style var() form
+ ["var(--ls-0_08)", "var(--tracking-label)"],
+ ["var(--ls-0_1)", "var(--tracking-label)"],
+ ["var(--ls-0_12)", "var(--tracking-eyebrow)"],
+ ["var(--ls-0_14)", "var(--tracking-eyebrow)"],
+ ["var(--ls-0_16)", "var(--tracking-eyebrow)"],
+ ["var(--ls-0_18)", "var(--tracking-caps)"],
+ ["var(--ls-0_2)", "var(--tracking-caps)"],
+ ["var(--ls-0_22)", "var(--tracking-caps)"],
+ ["var(--ls-0_24)", "var(--tracking-caps)"],
+]);
+
+const LADDER_MARKER = "Named type ladder (DECISION-SHEET.md B3";
+const LADDER_BLOCK = ` /* ── Named type ladder (DECISION-SHEET.md B3, preset-tune session) ──
+ Collapses the 8 verbatim --fs-* font-size tokens and 9 --ls-*
+ letter-spacing tokens (extracted in Batch 2 above) into named steps.
+ Codemod: scripts/codemod-type-ladder.mjs. Mapping:
+ 9px + 10px -> --text-nano (9 -> 10 bump per locked ladder)
+ 11px + 0.7rem -> --text-micro (0.7rem = 11.2px -> 11px)
+ 12px -> Tailwind \`text-xs\` class (12px exact match; scale
+ class preferred over a redundant token per DESIGN.md)
+ 13px -> --text-compact (PRIOR-ART named this tier "sm 13",
+ but that collides with Tailwind text-sm = 14px,
+ hence "compact")
+ 14px + 15px -> Tailwind \`text-sm\` class (14px; 15 -> 14)
+ Letter-spacing, nearest-step mapping:
+ 0.08em, 0.1em -> --tracking-label
+ 0.12em, 0.14em, 0.16em -> --tracking-eyebrow
+ 0.18em, 0.2em, 0.22em, 0.24em -> --tracking-caps
+ NOTE: sites moved to text-xs/text-sm also pick up the Tailwind scale
+ line-height (text-(length:--x) set font-size only) — intentional,
+ reviewed on the post-preset contact sheet. */
+ --text-nano: 10px;
+ --text-micro: 11px;
+ --text-compact: 13px;
+ --tracking-label: 0.08em;
+ --tracking-eyebrow: 0.14em;
+ --tracking-caps: 0.2em;`;
+
+// ── Walk ui/src ───────────────────────────────────────────────────────────
+function walk(dir, out) {
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const p = join(dir, entry.name);
+ if (entry.isDirectory()) walk(p, out);
+ else if (/\.(tsx?|jsx?)$/.test(entry.name)) out.push(p);
+ }
+}
+
+const files = [];
+walk(UI_SRC, files);
+files.sort();
+
+// ── Pass 1: rewrite sites ─────────────────────────────────────────────────
+const bucketCounts = new Map();
+let filesTouched = 0;
+for (const f of files) {
+ const before = readFileSync(f, "utf8");
+ let after = before;
+ for (const [oldStr, newStr] of SITE_MAP) {
+ if (!after.includes(oldStr)) continue;
+ const n = after.split(oldStr).length - 1;
+ after = after.split(oldStr).join(newStr);
+ bucketCounts.set(oldStr, (bucketCounts.get(oldStr) ?? 0) + n);
+ }
+ if (after !== before) {
+ writeFileSync(f, after);
+ filesTouched++;
+ }
+}
+
+// ── Pass 2: index.css — swap definitions for the ladder block ────────────
+let css = readFileSync(CSS_PATH, "utf8");
+if (!css.includes(LADDER_MARKER)) {
+ const lines = css.split("\n");
+ const DEF_RE = /^\s*--(?:fs-[0-9a-z_]+|ls-[0-9_]+):/;
+ const firstDef = lines.findIndex((l) => DEF_RE.test(l));
+ if (firstDef === -1) {
+ console.error("ERROR: no --fs-* / --ls-* definitions found and ladder marker absent — index.css in unexpected state.");
+ process.exit(1);
+ }
+ const kept = lines.filter((l) => !DEF_RE.test(l));
+ // Insert the ladder block at the position of the first removed definition:
+ // count how many kept lines precede the first definition line.
+ let precede = 0;
+ for (let i = 0; i < firstDef; i++) if (!DEF_RE.test(lines[i])) precede++;
+ kept.splice(precede, 0, LADDER_BLOCK);
+ css = kept.join("\n");
+ writeFileSync(CSS_PATH, css);
+ console.log("index.css: --fs-* / --ls-* definitions replaced with named ladder block");
+} else {
+ console.log("index.css: ladder marker already present — skipped (idempotent)");
+}
+
+// ── Guard: no survivors anywhere in ui/src (incl. index.css) ─────────────
+const SURVIVOR_RE = /--(?:fs-[0-9a-z_]+|ls-[0-9_]+)/;
+const survivors = [];
+for (const f of [...files, CSS_PATH]) {
+ const content = readFileSync(f, "utf8");
+ const lines = content.split("\n");
+ lines.forEach((l, i) => {
+ if (SURVIVOR_RE.test(l)) survivors.push(`${relative(REPO_ROOT, f)}:${i + 1}: ${l.trim()}`);
+ });
+}
+
+// ── Report ────────────────────────────────────────────────────────────────
+const bucketTotals = {};
+for (const [oldStr, n] of bucketCounts) {
+ const target = SITE_MAP.get(oldStr);
+ bucketTotals[target] = (bucketTotals[target] ?? 0) + n;
+}
+console.log("Sites rewritten per source form:");
+for (const [oldStr, n] of [...bucketCounts.entries()].sort()) {
+ console.log(` ${oldStr} -> ${SITE_MAP.get(oldStr)} (${n})`);
+}
+console.log("Totals per target bucket:", JSON.stringify(bucketTotals, null, 2));
+console.log(`Files touched: ${filesTouched}`);
+
+if (survivors.length > 0) {
+ console.error(`\nERROR: ${survivors.length} leftover --fs-* / --ls-* reference(s) need manual review:`);
+ for (const s of survivors) console.error(" " + s);
+ process.exit(1);
+}
+console.log("No leftover --fs-* / --ls-* references. Done.");
diff --git a/scripts/serve-storybook-static.mjs b/scripts/serve-storybook-static.mjs
new file mode 100644
index 0000000000..aa0c22f5cd
--- /dev/null
+++ b/scripts/serve-storybook-static.mjs
@@ -0,0 +1,67 @@
+#!/usr/bin/env node
+// Tiny dependency-free static file server for the built Storybook
+// (ui/storybook-static). Used by the visual snapshot suite's webServer so we
+// don't add an http-server dependency.
+import { createServer } from "node:http";
+import { createReadStream, existsSync, statSync } from "node:fs";
+import { extname, join, normalize, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const root = resolve(
+ fileURLToPath(new URL(".", import.meta.url)),
+ "..",
+ "ui",
+ "storybook-static",
+);
+const port = Number(process.env.PORT ?? 6106);
+
+if (!existsSync(join(root, "index.html"))) {
+ console.error(`No built Storybook at ${root}. Run \`pnpm build-storybook\` first.`);
+ process.exit(1);
+}
+
+const MIME = {
+ ".html": "text/html; charset=utf-8",
+ ".js": "text/javascript; charset=utf-8",
+ ".mjs": "text/javascript; charset=utf-8",
+ ".css": "text/css; charset=utf-8",
+ ".json": "application/json; charset=utf-8",
+ ".png": "image/png",
+ ".jpg": "image/jpeg",
+ ".jpeg": "image/jpeg",
+ ".gif": "image/gif",
+ ".svg": "image/svg+xml",
+ ".ico": "image/x-icon",
+ ".woff": "font/woff",
+ ".woff2": "font/woff2",
+ ".ttf": "font/ttf",
+ ".map": "application/json; charset=utf-8",
+ ".txt": "text/plain; charset=utf-8",
+ ".webm": "video/webm",
+ ".mp4": "video/mp4",
+};
+
+const server = createServer((req, res) => {
+ const url = new URL(req.url ?? "/", `http://localhost:${port}`);
+ let filePath = normalize(join(root, decodeURIComponent(url.pathname)));
+ if (!filePath.startsWith(root)) {
+ res.writeHead(403).end("forbidden");
+ return;
+ }
+ if (existsSync(filePath) && statSync(filePath).isDirectory()) {
+ filePath = join(filePath, "index.html");
+ }
+ if (!existsSync(filePath)) {
+ res.writeHead(404).end("not found");
+ return;
+ }
+ res.writeHead(200, {
+ "content-type": MIME[extname(filePath)] ?? "application/octet-stream",
+ "cache-control": "no-store",
+ });
+ createReadStream(filePath).pipe(res);
+});
+
+server.listen(port, () => {
+ console.log(`storybook-static served at http://localhost:${port}`);
+});
diff --git a/scripts/storybook-visual-baseline.mjs b/scripts/storybook-visual-baseline.mjs
new file mode 100644
index 0000000000..5fd9d8e019
--- /dev/null
+++ b/scripts/storybook-visual-baseline.mjs
@@ -0,0 +1,347 @@
+#!/usr/bin/env node
+import { createHash } from "node:crypto";
+import {
+ createReadStream,
+ createWriteStream,
+ existsSync,
+ mkdirSync,
+ mkdtempSync,
+ readdirSync,
+ readFileSync,
+ rmSync,
+ statSync,
+} from "node:fs";
+import { tmpdir } from "node:os";
+import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
+import { pipeline } from "node:stream/promises";
+import { fileURLToPath } from "node:url";
+import { spawnSync } from "node:child_process";
+
+const repoRoot = resolve(fileURLToPath(new URL("..", import.meta.url)));
+const defaultManifestPath = join(repoRoot, "tests", "storybook-visual", "baseline-manifest.json");
+const manifestPath = resolvePath(
+ process.env.STORYBOOK_VISUAL_BASELINE_MANIFEST ?? defaultManifestPath,
+);
+const defaultCacheDir = join(repoRoot, "tests", "storybook-visual", ".cache");
+const cacheDir = resolvePath(process.env.STORYBOOK_VISUAL_BASELINE_CACHE_DIR ?? defaultCacheDir);
+const defaultSnapshotDir = join(repoRoot, "tests", "storybook-visual", ".snapshots");
+const snapshotDir = resolvePath(process.env.STORYBOOK_VISUAL_SNAPSHOT_DIR ?? defaultSnapshotDir);
+
+const command = process.argv[2];
+const flags = parseFlags(process.argv.slice(3));
+
+try {
+ if (command === "download") {
+ await download();
+ } else if (command === "verify") {
+ await verify();
+ } else if (command === "pack") {
+ await pack();
+ } else if (command === "upload") {
+ await upload();
+ } else {
+ usage();
+ process.exit(command ? 1 : 0);
+ }
+} catch (error) {
+ console.error(error instanceof Error ? error.message : String(error));
+ process.exit(1);
+}
+
+function resolvePath(path) {
+ return isAbsolute(path) ? path : resolve(repoRoot, path);
+}
+
+function parseFlags(args) {
+ const result = new Map();
+ for (let index = 0; index < args.length; index += 1) {
+ const arg = args[index];
+ if (!arg.startsWith("--")) {
+ throw new Error(`Unexpected argument: ${arg}`);
+ }
+ const equalsIndex = arg.indexOf("=");
+ if (equalsIndex !== -1) {
+ result.set(arg.slice(2, equalsIndex), arg.slice(equalsIndex + 1));
+ continue;
+ }
+ const key = arg.slice(2);
+ const next = args[index + 1];
+ if (!next || next.startsWith("--")) {
+ result.set(key, "true");
+ } else {
+ result.set(key, next);
+ index += 1;
+ }
+ }
+ return result;
+}
+
+function usage() {
+ console.log(`Usage: node scripts/storybook-visual-baseline.mjs <command>
+
+Commands:
+ download Fetch, checksum, and unpack the manifest archive into the snapshot dir.
+ verify Check the unpacked snapshot count and cached archive checksum.
+ pack Create a deterministic snapshots.tgz from the snapshot dir.
+ upload Upload a packed archive to S3 with immutable overwrite checks.
+
+Environment:
+ STORYBOOK_VISUAL_BASELINE_MANIFEST Manifest path.
+ STORYBOOK_VISUAL_BASELINE_CACHE_DIR Cache path.
+ STORYBOOK_VISUAL_SNAPSHOT_DIR Playwright snapshot dir.
+ STORYBOOK_VISUAL_S3_URI s3://bucket/key target for upload.
+ STORYBOOK_VISUAL_PUBLIC_URL Public HTTPS URL to write into manifest instructions.
+`);
+}
+
+function readManifest() {
+ if (!existsSync(manifestPath)) {
+ throw new Error(`Missing baseline manifest: ${manifestPath}`);
+ }
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
+ if (manifest.version !== 1) {
+ throw new Error(`Unsupported baseline manifest version: ${manifest.version}`);
+ }
+ if (!Number.isInteger(manifest.snapshotCount) || manifest.snapshotCount < 0) {
+ throw new Error("Manifest snapshotCount must be a non-negative integer.");
+ }
+ return manifest;
+}
+
+function archivePathFor(manifest) {
+ const hash = manifest.archive?.sha256;
+ return join(cacheDir, "archives", `${hash || "unconfigured"}-snapshots.tgz`);
+}
+
+async function download() {
+ const manifest = readManifest();
+ assertConfiguredArchive(manifest);
+ mkdirSync(dirname(archivePathFor(manifest)), { recursive: true });
+ const archivePath = archivePathFor(manifest);
+
+ if (!existsSync(archivePath) || sha256File(archivePath) !== manifest.archive.sha256) {
+ await fetchArchive(manifest.archive.url, archivePath);
+ }
+ verifyArchiveFile(manifest, archivePath);
+ rmSync(snapshotDir, { recursive: true, force: true });
+ mkdirSync(snapshotDir, { recursive: true });
+ run("tar", ["-xzf", archivePath, "-C", snapshotDir], "unpack baseline archive");
+ verifySnapshotCount(manifest, snapshotDir);
+ console.log(`Downloaded ${manifest.baselineId} to ${relative(repoRoot, snapshotDir)}`);
+}
+
+async function verify() {
+ const manifest = readManifest();
+ assertConfiguredArchive(manifest);
+ const archivePath = archivePathFor(manifest);
+ if (!existsSync(archivePath)) {
+ throw new Error(
+ `Missing cached archive ${archivePath}. Run \`pnpm storybook-visual:baseline download\` first.`,
+ );
+ }
+ verifyArchiveFile(manifest, archivePath);
+ verifySnapshotCount(manifest, snapshotDir);
+ console.log(
+ `Verified ${manifest.snapshotCount} snapshots for ${manifest.baselineId} in ${relative(
+ repoRoot,
+ snapshotDir,
+ )}`,
+ );
+}
+
+async function pack() {
+ const sourceDir = resolvePath(flags.get("source") ?? snapshotDir);
+ if (!existsSync(sourceDir)) {
+ throw new Error(`Snapshot source does not exist: ${sourceDir}`);
+ }
+ const count = countPngFiles(sourceDir);
+ if (count === 0) {
+ throw new Error(`No PNG snapshots found in ${sourceDir}`);
+ }
+ const out = resolvePath(
+ flags.get("out") ?? join(repoRoot, "tests", "storybook-visual", "baseline-review", "snapshots.tgz"),
+ );
+ mkdirSync(dirname(out), { recursive: true });
+ const tempDir = mkdtempSync(join(tmpdir(), "storybook-visual-pack-"));
+ const tempArchive = join(tempDir, "snapshots.tgz");
+ try {
+ run(
+ "tar",
+ [
+ "--sort=name",
+ "--mtime=@0",
+ "--owner=0",
+ "--group=0",
+ "--numeric-owner",
+ "--use-compress-program=gzip -n",
+ "-cf",
+ tempArchive,
+ "-C",
+ sourceDir,
+ ".",
+ ],
+ "pack deterministic baseline archive",
+ );
+ rmSync(out, { force: true });
+ run("cp", [tempArchive, out], "write packed archive");
+ } finally {
+ rmSync(tempDir, { recursive: true, force: true });
+ }
+ const sha256 = sha256File(out);
+ const byteSize = statSync(out).size;
+ const publicUrl = flags.get("public-url") ?? process.env.STORYBOOK_VISUAL_PUBLIC_URL ?? "";
+ const objectKey = `baselines/storybook-visual/${sha256}/snapshots.tgz`;
+ console.log(`Packed ${count} PNG snapshots into ${relative(repoRoot, out)}`);
+ console.log("");
+ console.log("Manifest archive update:");
+ console.log(
+ JSON.stringify(
+ {
+ snapshotCount: count,
+ archive: {
+ url: publicUrl || `https://<cloudfront-host>/${objectKey}`,
+ sha256,
+ byteSize,
+ objectKey,
+ },
+ },
+ null,
+ 2,
+ ),
+ );
+}
+
+async function upload() {
+ const archive = resolvePath(flags.get("archive") ?? join(repoRoot, "tests", "storybook-visual", "baseline-review", "snapshots.tgz"));
+ const s3Uri = flags.get("s3-uri") ?? process.env.STORYBOOK_VISUAL_S3_URI;
+ if (!s3Uri) {
+ throw new Error("Missing --s3-uri or STORYBOOK_VISUAL_S3_URI for upload.");
+ }
+ if (!s3Uri.startsWith("s3://")) {
+ throw new Error(`Upload target must be an s3:// URI: ${s3Uri}`);
+ }
+ if (!existsSync(archive)) {
+ throw new Error(`Archive does not exist: ${archive}`);
+ }
+ const sha256 = sha256File(archive);
+ const { bucket, key } = parseS3Uri(s3Uri);
+ const head = spawnSync(
+ "aws",
+ ["s3api", "head-object", "--bucket", bucket, "--key", key, "--output", "json"],
+ { encoding: "utf8" },
+ );
+ if (head.status === 0) {
+ const metadata = JSON.parse(head.stdout || "{}").Metadata ?? {};
+ if (metadata.sha256 === sha256) {
+ console.log(`Archive already exists at ${s3Uri} with matching sha256 ${sha256}.`);
+ return;
+ }
+ throw new Error(`Refusing to overwrite existing S3 object with different sha256: ${s3Uri}`);
+ }
+ run(
+ "aws",
+ [
+ "s3",
+ "cp",
+ archive,
+ s3Uri,
+ "--metadata",
+ `sha256=${sha256}`,
+ "--cache-control",
+ "public, max-age=31536000, immutable",
+ "--content-type",
+ "application/gzip",
+ ],
+ "upload baseline archive",
+ );
+ console.log(`Uploaded ${basename(archive)} to ${s3Uri}`);
+}
+
+function assertConfiguredArchive(manifest) {
+ const archive = manifest.archive ?? {};
+ if (!archive.url || !archive.sha256 || !archive.byteSize) {
+ throw new Error(
+ `Baseline manifest ${relative(
+ repoRoot,
+ manifestPath,
+ )} does not point at a published archive yet. Run \`pnpm storybook-visual:baseline pack\`, upload the immutable archive, then update the manifest archive url/sha256/byteSize/snapshotCount.`,
+ );
+ }
+}
+
+async function fetchArchive(url, destination) {
+ if (url.startsWith("file://")) {
+ await pipeline(createReadStream(fileURLToPath(url)), createWriteStream(destination));
+ return;
+ }
+ if (!url.startsWith("https://") && !url.startsWith("http://")) {
+ throw new Error(`Unsupported archive URL: ${url}`);
+ }
+ const response = await fetch(url);
+ if (!response.ok || !response.body) {
+ throw new Error(`Failed to download baseline archive: ${response.status} ${response.statusText}`);
+ }
+ await pipeline(response.body, createWriteStream(destination));
+}
+
+function verifyArchiveFile(manifest, archivePath) {
+ const actualSha = sha256File(archivePath);
+ if (actualSha !== manifest.archive.sha256) {
+ throw new Error(
+ `Baseline checksum mismatch: expected ${manifest.archive.sha256}, got ${actualSha}`,
+ );
+ }
+ const actualSize = statSync(archivePath).size;
+ if (actualSize !== manifest.archive.byteSize) {
+ throw new Error(
+ `Baseline byte size mismatch: expected ${manifest.archive.byteSize}, got ${actualSize}`,
+ );
+ }
+}
+
+function verifySnapshotCount(manifest, dir) {
+ const count = countPngFiles(dir);
+ if (count !== manifest.snapshotCount) {
+ throw new Error(
+ `Baseline snapshot count mismatch: expected ${manifest.snapshotCount}, got ${count} in ${dir}`,
+ );
+ }
+}
+
+function sha256File(path) {
+ const hash = createHash("sha256");
+ hash.update(readFileSync(path));
+ return hash.digest("hex");
+}
+
+function countPngFiles(dir) {
+ if (!existsSync(dir)) return 0;
+ let count = 0;
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const path = join(dir, entry.name);
+ if (entry.isDirectory()) {
+ count += countPngFiles(path);
+ } else if (entry.isFile() && entry.name.endsWith(".png")) {
+ count += 1;
+ }
+ }
+ return count;
+}
+
+function parseS3Uri(uri) {
+ const withoutScheme = uri.slice("s3://".length);
+ const slash = withoutScheme.indexOf("/");
+ if (slash === -1) throw new Error(`S3 URI must include a key: ${uri}`);
+ return { bucket: withoutScheme.slice(0, slash), key: withoutScheme.slice(slash + 1) };
+}
+
+function run(cmd, args, label) {
+ const result = spawnSync(cmd, args, {
+ cwd: repoRoot,
+ stdio: "inherit",
+ env: { ...process.env, COPYFILE_DISABLE: "1" },
+ });
+ if (result.status !== 0) {
+ throw new Error(`Failed to ${label}.`);
+ }
+}
diff --git a/tests/storybook-visual/README.md b/tests/storybook-visual/README.md
new file mode 100644
index 0000000000..3f4b8220af
--- /dev/null
+++ b/tests/storybook-visual/README.md
@@ -0,0 +1,53 @@
+# Storybook Visual Baselines
+
+The visual suite compares built Storybook stories against PNG snapshots stored
+outside git. The checked-in manifest at `baseline-manifest.json` pins the
+immutable archive URL, SHA-256, byte size, snapshot count, and capture
+environment.
+
+## Commands
+
+```sh
+pnpm storybook-visual:baseline download
+pnpm storybook-visual:baseline verify
+pnpm test:storybook-visual
+pnpm test:storybook-visual:update
+```
+
+`download` fetches the archive, verifies its SHA-256 and byte size, unpacks it to
+`tests/storybook-visual/.snapshots/`, and checks the PNG count. The same snapshot
+directory can be overridden with `STORYBOOK_VISUAL_SNAPSHOT_DIR`.
+
+## CI and Review Artifacts
+
+Storybook visual tests are opt-in while the suite stabilizes. Add the
+`storybook-visual` label to a pull request, or run the `Storybook Visual`
+workflow manually, to download the pinned baseline, build Storybook, and run the
+Playwright visual suite on GitHub Actions.
+
+The workflow uploads `tests/storybook-visual/playwright-report/` and
+`tests/storybook-visual/test-results/` as a `storybook-visual-report-*` artifact
+on every run. When screenshots differ, Playwright writes the actual, expected,
+and diff PNGs into `test-results`, so reviewers can inspect the failure without
+rerunning the suite locally.
+
+Normal PR visual runs use repository read-only permissions and never upload or
+modify baseline objects. To review intentional visual changes before updating
+`baseline-manifest.json`, run the workflow manually with `update_snapshots`
+enabled. That produces a `storybook-visual-baseline-review-*` artifact containing
+the packed candidate snapshot archive for review. Publishing that bundle to the
+baseline bucket still requires the explicit maintainer upload command below.
+
+## Updating Baselines
+
+1. Run `pnpm test:storybook-visual:update` after reviewing intentional visual
+ diffs.
+2. Run `pnpm storybook-visual:baseline pack` to create
+ `tests/storybook-visual/baseline-review/snapshots.tgz`.
+3. Upload the archive from a trusted maintainer environment with
+ `STORYBOOK_VISUAL_S3_URI=s3://bucket/baselines/storybook-visual/<sha>/snapshots.tgz pnpm storybook-visual:baseline upload`.
+4. Copy the printed `snapshotCount` and `archive` fields into
+ `baseline-manifest.json`.
+
+Generated snapshots, review bundles, Playwright reports, and downloaded caches
+are ignored by git.
diff --git a/tests/storybook-visual/baseline-manifest.json b/tests/storybook-visual/baseline-manifest.json
new file mode 100644
index 0000000000..3cfed18877
--- /dev/null
+++ b/tests/storybook-visual/baseline-manifest.json
@@ -0,0 +1,18 @@
+{
+ "version": 1,
+ "baselineId": "storybook-visual-initial-public-baseline",
+ "sourceCommit": null,
+ "snapshotCount": 0,
+ "archive": {
+ "url": "",
+ "sha256": "",
+ "byteSize": 0,
+ "objectKey": "baselines/storybook-visual/<sha256>/snapshots.tgz"
+ },
+ "environment": {
+ "browser": "chromium",
+ "viewport": "1200x800",
+ "deviceScaleFactor": 1,
+ "platform": "ubuntu-24.04"
+ }
+}
diff --git a/tests/storybook-visual/playwright.config.ts b/tests/storybook-visual/playwright.config.ts
new file mode 100644
index 0000000000..74bfad7c84
--- /dev/null
+++ b/tests/storybook-visual/playwright.config.ts
@@ -0,0 +1,44 @@
+import { dirname, isAbsolute, join, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+import { defineConfig } from "@playwright/test";
+
+const testDir = dirname(fileURLToPath(import.meta.url));
+const snapshotDir = process.env.STORYBOOK_VISUAL_SNAPSHOT_DIR
+ ? isAbsolute(process.env.STORYBOOK_VISUAL_SNAPSHOT_DIR)
+ ? process.env.STORYBOOK_VISUAL_SNAPSHOT_DIR
+ : resolve(testDir, "..", "..", process.env.STORYBOOK_VISUAL_SNAPSHOT_DIR)
+ : join(testDir, ".snapshots");
+
+// Visual snapshot suite for the design-token extraction run: screenshots every
+// built Storybook story in both themes and compares against the external Phase
+// 0 baseline downloaded by scripts/storybook-visual-baseline.mjs.
+export default defineConfig({
+ testDir: ".",
+ outputDir: "./test-results",
+ timeout: 60_000,
+ retries: 1,
+ workers: 4,
+ fullyParallel: true,
+ reporter: [["list"], ["html", { open: "never", outputFolder: "playwright-report" }]],
+ expect: {
+ toHaveScreenshot: {
+ animations: "disabled",
+ caret: "hide",
+ scale: "css",
+ maxDiffPixels: 0,
+ },
+ },
+ snapshotPathTemplate: `${snapshotDir}/{arg}{ext}`,
+ use: {
+ browserName: "chromium",
+ viewport: { width: 1200, height: 800 },
+ deviceScaleFactor: 1,
+ baseURL: "http://localhost:6106",
+ },
+ webServer: {
+ command: "node ../../scripts/serve-storybook-static.mjs",
+ url: "http://localhost:6106/index.json",
+ reuseExistingServer: true,
+ timeout: 30_000,
+ },
+});
diff --git a/tests/storybook-visual/storybook-visual.spec.ts b/tests/storybook-visual/storybook-visual.spec.ts
new file mode 100644
index 0000000000..eb1ec09eca
--- /dev/null
+++ b/tests/storybook-visual/storybook-visual.spec.ts
@@ -0,0 +1,96 @@
+import { existsSync, readFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { expect, test, type Page } from "@playwright/test";
+
+// One screenshot test per story per theme, generated from the built
+// Storybook's index.json. Baselines live outside git and are downloaded into
+// the configured Playwright snapshot directory before this suite runs.
+const repoRoot = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
+const indexJsonPath = join(repoRoot, "ui", "storybook-static", "index.json");
+
+if (!existsSync(indexJsonPath)) {
+ throw new Error(`Missing ${indexJsonPath}; run \`pnpm build-storybook\` first.`);
+}
+
+type IndexEntry = { id: string; type: string; title: string; name: string };
+const entries = Object.values(
+ (JSON.parse(readFileSync(indexJsonPath, "utf8")) as { entries: Record<string, IndexEntry> })
+ .entries,
+).filter((entry) => entry.type === "story");
+
+// Freeze wall-clock time so relative timestamps, spinners driven by
+// setInterval, and Date.now()-based rendering are deterministic.
+const FIXED_TIME = new Date("2026-06-24T12:00:00.000Z");
+
+const THEMES = ["dark", "light"] as const;
+
+// Stories whose components schedule a delayed state flip (e.g. a "recently
+// focused" highlight that clears via setTimeout). Wait past the flip so the
+// screenshot always captures the settled terminal state.
+const EXTRA_SETTLE_MS: Record<string, number> = {
+ // IssueContinuationHandoff clears its focus highlight after 3s + 1s fade.
+ "product-issue-management--full-surface-matrix": 4500,
+};
+
+// Stories with a genuinely bimodal render race that cannot be settled by
+// waiting. The affected element is masked (solid overlay in both baseline and
+// comparison) so the rest of the story still snapshot-verifies.
+const MASKED_SELECTORS: Record<string, string> = {
+ // DocumentAnnotationLayer's ::highlight range over "two selectors" ends 1-2
+ // characters short on ~half of renders (anchor offsets race). Mask only the
+ // paragraph that carries that highlight.
+ "product-documents-annotations--integrated-mobile-bottom-sheet":
+ 'p:has-text("Use a sidecar anchor made from")',
+};
+
+async function renderStory(page: Page, storyId: string, theme: (typeof THEMES)[number]) {
+ // Freeze Date only (not timers): page.clock.setFixedTime breaks React
+ // rendering in several stories (intermittent "must be used within Provider"
+ // errors), so shim the Date constructor instead.
+ await page.addInitScript(`{
+ const fixedNow = ${FIXED_TIME.getTime()};
+ const RealDate = Date;
+ class FixedDate extends RealDate {
+ constructor(...args) {
+ if (args.length === 0) { super(fixedNow); } else { super(...args); }
+ }
+ static now() { return fixedNow; }
+ }
+ FixedDate.parse = RealDate.parse;
+ FixedDate.UTC = RealDate.UTC;
+ window.Date = FixedDate;
+ }`);
+ await page.goto(
+ `/iframe.html?id=${encodeURIComponent(storyId)}&viewMode=story&globals=theme:${theme}`,
+ { waitUntil: "load" },
+ );
+ // Wait for Storybook to finish rendering (sb-show-main) or error out.
+ // Don't check #storybook-root children: portal-only stories (open dialogs,
+ // sheets) render into document.body and leave the root empty.
+ await page.waitForFunction(() => {
+ const body = document.body;
+ return (
+ body.classList.contains("sb-show-main") ||
+ body.classList.contains("sb-show-errordisplay")
+ );
+ });
+ const errored = await page.locator(".sb-show-errordisplay").count();
+ expect(errored, `story ${storyId} threw during render`).toBe(0);
+ await page.evaluate(() => document.fonts.ready.then(() => undefined));
+ const settleMs = EXTRA_SETTLE_MS[storyId];
+ if (settleMs) await page.waitForTimeout(settleMs);
+}
+
+for (const entry of entries) {
+ for (const theme of THEMES) {
+ test(`${entry.id} [${theme}]`, async ({ page }) => {
+ await renderStory(page, entry.id, theme);
+ const maskSelector = MASKED_SELECTORS[entry.id];
+ await expect(page).toHaveScreenshot(`${entry.id}--${theme}.png`, {
+ fullPage: true,
+ mask: maskSelector ? [page.locator(maskSelector)] : undefined,
+ });
+ });
+ }
+}
diff --git a/ui/src/components/AccountingModelCard.tsx b/ui/src/components/AccountingModelCard.tsx
index 987040615c..5849f077dd 100644
--- a/ui/src/components/AccountingModelCard.tsx
+++ b/ui/src/components/AccountingModelCard.tsx
@@ -28,9 +28,9 @@ const SURFACES = [
export function AccountingModelCard() {
return (
<Card className="relative overflow-hidden border-border/70">
- <div className="absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(244,114,182,0.08),transparent_35%),radial-gradient(circle_at_bottom_right,rgba(56,189,248,0.1),transparent_32%)]" />
+ <div className="absolute inset-0 bg-(image:--gradient-extract-3)" />
<CardHeader className="relative px-5 pt-5 pb-2">
- <CardTitle className="text-sm font-semibold uppercase tracking-[0.22em] text-muted-foreground">
+ <CardTitle className="text-sm font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Accounting model
</CardTitle>
<CardDescription className="max-w-2xl text-sm leading-6">
diff --git a/ui/src/components/ActiveAgentsPanel.tsx b/ui/src/components/ActiveAgentsPanel.tsx
index 2c2b0fcf29..c248c37486 100644
--- a/ui/src/components/ActiveAgentsPanel.tsx
+++ b/ui/src/components/ActiveAgentsPanel.tsx
@@ -29,7 +29,7 @@ function RunCardRecoveryChip({ action }: { action: IssueRecoveryAction }) {
aria-label={tone.label}
title={`${tone.label} — open the source task to act.`}
className={cn(
- "inline-flex shrink-0 items-center gap-0.5 rounded-full border px-1.5 py-0.5 text-[10px] font-medium",
+ "inline-flex shrink-0 items-center gap-0.5 rounded-full border px-1.5 py-0.5 text-(length:--text-nano) font-medium",
tone.className,
)}
>
@@ -170,9 +170,9 @@ const AgentRunCard = memo(function AgentRunCard({
}) {
return (
<div className={cn(
- "flex h-[320px] flex-col overflow-hidden rounded-xl border shadow-sm",
+ "flex h-(--sz-320px) flex-col overflow-hidden rounded-xl border shadow-sm",
isActive
- ? "border-cyan-500/25 bg-cyan-500/[0.04] shadow-[0_16px_40px_rgba(6,182,212,0.08)]"
+ ? "border-blue-500/25 bg-blue-500/[0.04] shadow-(--shadow-extract-1)"
: "border-border bg-background/70",
className,
)}>
@@ -182,22 +182,22 @@ const AgentRunCard = memo(function AgentRunCard({
<div className="flex items-center gap-2">
{isActive ? (
<span className="relative flex h-2.5 w-2.5 shrink-0">
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-cyan-400 opacity-70" />
- <span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-cyan-500" />
+ <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-400 opacity-70" />
+ <span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-blue-500" />
</span>
) : (
<span className="inline-flex h-2.5 w-2.5 rounded-full bg-muted-foreground/35" />
)}
- <Identity name={run.agentName} size="sm" className="[&>span:last-child]:!text-[11px]" />
+ <Identity name={run.agentName} size="sm" className="[&>span:last-child]:!text-(length:--text-micro)" />
</div>
- <div className="mt-2 flex items-center gap-2 text-[11px] text-muted-foreground">
+ <div className="mt-2 flex items-center gap-2 text-(length:--text-micro) text-muted-foreground">
<span>{isActive ? "Live now" : run.finishedAt ? `Finished ${relativeTime(run.finishedAt)}` : `Started ${relativeTime(run.createdAt)}`}</span>
</div>
</div>
<Link
to={`/agents/${run.agentId}/runs/${run.id}`}
- className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:text-foreground"
+ className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2 py-1 text-(length:--text-nano) text-muted-foreground transition-colors hover:text-foreground"
>
<ExternalLink className="h-2.5 w-2.5" />
</Link>
@@ -209,7 +209,7 @@ const AgentRunCard = memo(function AgentRunCard({
to={`/issues/${issue?.identifier ?? run.issueId}`}
className={cn(
"line-clamp-2 hover:underline",
- isActive ? "text-cyan-700 dark:text-cyan-300" : "text-muted-foreground hover:text-foreground",
+ isActive ? "text-blue-700 dark:text-blue-300" : "text-muted-foreground hover:text-foreground",
)}
title={issue?.title ? `${issue?.identifier ?? run.issueId.slice(0, 8)} - ${issue.title}` : issue?.identifier ?? run.issueId.slice(0, 8)}
>
diff --git a/ui/src/components/ActivityCharts.tsx b/ui/src/components/ActivityCharts.tsx
index bd3dd22adb..33171a5bf9 100644
--- a/ui/src/components/ActivityCharts.tsx
+++ b/ui/src/components/ActivityCharts.tsx
@@ -19,11 +19,11 @@ function formatDayLabel(dateStr: string): string {
function DateLabels({ days }: { days: string[] }) {
return (
- <div className="flex gap-[3px] mt-1.5">
+ <div className="flex gap-(--sz-3px) mt-1.5">
{days.map((day, i) => (
<div key={day} className="flex-1 text-center">
{(i === 0 || i === 6 || i === 13) ? (
- <span className="text-[9px] text-muted-foreground tabular-nums">{formatDayLabel(day)}</span>
+ <span className="text-(length:--text-nano) text-muted-foreground tabular-nums">{formatDayLabel(day)}</span>
) : null}
</div>
))}
@@ -35,7 +35,7 @@ function ChartLegend({ items }: { items: { color: string; label: string }[] }) {
return (
<div className="flex flex-wrap gap-x-2.5 gap-y-0.5 mt-2">
{items.map(item => (
- <span key={item.label} className="flex items-center gap-1 text-[9px] text-muted-foreground">
+ <span key={item.label} className="flex items-center gap-1 text-(length:--text-nano) text-muted-foreground">
<span className="h-1.5 w-1.5 rounded-full shrink-0" style={{ backgroundColor: item.color }} />
{item.label}
</span>
@@ -49,7 +49,7 @@ export function ChartCard({ title, subtitle, children }: { title: string; subtit
<div className="border border-border rounded-lg p-4 space-y-3">
<div>
<h3 className="text-xs font-medium text-muted-foreground">{title}</h3>
- {subtitle && <span className="text-[10px] text-muted-foreground/60">{subtitle}</span>}
+ {subtitle && <span className="text-(length:--text-nano) text-muted-foreground/60">{subtitle}</span>}
</div>
{children}
</div>
@@ -96,7 +96,7 @@ export function RunActivityChart(props: RunChartProps) {
return (
<div>
- <div className="flex items-end gap-[3px] h-20">
+ <div className="flex items-end gap-(--sz-3px) h-20">
{days.map(day => {
const entry = grouped.get(day) ?? { date: day, succeeded: 0, failed: 0, other: 0, total: 0 };
const total = entry.total;
@@ -122,10 +122,10 @@ export function RunActivityChart(props: RunChartProps) {
}
const priorityColors: Record<string, string> = {
- critical: "#ef4444",
- high: "#f97316",
- medium: "#eab308",
- low: "#6b7280",
+ critical: "var(--hex-ef4444)",
+ high: "var(--hex-f97316)",
+ medium: "var(--hex-eab308)",
+ low: "var(--hex-6b7280)",
};
const priorityOrder = ["critical", "high", "medium", "low"] as const;
@@ -148,7 +148,7 @@ export function PriorityChart({ issues }: { issues: { priority: string; createdA
return (
<div>
- <div className="flex items-end gap-[3px] h-20">
+ <div className="flex items-end gap-(--sz-3px) h-20">
{days.map(day => {
const entry = grouped.get(day)!;
const total = Object.values(entry).reduce((a, b) => a + b, 0);
@@ -174,14 +174,21 @@ export function PriorityChart({ issues }: { issues: { priority: string; createdA
);
}
+// DECISION-SHEET.md B5: chart status colors re-pointed at the canonical
+// --status-task-* system (DESIGN.md principle 5 — an operator learns one
+// status vocabulary; badge, row, chart, and log agree). Previously an
+// independent palette (todo blue, in_progress violet, etc.). `backlog`
+// deliberately keeps --project-none (pre-B5, per user ruling); the
+// priority series and success-rate tints below are not status hues and
+// are left alone.
const statusColors: Record<string, string> = {
- todo: "#3b82f6",
- in_progress: "#8b5cf6",
- in_review: "#a855f7",
- done: "#10b981",
- blocked: "#ef4444",
- cancelled: "#6b7280",
- backlog: "#64748b",
+ todo: "var(--status-task-todo)",
+ in_progress: "var(--status-task-in_progress)",
+ in_review: "var(--status-task-in_review)",
+ done: "var(--status-task-done)",
+ blocked: "var(--status-task-blocked)",
+ cancelled: "var(--status-task-cancelled)",
+ backlog: "var(--project-none)",
};
const statusLabels: Record<string, string> = {
@@ -215,7 +222,7 @@ export function IssueStatusChart({ issues }: { issues: { status: string; created
return (
<div>
- <div className="flex items-end gap-[3px] h-20">
+ <div className="flex items-end gap-(--sz-3px) h-20">
{days.map(day => {
const entry = grouped.get(day)!;
const total = Object.values(entry).reduce((a, b) => a + b, 0);
@@ -225,7 +232,7 @@ export function IssueStatusChart({ issues }: { issues: { status: string; created
{total > 0 ? (
<div className="flex flex-col-reverse gap-px overflow-hidden" style={{ height: `${heightPct}%`, minHeight: 2 }}>
{statusOrder.map(s => (entry[s] ?? 0) > 0 ? (
- <div key={s} style={{ flex: entry[s], backgroundColor: statusColors[s] ?? "#6b7280" }} />
+ <div key={s} style={{ flex: entry[s], backgroundColor: statusColors[s] ?? "var(--hex-6b7280)" }} />
) : null)}
</div>
) : (
@@ -236,7 +243,7 @@ export function IssueStatusChart({ issues }: { issues: { status: string; created
})}
</div>
<DateLabels days={days} />
- <ChartLegend items={statusOrder.map(s => ({ color: statusColors[s] ?? "#6b7280", label: statusLabels[s] ?? s }))} />
+ <ChartLegend items={statusOrder.map(s => ({ color: statusColors[s] ?? "var(--hex-6b7280)", label: statusLabels[s] ?? s }))} />
</div>
);
}
@@ -251,11 +258,11 @@ export function SuccessRateChart(props: RunChartProps) {
return (
<div>
- <div className="flex items-end gap-[3px] h-20">
+ <div className="flex items-end gap-(--sz-3px) h-20">
{days.map(day => {
const entry = grouped.get(day) ?? { date: day, succeeded: 0, failed: 0, other: 0, total: 0 };
const rate = entry.total > 0 ? entry.succeeded / entry.total : 0;
- const color = entry.total === 0 ? undefined : rate >= 0.8 ? "#10b981" : rate >= 0.5 ? "#eab308" : "#ef4444";
+ const color = entry.total === 0 ? undefined : rate >= 0.8 ? "var(--hex-10b981)" : rate >= 0.5 ? "var(--hex-eab308)" : "var(--hex-ef4444)";
return (
<div key={day} className="flex-1 h-full flex flex-col justify-end" title={`${day}: ${entry.total > 0 ? Math.round(rate * 100) : 0}% (${entry.succeeded}/${entry.total})`}>
{entry.total > 0 ? (
diff --git a/ui/src/components/ActivityFeed.tsx b/ui/src/components/ActivityFeed.tsx
index 2df82a27d5..70100ea0d7 100644
--- a/ui/src/components/ActivityFeed.tsx
+++ b/ui/src/components/ActivityFeed.tsx
@@ -268,7 +268,7 @@ function CollapsedFeedGroup({
onClick={() => setExpanded((e) => !e)}
data-fc="card"
className={cn(
- "group ml-3 mr-3 md:ml-0 my-2 flex w-[calc(100%-1.5rem)] md:w-[calc(100%-0.75rem)] items-center gap-2 rounded-lg border bg-card p-[18px] text-left text-xs transition-[background-color,border-color] duration-150",
+ "group ml-3 mr-3 md:ml-0 my-2 flex w-(--sz-calc-1) md:w-(--sz-calc-2) items-center gap-2 rounded-lg border bg-card p-(--sz-18px) text-left text-xs transition-(--tp-background-color-border-color) duration-150",
"cursor-pointer hover:bg-accent hover:border-muted-foreground/30",
)}
>
@@ -283,9 +283,9 @@ function CollapsedFeedGroup({
: <Settings className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
}
<span className="flex-1 min-w-0 truncate">
- <span data-fc="actor" className="font-medium text-[#959596] group-hover:text-white">{actorName}</span>
- <span data-fc="verb" className="ml-1 text-[#959596]">made {group.events.length} updates to</span>
- <span data-fc="title" className="ml-1 text-[#959596] group-hover:text-white">{entityName ?? group.entityId}</span>
+ <span data-fc="actor" className="font-medium text-(--hex-959596) group-hover:text-white">{actorName}</span>
+ <span data-fc="verb" className="ml-1 text-(--hex-959596)">made {group.events.length} updates to</span>
+ <span data-fc="title" className="ml-1 text-(--hex-959596) group-hover:text-white">{entityName ?? group.entityId}</span>
</span>
<span data-fc="time" className="text-muted-foreground shrink-0">
{timeAgo(group.latestEvent.createdAt)}
@@ -470,7 +470,7 @@ export function ActivityFeed({ className }: ActivityFeedProps) {
separator = (
<div className="flex items-center gap-2 px-4 py-1.5" key={`sep-${index}`}>
<div className="h-px flex-1 bg-border" />
- <span className="text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
+ <span className="text-(length:--text-nano) font-medium text-muted-foreground uppercase tracking-wider">
Earlier
</span>
<div className="h-px flex-1 bg-border" />
@@ -680,7 +680,7 @@ export function ActivityFeed({ className }: ActivityFeedProps) {
>
{isEmpty ? (
<div className="flex min-h-0 flex-1 items-center justify-center p-6 h-full">
- <div className="flex flex-col items-center gap-2 max-w-[16rem]">
+ <div className="flex flex-col items-center gap-2 max-w-(--sz-16rem)">
{emptyMessage?.showPulse && (
<span className="relative flex h-2.5 w-2.5">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-primary/40" />
diff --git a/ui/src/components/AgentBubbleActionRow.tsx b/ui/src/components/AgentBubbleActionRow.tsx
index 66db7f3353..2fc596bc8b 100644
--- a/ui/src/components/AgentBubbleActionRow.tsx
+++ b/ui/src/components/AgentBubbleActionRow.tsx
@@ -109,7 +109,7 @@ export function AgentBubbleActionRow({
<TooltipTrigger asChild>
<a
href={anchorHref}
- className="text-[11px] text-muted-foreground hover:text-foreground hover:underline"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground hover:underline"
>
{dateLabel}
</a>
diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx
index ac507b7b88..5a0204f26e 100644
--- a/ui/src/components/AgentConfigForm.tsx
+++ b/ui/src/components/AgentConfigForm.tsx
@@ -983,7 +983,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
value={eff("identity", "capabilities", props.agent.capabilities ?? "") ?? ""}
onChange={(v) => mark("identity", "capabilities", v || null)}
placeholder="Describe what this agent can do..."
- contentClassName="min-h-[44px] text-sm font-mono"
+ contentClassName="min-h-(--sz-44px) text-sm font-mono"
imageUploadHandler={async (file) => {
const asset = await uploadMarkdownImage.mutateAsync({
file,
@@ -1004,7 +1004,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
)}
onChange={(v) => mark("adapterConfig", "promptTemplate", v ?? "")}
placeholder="You are agent {{ agent.name }}. Your role is {{ agent.role }}..."
- contentClassName="min-h-[88px] text-sm font-mono"
+ contentClassName="min-h-(--sz-88px) text-sm font-mono"
imageUploadHandler={async (file) => {
const namespace = `agents/${props.agent.id}/prompt-template`;
const asset = await uploadMarkdownImage.mutateAsync({ file, namespace });
@@ -1012,7 +1012,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
}}
/>
</Field>
- <div className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100">
+ <div className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-900 dark:text-amber-100">
Prompt template is replayed on every heartbeat. Keep it compact and dynamic to avoid recurring token cost and cache churn.
</div>
</>
@@ -1041,7 +1041,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
{kubernetesEnvironment.name} · Kubernetes sandbox
</div>
) : (
- <div className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-200">
+ <div className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200">
This instance requires the Kubernetes sandbox, but no managed Kubernetes
environment is available for this company yet. Configure one before creating
agents; execution will not fall back to local.
@@ -1247,7 +1247,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
</Field>
{supportsModelProfiles && (
- <div className="text-[11px] uppercase tracking-wide text-muted-foreground">Primary model</div>
+ <div className="text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">Primary model</div>
)}
<ModelDropdown
models={models}
@@ -1345,7 +1345,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
mark("adapterConfig", "bootstrapPromptTemplate", v || undefined)
}
placeholder="Optional initial setup prompt for the first run"
- contentClassName="min-h-[44px] text-sm font-mono"
+ contentClassName="min-h-(--sz-44px) text-sm font-mono"
imageUploadHandler={async (file) => {
const namespace = `agents/${props.agent.id}/bootstrap-prompt`;
const asset = await uploadMarkdownImage.mutateAsync({ file, namespace });
@@ -1353,7 +1353,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
}}
/>
</Field>
- <div className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-200">
+ <div className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200">
Bootstrap prompt is legacy and will be removed in a future release. Consider moving this content into the agent&apos;s prompt template or instructions file instead.
</div>
</>
@@ -1578,13 +1578,13 @@ export function AdapterEnvironmentResult({ result }: { result: AdapterEnvironmen
<div className={`rounded-md border px-3 py-2 text-xs ${statusClass}`}>
<div className="flex items-center justify-between gap-2">
<span className="font-medium">{statusLabel}</span>
- <span className="text-[11px] opacity-80">
+ <span className="text-(length:--text-micro) opacity-80">
{new Date(result.testedAt).toLocaleTimeString()}
</span>
</div>
<div className="mt-2 space-y-1.5">
{result.checks.map((check, idx) => (
- <div key={`${check.code}-${idx}`} className="text-[11px] leading-relaxed break-words">
+ <div key={`${check.code}-${idx}`} className="text-(length:--text-micro) leading-relaxed break-words">
<span className="font-medium uppercase tracking-wide opacity-80">
{check.level}
</span>
@@ -1632,7 +1632,7 @@ function AdapterTypeDropdown({
<ChevronDown className="h-3 w-3 text-muted-foreground" />
</button>
</PopoverTrigger>
- <PopoverContent className="w-[var(--radix-popover-trigger-width)] p-1" align="start">
+ <PopoverContent className="w-(--radix-popover-trigger-width) p-1" align="start">
{adapterList.map((item) => (
<button
key={item.value}
@@ -1657,7 +1657,7 @@ function AdapterTypeDropdown({
{item.experimental && <ExperimentalBadge />}
</span>
{item.comingSoon && (
- <span className="text-[10px] text-muted-foreground">Coming soon</span>
+ <span className="text-(length:--text-nano) text-muted-foreground">Coming soon</span>
)}
</button>
))}
@@ -1668,7 +1668,7 @@ function AdapterTypeDropdown({
function ExperimentalBadge() {
return (
- <span className="shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium leading-none text-amber-700 dark:text-amber-200">
+ <span className="shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium leading-none text-amber-700 dark:text-amber-200">
Experimental
</span>
);
@@ -1802,7 +1802,7 @@ function ModelDropdown({
<ChevronDown className="h-3 w-3 text-muted-foreground" />
</button>
</PopoverTrigger>
- <PopoverContent className="w-[var(--radix-popover-trigger-width)] p-1" align="start">
+ <PopoverContent className="w-(--radix-popover-trigger-width) p-1" align="start">
<div className="relative mb-1">
<input
className="w-full px-2 py-1.5 pr-6 text-xs bg-transparent outline-none border-b border-border placeholder:text-muted-foreground/50"
@@ -1871,7 +1871,7 @@ function ModelDropdown({
<span className="block w-full text-left truncate font-mono text-xs" title={value}>
{models.find((m) => m.id === value)?.label ?? value}
</span>
- <span className="shrink-0 ml-auto text-[9px] font-medium px-1.5 py-0.5 rounded-full bg-green-500/15 text-green-400 border border-green-500/20">
+ <span className="shrink-0 ml-auto text-(length:--text-nano) font-medium px-1.5 py-0.5 rounded-full bg-green-500/15 text-green-400 border border-green-500/20">
current
</span>
</button>
@@ -1890,7 +1890,7 @@ function ModelDropdown({
<span className="block w-full text-left truncate font-mono text-xs" title={detectedModel}>
{models.find((m) => m.id === detectedModel)?.label ?? detectedModel}
</span>
- <span className="shrink-0 ml-auto text-[9px] font-medium px-1.5 py-0.5 rounded-full bg-blue-500/15 text-blue-400 border border-blue-500/20">
+ <span className="shrink-0 ml-auto text-(length:--text-nano) font-medium px-1.5 py-0.5 rounded-full bg-blue-500/15 text-blue-400 border border-blue-500/20">
detected
</span>
</button>
@@ -1914,13 +1914,13 @@ function ModelDropdown({
<span className="block w-full text-left truncate font-mono text-xs" title={candidate}>
{entry?.label ?? candidate}
</span>
- <span className="shrink-0 ml-auto text-[9px] font-medium px-1.5 py-0.5 rounded-full bg-sky-500/15 text-sky-400 border border-sky-500/20">
+ <span className="shrink-0 ml-auto text-(length:--text-nano) font-medium px-1.5 py-0.5 rounded-full bg-sky-500/15 text-sky-400 border border-sky-500/20">
config
</span>
</button>
);
})}
- <div className="max-h-[240px] overflow-y-auto">
+ <div className="max-h-(--sz-240px) overflow-y-auto">
{allowDefault && (
<button
type="button"
@@ -1953,7 +1953,7 @@ function ModelDropdown({
{groupedModels.map((group) => (
<div key={group.provider} className="mb-1 last:mb-0">
{groupByProvider && (
- <div className="px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground">
+ <div className="px-2 py-1 text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
{group.provider} ({group.entries.length})
</div>
)}
@@ -2021,7 +2021,7 @@ function CheapModelSection({
<div className="rounded-md border border-border/70 bg-muted/20 p-3 space-y-3">
<div className="flex items-center justify-between gap-3">
<div className="min-w-0">
- <div className="text-[11px] uppercase tracking-wide text-muted-foreground">Cheap model</div>
+ <div className="text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">Cheap model</div>
<p className="text-xs text-muted-foreground">
Used when a run requests the cheap profile (e.g. routine summaries). The primary model stays unchanged.
</p>
@@ -2046,12 +2046,12 @@ function CheapModelSection({
/>
) : null}
{enabled && !model && adapterDefaultModel ? (
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
No explicit cheap model selected — runtime falls back to <code>{adapterDefaultModel}</code>.
</p>
) : null}
{enabled && !model && !adapterDefaultModel ? (
- <p className="text-[11px] text-amber-500">
+ <p className="text-(length:--text-micro) text-amber-500">
No cheap model selected and the adapter has no default. Cheap-lane runs will continue on the primary model with a fallback note.
</p>
) : null}
@@ -2083,7 +2083,7 @@ function ThinkingEffortDropdown({
<ChevronDown className="h-3 w-3 text-muted-foreground" />
</button>
</PopoverTrigger>
- <PopoverContent className="w-[var(--radix-popover-trigger-width)] p-1" align="start">
+ <PopoverContent className="w-(--radix-popover-trigger-width) p-1" align="start">
{options.map((option) => (
<button
key={option.id || "auto"}
diff --git a/ui/src/components/ApprovalCard.tsx b/ui/src/components/ApprovalCard.tsx
index 7084f6b0ef..0eb6cab476 100644
--- a/ui/src/components/ApprovalCard.tsx
+++ b/ui/src/components/ApprovalCard.tsx
@@ -63,7 +63,7 @@ export function ApprovalCard({
<div className="flex flex-wrap items-center gap-2">
<Badge
variant="outline"
- className="border-border/70 bg-background/70 px-2 py-0.5 text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground"
+ className="border-border/70 bg-background/70 px-2 py-0.5 text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground"
>
{kindLabel}
</Badge>
diff --git a/ui/src/components/ApprovalPayload.tsx b/ui/src/components/ApprovalPayload.tsx
index 6a1fe2597b..165ee8a223 100644
--- a/ui/src/components/ApprovalPayload.tsx
+++ b/ui/src/components/ApprovalPayload.tsx
@@ -70,7 +70,7 @@ function SkillList({ values }: { values: unknown }) {
{items.map((item) => (
<span
key={item}
- className="rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground"
+ className="rounded bg-muted px-1.5 py-0.5 font-mono text-(length:--text-micro) text-muted-foreground"
>
{item}
</span>
@@ -178,19 +178,19 @@ function BoardApprovalPayloadContent({ payload }: { payload: Record<string, unkn
<div className="mt-4 space-y-3.5 text-sm">
{title && (
<div className="space-y-1">
- <p className="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">Title</p>
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">Title</p>
<p className="font-medium leading-6 text-foreground">{title}</p>
</div>
)}
{summary && (
<div className="space-y-1">
- <p className="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">Summary</p>
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">Summary</p>
<p className="leading-6 text-foreground/90">{summary}</p>
</div>
)}
{recommendedAction && (
<div className="rounded-lg border border-amber-500/20 bg-amber-500/10 px-3.5 py-3">
- <p className="text-[11px] font-medium uppercase tracking-[0.08em] text-amber-700 dark:text-amber-300">
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-amber-700 dark:text-amber-300">
Recommended action
</p>
<p className="mt-1 leading-6 text-foreground">{recommendedAction}</p>
@@ -198,13 +198,13 @@ function BoardApprovalPayloadContent({ payload }: { payload: Record<string, unkn
)}
{nextActionOnApproval && (
<div className="rounded-lg border border-border/60 bg-background/60 px-3.5 py-3">
- <p className="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">On approval</p>
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">On approval</p>
<p className="mt-1 leading-6 text-foreground">{nextActionOnApproval}</p>
</div>
)}
{risks.length > 0 && (
<div className="space-y-1.5">
- <p className="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">Risks</p>
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">Risks</p>
<ul className="space-y-1 text-sm text-muted-foreground">
{risks.map((risk) => (
<li key={risk} className="flex items-start gap-2">
@@ -217,7 +217,7 @@ function BoardApprovalPayloadContent({ payload }: { payload: Record<string, unkn
)}
{proposedComment && (
<div className="space-y-1.5">
- <p className="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">
Proposed comment
</p>
<pre className="max-h-48 overflow-auto rounded-lg border border-border/60 bg-muted/50 px-3.5 py-3 font-mono text-xs leading-5 text-muted-foreground whitespace-pre-wrap">
diff --git a/ui/src/components/ArtifactsPanel.tsx b/ui/src/components/ArtifactsPanel.tsx
index 1e8b633061..afa8778941 100644
--- a/ui/src/components/ArtifactsPanel.tsx
+++ b/ui/src/components/ArtifactsPanel.tsx
@@ -139,7 +139,7 @@ export function ArtifactsPanel({ taskId, isAgentWorking, openDocKey, openDocTitl
<button
key={f.value}
className={cn(
- "rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",
+ "rounded-full px-2.5 py-0.5 text-(length:--text-micro) font-medium transition-colors",
filter === f.value
? "bg-foreground text-background"
: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
@@ -193,8 +193,8 @@ export function ArtifactsPanel({ taskId, isAgentWorking, openDocKey, openDocTitl
{showGenerating ? (
<div className="mt-0.5 shrink-0">
<span className="relative flex h-4 w-4">
- <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75" />
- <span className="relative inline-flex rounded-full h-4 w-4 bg-cyan-500" />
+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
+ <span className="relative inline-flex rounded-full h-4 w-4 bg-blue-500" />
</span>
</div>
) : (
@@ -208,22 +208,22 @@ export function ArtifactsPanel({ taskId, isAgentWorking, openDocKey, openDocTitl
)}
</div>
<div className="flex items-center gap-2 mt-1">
- <span className="text-[10px] text-muted-foreground capitalize">
+ <span className="text-(length:--text-nano) text-muted-foreground capitalize">
{wp.type.replace(/_/g, " ")}
</span>
{showGenerating ? (
- <span className="inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-cyan-500/10 text-cyan-600 dark:text-cyan-400">
+ <span className="inline-flex items-center gap-1 text-(length:--text-nano) font-medium px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400">
<Loader2 className="h-2.5 w-2.5 animate-spin" />
Generating...
</span>
) : (
- <span className={cn("text-[10px] font-medium px-1.5 py-0.5 rounded-full", badge.className)}>
+ <span className={cn("text-(length:--text-nano) font-medium px-1.5 py-0.5 rounded-full", badge.className)}>
{badge.label}
</span>
)}
</div>
{wp.summary && (
- <p className="text-[11px] text-muted-foreground mt-1 line-clamp-2">
+ <p className="text-(length:--text-micro) text-muted-foreground mt-1 line-clamp-2">
{wp.summary}
</p>
)}
@@ -298,7 +298,7 @@ function DocumentViewer({
{/* Sticky action footer */}
{needsAction && (
<div className="border-t border-border px-4 py-3 bg-background shrink-0">
- <p className="text-[11px] text-muted-foreground mb-2">This document needs your review.</p>
+ <p className="text-(length:--text-micro) text-muted-foreground mb-2">This document needs your review.</p>
<div className="flex items-center gap-3">
<Button size="lg" className="h-11 px-8 text-base font-semibold flex-1 rounded-lg bg-green-700 hover:bg-green-800 text-white border-0" onClick={onApprove}>
Approve
@@ -316,7 +316,7 @@ function DocumentViewer({
<div className="border-t border-green-500/30 bg-green-500/5 px-4 py-3 shrink-0">
<div className="flex items-center gap-2">
<CheckCircle2 className="h-4 w-4 text-green-500" />
- <p className="text-[13px] font-medium text-green-700 dark:text-green-400">
+ <p className="text-(length:--text-compact) font-medium text-green-700 dark:text-green-400">
Approved — hire tasks created
</p>
</div>
@@ -326,7 +326,7 @@ function DocumentViewer({
<div className="border-t border-orange-500/30 bg-orange-500/5 px-4 py-3 shrink-0">
<div className="flex items-center gap-2">
<XCircle className="h-4 w-4 text-orange-500" />
- <p className="text-[13px] font-medium text-orange-700 dark:text-orange-400">
+ <p className="text-(length:--text-compact) font-medium text-orange-700 dark:text-orange-400">
Changes requested — CEO is revising
</p>
</div>
diff --git a/ui/src/components/AsciiArtAnimation.tsx b/ui/src/components/AsciiArtAnimation.tsx
index f71d2fba31..aab5dc4335 100644
--- a/ui/src/components/AsciiArtAnimation.tsx
+++ b/ui/src/components/AsciiArtAnimation.tsx
@@ -341,7 +341,7 @@ export function AsciiArtAnimation() {
<pre
ref={preRef}
className="w-full h-full m-0 p-0 overflow-hidden text-muted-foreground/60 select-none leading-none"
- style={{ fontSize: "11px", fontFamily: "monospace" }}
+ style={{ fontSize: "var(--text-micro)", fontFamily: "monospace" }}
aria-hidden="true"
/>
);
diff --git a/ui/src/components/BlockedInboxView.tsx b/ui/src/components/BlockedInboxView.tsx
index 1a5565823f..a8408ad28e 100644
--- a/ui/src/components/BlockedInboxView.tsx
+++ b/ui/src/components/BlockedInboxView.tsx
@@ -309,7 +309,7 @@ function BlockedInboxRow({
const desktopTrailing = (
<span className="flex shrink-0 items-center gap-3 text-xs">
<span
- className="hidden w-[10.5rem] shrink-0 justify-start sm:inline-flex"
+ className="hidden w-(--sz-10_5rem) shrink-0 justify-start sm:inline-flex"
data-testid="blocked-row-reason-column"
>
<BlockedReasonChip
@@ -319,7 +319,7 @@ function BlockedInboxRow({
/>
</span>
{ownerName ? (
- <span className="hidden w-[150px] min-w-0 items-center text-muted-foreground sm:inline-flex">
+ <span className="hidden w-(--sz-150px) min-w-0 items-center text-muted-foreground sm:inline-flex">
<Identity
name={ownerName}
size="xs"
@@ -327,10 +327,10 @@ function BlockedInboxRow({
/>
</span>
) : (
- <span className="hidden w-[150px] shrink-0 sm:inline-flex" aria-hidden="true" />
+ <span className="hidden w-(--sz-150px) shrink-0 sm:inline-flex" aria-hidden="true" />
)}
{showUpdatedColumn ? (
- <span className="hidden w-[5.75rem] text-right text-muted-foreground sm:inline" data-testid="blocked-row-age">
+ <span className="hidden w-(--sz-5_75rem) text-right text-muted-foreground sm:inline" data-testid="blocked-row-age">
{stoppedAge}
</span>
) : null}
@@ -375,7 +375,7 @@ function BlockedInboxRow({
<BlockedReasonChip
reason={row.attention.reason}
severity={row.attention.severity}
- className="ml-2 max-w-[12rem] align-middle sm:hidden"
+ className="ml-2 max-w-(--sz-12rem) align-middle sm:hidden"
/>
}
mobileMeta={mobileMeta}
diff --git a/ui/src/components/BlockedReasonChip.tsx b/ui/src/components/BlockedReasonChip.tsx
index 4efddc6d6e..506f5da7de 100644
--- a/ui/src/components/BlockedReasonChip.tsx
+++ b/ui/src/components/BlockedReasonChip.tsx
@@ -64,7 +64,7 @@ export function BlockedReasonChip({
data-severity={severity}
aria-label={`Reason: ${label}, severity ${severity}`}
className={cn(
- "inline-flex shrink-0 items-center gap-1 rounded-md border px-2 py-0.5 text-[10px] font-medium leading-tight sm:text-[11px]",
+ "inline-flex shrink-0 items-center gap-1 rounded-md border px-2 py-0.5 text-(length:--text-nano) font-medium leading-tight sm:text-(length:--text-micro)",
VARIANT_STYLES[variant],
className,
)}
diff --git a/ui/src/components/BudgetIncidentCard.tsx b/ui/src/components/BudgetIncidentCard.tsx
index 49836819cf..44fa60a7c9 100644
--- a/ui/src/components/BudgetIncidentCard.tsx
+++ b/ui/src/components/BudgetIncidentCard.tsx
@@ -43,30 +43,30 @@ export function BudgetIncidentCard({
const stateLabel = incidentStateLabel(incident);
return (
- <Card className="overflow-hidden border-red-500/20 bg-[linear-gradient(180deg,rgba(255,70,70,0.10),rgba(255,255,255,0.02))]">
+ <Card className="overflow-hidden border-red-500/20 bg-(image:--gradient-extract-4)">
<CardHeader className="px-5 pt-5 pb-3">
<div className="flex items-start justify-between gap-3">
<div>
<div className="flex flex-wrap items-center gap-2">
- <div className="text-[11px] uppercase tracking-[0.22em] text-red-200/80">
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-red-700/90 dark:text-red-200/80">
{incident.scopeType} hard stop
</div>
<Badge variant={incident.status === "resolved" ? "outline" : "secondary"}>
{stateLabel}
</Badge>
</div>
- <CardTitle className="mt-1 text-base text-red-50">{incident.scopeName}</CardTitle>
- <CardDescription className="mt-1 text-red-100/70">
+ <CardTitle className="mt-1 text-base text-red-950 dark:text-red-50">{incident.scopeName}</CardTitle>
+ <CardDescription className="mt-1 text-red-900/75 dark:text-red-100/70">
Spending reached {formatCents(incident.amountObserved)} against a limit of {formatCents(incident.amountLimit)}.
</CardDescription>
</div>
- <div className="rounded-full border border-red-400/30 bg-red-500/10 p-2 text-red-200">
+ <div className="rounded-full border border-red-400/30 bg-red-500/10 p-2 text-red-600 dark:text-red-200">
<AlertOctagon className="h-4 w-4" />
</div>
</div>
</CardHeader>
<CardContent className="space-y-4 px-5 pb-5 pt-0">
- <div className="flex items-start gap-2 rounded-xl border border-red-400/20 bg-red-500/10 px-3 py-2 text-sm text-red-50/90">
+ <div className="flex items-start gap-2 rounded-xl border border-red-400/20 bg-red-500/10 px-3 py-2 text-sm text-red-950/90 dark:text-red-50/90">
<PauseCircle className="mt-0.5 h-4 w-4 shrink-0" />
<div>
{incident.scopeType === "project"
@@ -76,7 +76,7 @@ export function BudgetIncidentCard({
</div>
<div className="rounded-xl border border-border/60 bg-background/60 p-3">
- <label className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
+ <label className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">
New budget (USD)
</label>
<div className="mt-2 flex flex-col gap-3 sm:flex-row">
@@ -98,7 +98,7 @@ export function BudgetIncidentCard({
</Button>
</div>
{parsed !== null && parsed <= incident.amountObserved ? (
- <p className="mt-2 text-xs text-red-200/80">
+ <p className="mt-2 text-xs text-red-700 dark:text-red-200/80">
The new budget must exceed current observed spend.
</p>
) : null}
diff --git a/ui/src/components/BudgetPolicyCard.tsx b/ui/src/components/BudgetPolicyCard.tsx
index 7834e8cbab..d392ff0c0e 100644
--- a/ui/src/components/BudgetPolicyCard.tsx
+++ b/ui/src/components/BudgetPolicyCard.tsx
@@ -23,9 +23,9 @@ function windowLabel(windowKind: BudgetPolicySummary["windowKind"]) {
}
function statusTone(status: BudgetPolicySummary["status"]) {
- if (status === "hard_stop") return "text-red-300 border-red-500/30 bg-red-500/10";
- if (status === "warning") return "text-amber-200 border-amber-500/30 bg-amber-500/10";
- return "text-emerald-200 border-emerald-500/30 bg-emerald-500/10";
+ if (status === "hard_stop") return "text-red-700 dark:text-red-300 border-red-500/30 bg-red-500/10";
+ if (status === "warning") return "text-amber-700 dark:text-amber-200 border-amber-500/30 bg-amber-500/10";
+ return "text-emerald-700 dark:text-emerald-200 border-emerald-500/30 bg-emerald-500/10";
}
export function BudgetPolicyCard({
@@ -56,14 +56,14 @@ export function BudgetPolicyCard({
const observedBudgetGrid = isPlain ? (
<div className="grid gap-6 sm:grid-cols-2">
<div>
- <div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Observed</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Observed</div>
<div className="mt-2 text-xl font-semibold tabular-nums">{formatCents(summary.observedAmount)}</div>
<div className="mt-1 text-xs text-muted-foreground">
{summary.amount > 0 ? `${summary.utilizationPercent}% of limit` : "No cap configured"}
</div>
</div>
<div>
- <div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Budget</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Budget</div>
<div className="mt-2 text-xl font-semibold tabular-nums">
{summary.amount > 0 ? formatCents(summary.amount) : "Disabled"}
</div>
@@ -75,14 +75,14 @@ export function BudgetPolicyCard({
) : (
<div className="grid gap-3 sm:grid-cols-2">
<div className="rounded-xl border border-border/70 bg-black/[0.18] px-4 py-3">
- <div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Observed</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Observed</div>
<div className="mt-2 text-xl font-semibold tabular-nums">{formatCents(summary.observedAmount)}</div>
<div className="mt-1 text-xs text-muted-foreground">
{summary.amount > 0 ? `${summary.utilizationPercent}% of limit` : "No cap configured"}
</div>
</div>
<div className="rounded-xl border border-border/70 bg-black/[0.18] px-4 py-3">
- <div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Budget</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Budget</div>
<div className="mt-2 text-xl font-semibold tabular-nums">
{summary.amount > 0 ? formatCents(summary.amount) : "Disabled"}
</div>
@@ -102,12 +102,12 @@ export function BudgetPolicyCard({
<div className={cn("h-2 overflow-hidden rounded-full", isPlain ? "bg-border/70" : "bg-muted/70")}>
<div
className={cn(
- "h-full rounded-full transition-[width,background-color] duration-200",
+ "h-full rounded-full transition-(--tp-width-background-color) duration-200",
summary.status === "hard_stop"
- ? "bg-red-400"
+ ? "bg-(--status-task-blocked)"
: summary.status === "warning"
- ? "bg-amber-300"
- : "bg-emerald-300",
+ ? "bg-(--status-task-todo)"
+ : "bg-(--status-task-done)",
)}
style={{ width: `${progress}%` }}
/>
@@ -116,7 +116,7 @@ export function BudgetPolicyCard({
);
const pausedPane = summary.paused ? (
- <div className="flex items-start gap-2 rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-100">
+ <div className="flex items-start gap-2 rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-900 dark:text-red-100">
<PauseCircle className="mt-0.5 h-4 w-4 shrink-0" />
<div>
{summary.scopeType === "project"
@@ -129,7 +129,7 @@ export function BudgetPolicyCard({
const saveSection = onSave ? (
<div className={cn("flex flex-col gap-3 sm:flex-row sm:items-end", isPlain ? "" : "rounded-xl border border-border/70 bg-background/50 p-3")}>
<div className="min-w-0 flex-1">
- <label className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
+ <label className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">
Budget (USD)
</label>
<Input
@@ -156,7 +156,7 @@ export function BudgetPolicyCard({
<div className="space-y-6">
<div className="flex items-start justify-between gap-6">
<div>
- <div className="text-[11px] uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">
{summary.scopeType}
</div>
<div className="mt-2 text-xl font-semibold">{summary.scopeName}</div>
@@ -164,11 +164,11 @@ export function BudgetPolicyCard({
</div>
<div
className={cn(
- "inline-flex items-center gap-2 text-[11px] uppercase tracking-[0.18em]",
+ "inline-flex items-center gap-2 text-(length:--text-micro) uppercase tracking-(--tracking-caps)",
summary.status === "hard_stop"
- ? "text-red-300"
+ ? "text-red-700 dark:text-red-300"
: summary.status === "warning"
- ? "text-amber-200"
+ ? "text-amber-800 dark:text-amber-200"
: "text-muted-foreground",
)}
>
@@ -189,17 +189,17 @@ export function BudgetPolicyCard({
}
return (
- <Card className={cn("overflow-hidden border-border/70 bg-card/80", compact ? "" : "shadow-[0_20px_80px_-40px_rgba(0,0,0,0.55)]")}>
+ <Card className={cn("overflow-hidden border-border/70 bg-card/80", compact ? "" : "shadow-(--shadow-extract-2)")}>
<CardHeader className={cn("gap-3", compact ? "px-4 pt-4 pb-2" : "px-5 pt-5 pb-3")}>
<div className="flex items-start justify-between gap-3">
<div>
- <div className="text-[11px] uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">
{summary.scopeType}
</div>
<CardTitle className="mt-1 text-base">{summary.scopeName}</CardTitle>
<CardDescription className="mt-1">{windowLabel(summary.windowKind)}</CardDescription>
</div>
- <div className={cn("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.18em]", statusTone(summary.status))}>
+ <div className={cn("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-(length:--text-micro) uppercase tracking-(--tracking-caps)", statusTone(summary.status))}>
<StatusIcon className="h-3.5 w-3.5" />
{summary.paused ? "Paused" : summary.status === "warning" ? "Warning" : summary.status === "hard_stop" ? "Hard stop" : "Healthy"}
</div>
diff --git a/ui/src/components/BudgetSidebarMarker.tsx b/ui/src/components/BudgetSidebarMarker.tsx
index 07e5ddfc07..2e5b9ae8e8 100644
--- a/ui/src/components/BudgetSidebarMarker.tsx
+++ b/ui/src/components/BudgetSidebarMarker.tsx
@@ -27,7 +27,7 @@ export function BudgetSidebarMarker({
<span
title={accessibleTitle}
aria-label={accessibleTitle}
- className={`ml-auto inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full shadow-[0_0_0_1px_rgba(255,255,255,0.08)] ${levelClasses[level]}`}
+ className={`ml-auto inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full shadow-(--shadow-extract-3) ${levelClasses[level]}`}
>
<DollarSign className="h-3 w-3" />
</span>
diff --git a/ui/src/components/ChatComposer.test.tsx b/ui/src/components/ChatComposer.test.tsx
index 423db03874..aa3f791910 100644
--- a/ui/src/components/ChatComposer.test.tsx
+++ b/ui/src/components/ChatComposer.test.tsx
@@ -160,7 +160,7 @@ describe("ChatComposer", () => {
const el = input();
expect(el.getAttribute("wrap")).toBe("soft");
expect(el.className).toContain("overflow-y-auto");
- expect(el.className).toContain("max-h-[200px]");
+ expect(el.className).toContain("max-h-(--sz-200px)");
expect(el.className).not.toContain("whitespace-nowrap");
expect(el.className).not.toContain("overflow-x-auto");
act(() => root.unmount());
@@ -174,7 +174,7 @@ describe("ChatComposer", () => {
const el = input();
expect(el.getAttribute("wrap")).toBe("off");
expect(el.className).toContain("whitespace-nowrap");
- expect(el.className).toContain("max-h-[22px]");
+ expect(el.className).toContain("max-h-(--sz-22px)");
act(() => root.unmount());
});
@@ -225,8 +225,8 @@ describe("ChatComposer", () => {
expect(box.className).toContain("bg-background/95");
expect(box.className).toContain("supports-[backdrop-filter]:bg-background/85");
expect(box.className).toContain("backdrop-blur");
- expect(box.className).toContain("shadow-[0_-12px_28px_rgba(15,23,42,0.08)]");
- expect(box.className).toContain("dark:shadow-[0_-12px_28px_rgba(0,0,0,0.28)]");
+ expect(box.className).toContain("shadow-(--shadow-extract-4)");
+ expect(box.className).toContain("dark:shadow-(--shadow-extract-5)");
expect(box.className).not.toContain("bg-card");
// Shared chrome survives: rounded-xl corners + neutral focus darkening.
expect(box.className).toContain("rounded-xl");
diff --git a/ui/src/components/ChatComposer.tsx b/ui/src/components/ChatComposer.tsx
index 8226162029..1834c88f5c 100644
--- a/ui/src/components/ChatComposer.tsx
+++ b/ui/src/components/ChatComposer.tsx
@@ -231,7 +231,7 @@ export const ChatComposer = forwardRef<ChatComposerHandle, ChatComposerProps>(fu
"relative rounded-xl border px-3 pt-2.5 pb-2 transition-colors duration-150 focus-within:border-muted-foreground/40",
// Surface: opaque card vs the task glass recipe (IssueChatThread.tsx shell).
surface === "translucent"
- ? "border-border/70 bg-background/95 shadow-[0_-12px_28px_rgba(15,23,42,0.08)] backdrop-blur supports-[backdrop-filter]:bg-background/85 dark:shadow-[0_-12px_28px_rgba(0,0,0,0.28)]"
+ ? "border-border/70 bg-background/95 shadow-(--shadow-extract-4) backdrop-blur supports-[backdrop-filter]:bg-background/85 dark:shadow-(--shadow-extract-5)"
: "border-border bg-card",
// No blue focus ring — neutral border darkening only.
isAsk &&
@@ -250,7 +250,7 @@ export const ChatComposer = forwardRef<ChatComposerHandle, ChatComposerProps>(fu
{isDragOver && canAttach ? (
<div
data-testid="chat-composer-drop-overlay"
- className="pointer-events-none absolute inset-1.5 z-20 flex items-center justify-center rounded-lg border border-dashed border-muted-foreground/50 bg-background/80 text-xs text-muted-foreground backdrop-blur-[1px]"
+ className="pointer-events-none absolute inset-1.5 z-20 flex items-center justify-center rounded-lg border border-dashed border-muted-foreground/50 bg-background/80 text-xs text-muted-foreground backdrop-blur-(--blur-1px)"
>
<span className="inline-flex items-center gap-2">
<Paperclip className="h-3.5 w-3.5" />
@@ -271,10 +271,10 @@ export const ChatComposer = forwardRef<ChatComposerHandle, ChatComposerProps>(fu
rows={1}
wrap={singleLine ? "off" : "soft"}
className={cn(
- "block min-h-[22px] w-full resize-none border-0 bg-transparent p-0 text-sm leading-6 text-foreground outline-none placeholder:text-muted-foreground focus:outline-none focus:ring-0",
+ "block min-h-(--sz-22px) w-full resize-none border-0 bg-transparent p-0 text-sm leading-6 text-foreground outline-none placeholder:text-muted-foreground focus:outline-none focus:ring-0",
singleLine
- ? "max-h-[22px] overflow-x-auto whitespace-nowrap"
- : "max-h-[200px] overflow-y-auto",
+ ? "max-h-(--sz-22px) overflow-x-auto whitespace-nowrap"
+ : "max-h-(--sz-200px) overflow-y-auto",
textareaClassName,
)}
/>
@@ -323,7 +323,7 @@ export const ChatComposer = forwardRef<ChatComposerHandle, ChatComposerProps>(fu
) : null}
{hint ? (
- <div className="mt-2 inline-flex items-center rounded-full border border-border/70 bg-muted/30 px-2 py-0.5 text-[11px] text-muted-foreground">
+ <div className="mt-2 inline-flex items-center rounded-full border border-border/70 bg-muted/30 px-2 py-0.5 text-(length:--text-micro) text-muted-foreground">
{hint}
</div>
) : null}
diff --git a/ui/src/components/ClaudeSubscriptionPanel.tsx b/ui/src/components/ClaudeSubscriptionPanel.tsx
index 3559a32027..3a950a457a 100644
--- a/ui/src/components/ClaudeSubscriptionPanel.tsx
+++ b/ui/src/components/ClaudeSubscriptionPanel.tsx
@@ -46,8 +46,8 @@ function orderedWindows(windows: QuotaWindow[]): QuotaWindow[] {
function fillClass(usedPercent: number | null): string {
if (usedPercent == null) return "bg-zinc-700";
- if (usedPercent >= 90) return "bg-red-400";
- if (usedPercent >= 70) return "bg-amber-400";
+ if (usedPercent >= 90) return "bg-(--status-task-blocked)";
+ if (usedPercent >= 70) return "bg-(--status-task-todo)";
return "bg-primary/70";
}
@@ -62,7 +62,7 @@ export function ClaudeSubscriptionPanel({
<div className="border border-border px-4 py-4">
<div className="flex items-start justify-between gap-3 border-b border-border pb-3">
<div className="min-w-0">
- <div className="text-[11px] font-semibold uppercase tracking-[0.2em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Anthropic subscription
</div>
<div className="mt-1 text-sm text-muted-foreground">
@@ -70,7 +70,7 @@ export function ClaudeSubscriptionPanel({
</div>
</div>
{source ? (
- <span className="shrink-0 border border-border px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground">
+ <span className="shrink-0 border border-border px-2.5 py-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{quotaSourceDisplayName(source)}
</span>
) : null}
@@ -127,7 +127,7 @@ export function ClaudeSubscriptionPanel({
<div className="mt-3 h-2 overflow-hidden bg-muted">
<div
- className={cn("h-full transition-[width] duration-200", fillClass(window.usedPercent))}
+ className={cn("h-full transition-(--tp-width) duration-200", fillClass(window.usedPercent))}
style={{ width: `${width}%` }}
/>
</div>
diff --git a/ui/src/components/CodexSubscriptionPanel.tsx b/ui/src/components/CodexSubscriptionPanel.tsx
index db1ac2e476..5f26314024 100644
--- a/ui/src/components/CodexSubscriptionPanel.tsx
+++ b/ui/src/components/CodexSubscriptionPanel.tsx
@@ -42,8 +42,8 @@ function detailText(window: QuotaWindow): string | null {
function fillClass(usedPercent: number | null): string {
if (usedPercent == null) return "bg-zinc-700";
- if (usedPercent >= 90) return "bg-red-400";
- if (usedPercent >= 70) return "bg-amber-400";
+ if (usedPercent >= 90) return "bg-(--status-task-blocked)";
+ if (usedPercent >= 70) return "bg-(--status-task-todo)";
return "bg-primary/70";
}
@@ -65,7 +65,7 @@ export function CodexSubscriptionPanel({
<div className="border border-border px-4 py-4">
<div className="flex items-start justify-between gap-3 border-b border-border pb-3">
<div className="min-w-0">
- <div className="text-[11px] font-semibold uppercase tracking-[0.2em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Codex subscription
</div>
<div className="mt-1 text-sm text-muted-foreground">
@@ -73,7 +73,7 @@ export function CodexSubscriptionPanel({
</div>
</div>
{source ? (
- <span className="shrink-0 border border-border px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground">
+ <span className="shrink-0 border border-border px-2.5 py-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{quotaSourceDisplayName(source)}
</span>
) : null}
@@ -87,7 +87,7 @@ export function CodexSubscriptionPanel({
<div className="mt-4 space-y-5">
<div className="space-y-3">
- <div className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Account windows
</div>
<div className="space-y-3">
@@ -99,7 +99,7 @@ export function CodexSubscriptionPanel({
{modelWindows.length > 0 ? (
<div className="space-y-3">
- <div className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Model windows
</div>
<div className="space-y-3">
@@ -148,7 +148,7 @@ function QuotaWindowRow({ window }: { window: QuotaWindow }) {
<div className="mt-3 h-2 overflow-hidden bg-muted">
<div
- className={cn("h-full transition-[width] duration-200", fillClass(window.usedPercent))}
+ className={cn("h-full transition-(--tp-width) duration-200", fillClass(window.usedPercent))}
style={{ width: `${Math.max(0, Math.min(100, window.usedPercent))}%` }}
/>
</div>
diff --git a/ui/src/components/CommandPalette.tsx b/ui/src/components/CommandPalette.tsx
index 384e522bb1..0dedef05bc 100644
--- a/ui/src/components/CommandPalette.tsx
+++ b/ui/src/components/CommandPalette.tsx
@@ -209,7 +209,7 @@ export function CommandPalette() {
{showSearchAll ? (
<span>
No quick task matches. Press{" "}
- <kbd className="rounded border border-border bg-muted px-1 py-0.5 text-[10px]">↵</kbd>{" "}
+ <kbd className="rounded border border-border bg-muted px-1 py-0.5 text-(length:--text-nano)">↵</kbd>{" "}
to <span className="font-medium">search all</span> or keep typing to refine.
</span>
) : (
@@ -231,7 +231,7 @@ export function CommandPalette() {
</span>
<span className="ml-auto inline-flex items-center gap-1 text-xs text-muted-foreground">
<span>open full search</span>
- <kbd className="rounded border border-border bg-background px-1 py-0.5 text-[10px]">↵</kbd>
+ <kbd className="rounded border border-border bg-background px-1 py-0.5 text-(length:--text-nano)">↵</kbd>
</span>
</CommandItem>
</CommandGroup>
diff --git a/ui/src/components/CommentThread.tsx b/ui/src/components/CommentThread.tsx
index 08ec0bea02..9836380e42 100644
--- a/ui/src/components/CommentThread.tsx
+++ b/ui/src/components/CommentThread.tsx
@@ -233,7 +233,7 @@ function runStatusClass(status: string) {
case "timed_out":
return "text-orange-700 dark:text-orange-300";
case "running":
- return "text-cyan-700 dark:text-cyan-300";
+ return "text-blue-700 dark:text-blue-300";
case "queued":
case "pending":
return "text-amber-700 dark:text-amber-300";
@@ -374,12 +374,12 @@ function CommentCard({
)}
<span className="flex items-center gap-1.5">
{isQueued ? (
- <span className="inline-flex items-center rounded-full border border-amber-400/60 bg-amber-100/70 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.14em] text-amber-800 dark:border-amber-400/40 dark:bg-amber-500/20 dark:text-amber-200">
+ <span className="inline-flex items-center rounded-full border border-amber-400/60 bg-amber-100/70 px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-amber-800 dark:border-amber-400/40 dark:bg-amber-500/20 dark:text-amber-200">
Queued
</span>
) : null}
{followUpRequested ? (
- <Badge variant="outline" className="text-[10px] uppercase tracking-[0.14em]">
+ <Badge variant="outline" className="text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow)">
Follow-up
</Badge>
) : null}
@@ -446,12 +446,12 @@ function CommentCard({
comment.runAgentId ? (
<Link
to={`/agents/${comment.runAgentId}/runs/${comment.runId}`}
- className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
+ className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-(length:--text-nano) font-mono text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
>
run {comment.runId.slice(0, 8)}
</Link>
) : (
- <span className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground">
+ <span className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-(length:--text-nano) font-mono text-muted-foreground">
run {comment.runId.slice(0, 8)}
</span>
)
@@ -463,12 +463,12 @@ function CommentCard({
{comment.runAgentId ? (
<Link
to={`/agents/${comment.runAgentId}/runs/${comment.runId}`}
- className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
+ className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-(length:--text-nano) font-mono text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
>
run {comment.runId.slice(0, 8)}
</Link>
) : (
- <span className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-[10px] font-mono text-muted-foreground">
+ <span className="inline-flex items-center rounded-md border border-border bg-accent/30 px-2 py-1 text-(length:--text-nano) font-mono text-muted-foreground">
run {comment.runId.slice(0, 8)}
</span>
)}
@@ -516,7 +516,7 @@ function TimelineEventCard({
{event.statusChange ? (
<div className="flex flex-wrap items-center gap-2 text-sm">
- <span className="w-14 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <span className="w-14 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Status
</span>
<span className="text-muted-foreground">
@@ -531,7 +531,7 @@ function TimelineEventCard({
{event.assigneeChange ? (
<div className="flex flex-wrap items-center gap-2 text-sm">
- <span className="w-14 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <span className="w-14 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Assignee
</span>
<span className="text-muted-foreground">
@@ -546,7 +546,7 @@ function TimelineEventCard({
{event.workspaceChange ? (
<div className="flex flex-wrap items-center gap-2 text-sm">
- <span className="w-14 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <span className="w-14 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Workspace
</span>
<span className="text-muted-foreground">
@@ -672,7 +672,7 @@ const TimelineList = memo(function TimelineList({
</div>
</div>
{run.environment || run.environmentLease ? (
- <div className="mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground">
+ <div className="mt-2 flex flex-wrap gap-x-3 gap-y-1 text-(length:--text-micro) text-muted-foreground">
{run.environment ? (
<span>
Environment <span className="text-foreground">{run.environment.name}</span>
@@ -989,7 +989,7 @@ export function CommentThread({
{queuedComments.length > 0 && (
<div className="space-y-3">
<div className="flex items-center justify-between gap-2">
- <h4 className="text-xs font-semibold uppercase tracking-[0.14em] text-amber-700 dark:text-amber-300">
+ <h4 className="text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-amber-700 dark:text-amber-300">
Queued Comments ({queuedComments.length})
</h4>
{onInterruptQueued && queuedComments[0]?.queueTargetRunId ? (
@@ -1035,7 +1035,7 @@ export function CommentThread({
mentions={mentions}
onSubmit={handleSubmit}
imageUploadHandler={imageUploadHandler}
- contentClassName="min-h-[60px] text-sm"
+ contentClassName="min-h-(--sz-60px) text-sm"
/>
<div className="flex items-center justify-end gap-3">
{(imageUploadHandler || onAttachImage) && (
diff --git a/ui/src/components/CompanyPatternIcon.tsx b/ui/src/components/CompanyPatternIcon.tsx
index 6591f7d13a..1856da482d 100644
--- a/ui/src/components/CompanyPatternIcon.tsx
+++ b/ui/src/components/CompanyPatternIcon.tsx
@@ -125,6 +125,7 @@ function makeCompanyPatternDataUrl(seed: string, brandColor?: string | null, log
const diagonalPhase = rand() * Math.PI * 2;
const antiDiagonalPhase = rand() * Math.PI * 2;
+ // token-extraction: allowlisted — canvas 2D fillStyle computed at runtime from numeric channel props; not a static literal.
ctx.fillStyle = `rgb(${offR} ${offG} ${offB})`;
ctx.fillRect(0, 0, canvas.width, canvas.height);
@@ -208,7 +209,7 @@ export function CompanyPatternIcon({
<div className="absolute inset-0 bg-muted" />
)}
{!logo && (
- <span className="relative z-10 drop-shadow-[0_1px_2px_rgba(0,0,0,0.65)]">
+ <span className="relative z-10 drop-shadow-(--drop-shadow-extract-1)">
{initial}
</span>
)}
diff --git a/ui/src/components/CompanySettingsSidebar.tsx b/ui/src/components/CompanySettingsSidebar.tsx
index a7243a74d1..eda2a8edbd 100644
--- a/ui/src/components/CompanySettingsSidebar.tsx
+++ b/ui/src/components/CompanySettingsSidebar.tsx
@@ -100,7 +100,7 @@ export function CompanySettingsSidebar() {
</div>
<nav className="flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide px-3 py-2">
- <div className="px-3 pb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="px-3 pb-1 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Company settings
</div>
<div className="flex flex-col gap-0.5">
@@ -134,7 +134,7 @@ export function CompanySettingsSidebar() {
<SidebarNavItem to="/company/settings/invites" label="Invites" icon={MailPlus} end />
<SidebarNavItem to="/company/settings/secrets" label="Secrets" icon={KeyRound} end />
</div>
- <div className="mt-5 px-3 pb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="mt-5 px-3 pb-1 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Instance settings
</div>
<div className="flex flex-col gap-0.5">
diff --git a/ui/src/components/CompanySwitcher.tsx b/ui/src/components/CompanySwitcher.tsx
index 2d009dba38..4c38e66d5a 100644
--- a/ui/src/components/CompanySwitcher.tsx
+++ b/ui/src/components/CompanySwitcher.tsx
@@ -55,7 +55,7 @@ export function CompanySwitcher({ open: controlledOpen, onOpenChange }: CompanyS
<ChevronsUpDown className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="w-[220px]">
+ <DropdownMenuContent align="start" className="w-(--sz-220px)">
<DropdownMenuLabel>Companies</DropdownMenuLabel>
<DropdownMenuSeparator />
{sidebarCompanies.map((company) => (
diff --git a/ui/src/components/DevRestartBanner.tsx b/ui/src/components/DevRestartBanner.tsx
index fec523be20..10192406b8 100644
--- a/ui/src/components/DevRestartBanner.tsx
+++ b/ui/src/components/DevRestartBanner.tsx
@@ -68,11 +68,11 @@ export function DevRestartBanner({ devServer }: { devServer?: DevServerHealthSta
<div className="border-b border-amber-300/60 bg-amber-50 text-amber-950 dark:border-amber-500/25 dark:bg-amber-500/10 dark:text-amber-100">
<div className="flex flex-col gap-3 px-3 py-2.5 md:flex-row md:items-center md:justify-between">
<div className="min-w-0">
- <div className="flex items-center gap-2 text-[12px] font-semibold uppercase tracking-[0.18em]">
+ <div className="flex items-center gap-2 text-xs font-semibold uppercase tracking-(--tracking-caps)">
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
<span>Restart Required</span>
{devServer.autoRestartEnabled ? (
- <span className="rounded-full bg-amber-900/10 px-2 py-0.5 text-[10px] tracking-[0.14em] dark:bg-amber-100/10">
+ <span className="rounded-full bg-amber-900/10 px-2 py-0.5 text-(length:--text-nano) tracking-(--tracking-eyebrow) dark:bg-amber-100/10">
Auto-Restart On
</span>
) : null}
diff --git a/ui/src/components/DocumentAnnotationLayer.tsx b/ui/src/components/DocumentAnnotationLayer.tsx
index 619ff6a0f9..1613416854 100644
--- a/ui/src/components/DocumentAnnotationLayer.tsx
+++ b/ui/src/components/DocumentAnnotationLayer.tsx
@@ -473,7 +473,7 @@ export function DocumentAnnotationLayer({
: isStale
? "bg-yellow-200 outline outline-2 outline-dashed outline-offset-0 outline-yellow-700/65 dark:bg-yellow-600 dark:outline-yellow-200/70"
: isFocused
- ? "bg-yellow-300 outline outline-2 outline-offset-0 outline-yellow-700/85 shadow-[0_0_0_1px_var(--color-background)] dark:bg-yellow-500 dark:outline-yellow-200/85"
+ ? "bg-yellow-300 outline outline-2 outline-offset-0 outline-yellow-700/85 shadow-(--shadow-extract-6) dark:bg-yellow-500 dark:outline-yellow-200/85"
: "bg-yellow-200 dark:bg-yellow-600",
)}
style={{
@@ -489,7 +489,7 @@ export function DocumentAnnotationLayer({
</div>
) : null}
<div
- className="paperclip-doc-annotation-layer pointer-events-none absolute inset-0 z-[2]"
+ className="paperclip-doc-annotation-layer pointer-events-none absolute inset-0 z-(--z-2)"
aria-hidden="true"
>
<div ref={overlayRef} className="relative h-full w-full">
diff --git a/ui/src/components/DocumentAnnotationPanel.tsx b/ui/src/components/DocumentAnnotationPanel.tsx
index 25903d1175..d18607cb46 100644
--- a/ui/src/components/DocumentAnnotationPanel.tsx
+++ b/ui/src/components/DocumentAnnotationPanel.tsx
@@ -71,7 +71,7 @@ export function DocumentAnnotationPanel(props: AnnotationPanelProps) {
<SheetContent
side="bottom"
showCloseButton={false}
- className="paperclip-doc-annotation-sheet z-[60] flex max-h-[88vh] flex-col rounded-none border-t border-border bg-popover p-0 text-popover-foreground shadow-2xl"
+ className="paperclip-doc-annotation-sheet z-(--z-60) flex max-h-(--sz-88vh) flex-col rounded-none border-t border-border bg-popover p-0 text-popover-foreground shadow-2xl"
>
<SheetTitle className="sr-only">
Comments on {props.documentKey} revision {props.documentRevisionNumber}
@@ -91,7 +91,7 @@ export function DocumentAnnotationPanel(props: AnnotationPanelProps) {
aria-label={`Annotations for ${props.documentKey.toUpperCase()}, revision ${props.documentRevisionNumber}`}
data-testid="document-annotation-panel"
className={cn(
- "isolate flex h-full max-h-[80vh] w-[360px] shrink-0 flex-col overflow-hidden rounded-none border border-border bg-popover text-popover-foreground shadow-xl",
+ "isolate flex h-full max-h-(--sz-80vh) w-(--sz-360px) shrink-0 flex-col overflow-hidden rounded-none border border-border bg-popover text-popover-foreground shadow-xl",
props.className,
)}
style={props.desktopWidth ? { width: props.desktopWidth, maxWidth: props.desktopWidth } : undefined}
@@ -328,7 +328,7 @@ function AnnotationPanelBody(props: AnnotationPanelProps) {
data-testid={bodyTestId}
className="flex items-center justify-end gap-1 border-b border-border bg-popover px-2 py-1.5"
>
- <span className="text-[11px] tabular-nums text-muted-foreground">
+ <span className="text-(length:--text-micro) tabular-nums text-muted-foreground">
rev {props.documentRevisionNumber}
</span>
<Button
@@ -348,7 +348,7 @@ function AnnotationPanelBody(props: AnnotationPanelProps) {
{props.newCommentDisabled && props.newCommentDisabledReason ? (
<p
data-testid="document-annotation-disabled-reason"
- className="border-b border-border bg-muted px-3 py-1.5 text-[11px] text-muted-foreground"
+ className="border-b border-border bg-muted px-3 py-1.5 text-(length:--text-micro) text-muted-foreground"
>
{props.newCommentDisabledReason}
</p>
@@ -356,7 +356,7 @@ function AnnotationPanelBody(props: AnnotationPanelProps) {
{mutationError ? (
<p
data-testid="document-annotation-error"
- className="border-b border-border bg-destructive/10 px-3 py-1.5 text-[11px] text-destructive"
+ className="border-b border-border bg-destructive/10 px-3 py-1.5 text-(length:--text-micro) text-destructive"
>
{mutationError}
</p>
@@ -408,7 +408,7 @@ function AnnotationPanelBody(props: AnnotationPanelProps) {
{currentUser.image ? <AvatarImage src={currentUser.image} alt={currentUser.name} /> : null}
<AvatarFallback>{deriveInitials(currentUser.name)}</AvatarFallback>
</Avatar>
- <span className="truncate text-[11px] font-medium text-foreground">{currentUser.name}</span>
+ <span className="truncate text-(length:--text-micro) font-medium text-foreground">{currentUser.name}</span>
</div>
<Textarea
ref={composerRef}
@@ -626,7 +626,7 @@ function CommentRow({
focused && "ring-2 ring-primary/40",
)}
>
- <div className="mb-0.5 flex items-center justify-between gap-2 text-[11px]">
+ <div className="mb-0.5 flex items-center justify-between gap-2 text-(length:--text-micro)">
<span className="flex min-w-0 items-center gap-1.5">
<Avatar size="xs" className="shrink-0">
{author.role === "agent" ? (
diff --git a/ui/src/components/DocumentDiffModal.tsx b/ui/src/components/DocumentDiffModal.tsx
index 715ca82eda..b9543c3ee4 100644
--- a/ui/src/components/DocumentDiffModal.tsx
+++ b/ui/src/components/DocumentDiffModal.tsx
@@ -73,8 +73,8 @@ export function DocumentDiffModal({
const lineClassesByKind: Record<DiffRow["kind"], string> = {
context: "bg-transparent",
- removed: "bg-red-500/10 text-red-100",
- added: "bg-green-500/10 text-green-100",
+ removed: "bg-red-500/10 text-red-900 dark:text-red-100",
+ added: "bg-green-500/10 text-green-900 dark:text-green-100",
};
const markerByKind: Record<DiffRow["kind"], string> = {
@@ -85,7 +85,7 @@ export function DocumentDiffModal({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="!max-w-[90%] w-full max-h-[85vh] overflow-hidden flex flex-col">
+ <DialogContent className="!max-w-(--pct-90) w-full max-h-(--sz-85vh) overflow-hidden flex flex-col">
<div className="flex items-center justify-between gap-4">
<DialogHeader className="shrink-0">
<DialogTitle>
@@ -95,7 +95,7 @@ export function DocumentDiffModal({
<div className="flex items-center gap-4 shrink-0">
<div className="flex items-center gap-2">
- <span className="rounded-full border border-red-500/30 bg-red-500/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-red-400">Old</span>
+ <span className="rounded-full border border-red-500/30 bg-red-500/10 px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wider text-red-400">Old</span>
<Select
value={effectiveLeftId ?? ""}
onValueChange={(value) => setLeftRevisionId(value)}
@@ -113,7 +113,7 @@ export function DocumentDiffModal({
</Select>
</div>
<div className="flex items-center gap-2">
- <span className="rounded-full border border-green-500/30 bg-green-500/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-green-400">New</span>
+ <span className="rounded-full border border-green-500/30 bg-green-500/10 px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wider text-green-400">New</span>
<Select
value={effectiveRightId ?? ""}
onValueChange={(value) => setRightRevisionId(value)}
@@ -141,8 +141,8 @@ export function DocumentDiffModal({
) : leftRevision.id === rightRevision.id ? (
<div className="p-6 text-center text-muted-foreground text-sm">Both sides are the same revision.</div>
) : (
- <div className="font-mono text-[12px] leading-6">
- <div className="grid grid-cols-[56px_56px_24px_minmax(0,1fr)] border-b border-border/60 bg-muted/30 px-3 py-2 text-[11px] uppercase tracking-wide text-muted-foreground">
+ <div className="font-mono text-xs leading-6">
+ <div className="grid grid-cols-(--gtc-1) border-b border-border/60 bg-muted/30 px-3 py-2 text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">
<span>Old</span>
<span>New</span>
<span />
@@ -151,7 +151,7 @@ export function DocumentDiffModal({
{diffRows.map((row, index) => (
<div
key={`${row.kind}-${index}-${row.oldLineNumber ?? "x"}-${row.newLineNumber ?? "x"}`}
- className={`grid grid-cols-[56px_56px_24px_minmax(0,1fr)] gap-0 border-b border-border/30 px-3 ${lineClassesByKind[row.kind]}`}
+ className={`grid grid-cols-(--gtc-1) gap-0 border-b border-border/30 px-3 ${lineClassesByKind[row.kind]}`}
>
<span className="select-none border-r border-border/30 pr-3 text-right text-muted-foreground">
{row.oldLineNumber ?? ""}
diff --git a/ui/src/components/DocumentFrameHeader.tsx b/ui/src/components/DocumentFrameHeader.tsx
index a76f8883c1..1aaa052c0d 100644
--- a/ui/src/components/DocumentFrameHeader.tsx
+++ b/ui/src/components/DocumentFrameHeader.tsx
@@ -74,12 +74,12 @@ export function DocumentFrameHeader({
{documentLabel ? (
<>
<span className="truncate text-sm font-semibold text-foreground">{documentLabel}</span>
- <span className="shrink-0 rounded-full border border-border px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground">
+ <span className="shrink-0 rounded-full border border-border px-2 py-0.5 font-mono text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{documentKey}
</span>
</>
) : (
- <span className="shrink-0 rounded-full border border-border px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground">
+ <span className="shrink-0 rounded-full border border-border px-2 py-0.5 font-mono text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{documentKey}
</span>
)}
@@ -91,8 +91,8 @@ export function DocumentFrameHeader({
variant="ghost"
size="sm"
className={cn(
- "h-auto px-1.5 py-0 text-[11px] font-normal text-muted-foreground hover:text-foreground",
- revisionMenu.historicalPreview && "text-amber-300 hover:text-amber-200",
+ "h-auto px-1.5 py-0 text-(length:--text-micro) font-normal text-muted-foreground hover:text-foreground",
+ revisionMenu.historicalPreview && "text-amber-700 hover:text-amber-800 dark:text-amber-300 dark:hover:text-amber-200",
)}
>
rev {revisionMenu.displayedRevisionNumber}
@@ -118,7 +118,7 @@ export function DocumentFrameHeader({
<div className="flex items-center gap-2">
<span className="font-medium">rev {revision.revisionNumber}</span>
{isCurrentRevision ? (
- <span className="rounded-full border border-border px-1.5 py-0.5 text-[10px] uppercase tracking-[0.12em] text-muted-foreground">
+ <span className="rounded-full border border-border px-1.5 py-0.5 text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Current
</span>
) : null}
@@ -140,7 +140,7 @@ export function DocumentFrameHeader({
{updatedAt ? (
<a
href={updatedHref ?? `#document-${encodeURIComponent(documentKey)}`}
- className="truncate text-[11px] text-muted-foreground transition-colors hover:text-foreground hover:underline"
+ className="truncate text-(length:--text-micro) text-muted-foreground transition-colors hover:text-foreground hover:underline"
>
updated {relativeTime(updatedAt)}
</a>
diff --git a/ui/src/components/EntityRow.tsx b/ui/src/components/EntityRow.tsx
index bc88e971ec..abc734280d 100644
--- a/ui/src/components/EntityRow.tsx
+++ b/ui/src/components/EntityRow.tsx
@@ -50,7 +50,7 @@ export function EntityRow({
<div className={cn("min-w-0", !meta && "flex-1", titleClassName)}>
<div className="flex items-center gap-2">
{identifier && (
- <span className="text-xs text-muted-foreground font-mono shrink-0 relative top-[1px]">
+ <span className="text-xs text-muted-foreground font-mono shrink-0 relative top-(--sz-1px)">
{identifier}
</span>
)}
diff --git a/ui/src/components/ExecutionParticipantPicker.tsx b/ui/src/components/ExecutionParticipantPicker.tsx
index cf21a5c35f..3acfdbd74d 100644
--- a/ui/src/components/ExecutionParticipantPicker.tsx
+++ b/ui/src/components/ExecutionParticipantPicker.tsx
@@ -97,7 +97,7 @@ export function ExecutionParticipantPicker({
<PopoverTrigger asChild>
<button
className={cn(
- "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors cursor-pointer",
+ "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-(length:--text-nano) font-medium transition-colors cursor-pointer",
values.length > 0
? "border-border text-foreground hover:bg-accent/50"
: "border-dashed border-border/60 text-muted-foreground hover:border-border hover:text-foreground",
@@ -105,7 +105,7 @@ export function ExecutionParticipantPicker({
>
<Icon className="h-3 w-3" />
{values.length > 0 ? (
- <span className="truncate max-w-[100px]">
+ <span className="truncate max-w-(--sz-100px)">
{values.map(participantLabel).join(", ")}
</span>
) : (
diff --git a/ui/src/components/ExecutionWorkspaceCloseDialog.tsx b/ui/src/components/ExecutionWorkspaceCloseDialog.tsx
index 6f98114f45..b103ffd8e8 100644
--- a/ui/src/components/ExecutionWorkspaceCloseDialog.tsx
+++ b/ui/src/components/ExecutionWorkspaceCloseDialog.tsx
@@ -89,7 +89,7 @@ export function ExecutionWorkspaceCloseDialog({
<Dialog open={open} onOpenChange={(nextOpen) => {
if (!closeWorkspace.isPending) onOpenChange(nextOpen);
}}>
- <DialogContent className="max-h-[85vh] overflow-y-auto sm:max-w-2xl">
+ <DialogContent className="max-h-(--sz-85vh) overflow-y-auto sm:max-w-2xl">
<DialogHeader>
<DialogTitle>{actionLabel}</DialogTitle>
<DialogDescription className="break-words">
@@ -178,29 +178,29 @@ export function ExecutionWorkspaceCloseDialog({
<div className="rounded-xl border border-border bg-background px-4 py-3 text-sm">
<div className="grid gap-2 sm:grid-cols-2">
<div>
- <div className="text-xs uppercase tracking-[0.16em] text-muted-foreground">Branch</div>
+ <div className="text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Branch</div>
<div className="font-mono text-xs">{readiness.git.branchName ?? "Unknown"}</div>
</div>
<div>
- <div className="text-xs uppercase tracking-[0.16em] text-muted-foreground">Base ref</div>
+ <div className="text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Base ref</div>
<div className="font-mono text-xs">{readiness.git.baseRef ?? "Not set"}</div>
</div>
<div>
- <div className="text-xs uppercase tracking-[0.16em] text-muted-foreground">Merged into base</div>
+ <div className="text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Merged into base</div>
<div>{readiness.git.isMergedIntoBase == null ? "Unknown" : readiness.git.isMergedIntoBase ? "Yes" : "No"}</div>
</div>
<div>
- <div className="text-xs uppercase tracking-[0.16em] text-muted-foreground">Ahead / behind</div>
+ <div className="text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Ahead / behind</div>
<div>
{(readiness.git.aheadCount ?? 0).toString()} / {(readiness.git.behindCount ?? 0).toString()}
</div>
</div>
<div>
- <div className="text-xs uppercase tracking-[0.16em] text-muted-foreground">Dirty tracked files</div>
+ <div className="text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Dirty tracked files</div>
<div>{readiness.git.dirtyEntryCount}</div>
</div>
<div>
- <div className="text-xs uppercase tracking-[0.16em] text-muted-foreground">Untracked files</div>
+ <div className="text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Untracked files</div>
<div>{readiness.git.untrackedEntryCount}</div>
</div>
</div>
diff --git a/ui/src/components/ExternalObjectPill.tsx b/ui/src/components/ExternalObjectPill.tsx
index 55970a5847..298fcbdb28 100644
--- a/ui/src/components/ExternalObjectPill.tsx
+++ b/ui/src/components/ExternalObjectPill.tsx
@@ -134,7 +134,7 @@ export function ExternalObjectPill({
tone.split(" ").filter((c) => c.startsWith("text-")).join(" "),
overlay,
interactive
- && "hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
+ && "hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring",
className,
);
const titleAttr = sourceSummary
@@ -149,11 +149,11 @@ export function ExternalObjectPill({
sizeClassName="h-3 w-3"
label={`${providerLabel}: ${statusLabel}`}
/>
- <span className="max-w-[16rem] truncate font-medium">{valueLabel}</span>
+ <span className="max-w-(--sz-16rem) truncate font-medium">{valueLabel}</span>
</>
);
const countSuffix = typeof sourceCount === "number" && sourceCount > 1 ? (
- <span className="tabular-nums text-[10px] font-medium opacity-80">×{sourceCount}</span>
+ <span className="tabular-nums text-(length:--text-nano) font-medium opacity-80">×{sourceCount}</span>
) : null;
const innerContent = (
<>
diff --git a/ui/src/components/ExternalObjectStatusIcon.tsx b/ui/src/components/ExternalObjectStatusIcon.tsx
index a6a42de052..3c17a941cd 100644
--- a/ui/src/components/ExternalObjectStatusIcon.tsx
+++ b/ui/src/components/ExternalObjectStatusIcon.tsx
@@ -64,7 +64,7 @@ export function ExternalObjectStatusIcon({
// The clock overlay needs a positioned wrapper. Inline mode keeps the icon
// tight to the surrounding text; pill mode expects to size by sizeClassName.
const wrapperBase = inline
- ? "relative mr-1 inline-flex shrink-0 align-[-0.125em]"
+ ? "relative mr-1 inline-flex shrink-0 align-(--va-0_125em)"
: "relative inline-flex shrink-0";
const iconSize = inline ? "h-3 w-3" : sizeClassName;
const isSpinner = category === "running";
diff --git a/ui/src/components/ExternalObjectStatusSummary.tsx b/ui/src/components/ExternalObjectStatusSummary.tsx
index b3400fa052..ead5f1da36 100644
--- a/ui/src/components/ExternalObjectStatusSummary.tsx
+++ b/ui/src/components/ExternalObjectStatusSummary.tsx
@@ -68,7 +68,7 @@ export function ExternalObjectStatusSummary({
aria-label={title}
title={title}
className={cn(
- "inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium tabular-nums leading-none",
+ "inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium tabular-nums leading-none",
badgeClass,
compact && "px-1 py-0.5",
className,
diff --git a/ui/src/components/FeedCard.tsx b/ui/src/components/FeedCard.tsx
index 09b8471058..0bcda8af40 100644
--- a/ui/src/components/FeedCard.tsx
+++ b/ui/src/components/FeedCard.tsx
@@ -177,7 +177,7 @@ function getIconSpec(
// Heartbeat — animated when active, static otherwise
if (action.startsWith("heartbeat.")) {
if (isActive && action === "heartbeat.invoked") {
- return { kind: "lucide", Icon: Loader2, color: "text-cyan-600 dark:text-cyan-400", spin: true };
+ return { kind: "lucide", Icon: Loader2, color: "text-blue-600 dark:text-blue-400", spin: true };
}
return { kind: "lucide", Icon: Loader2, color: "text-muted-foreground" };
}
@@ -429,15 +429,15 @@ export function FeedCard({
const verb = formatVerb(event.action, details, isPinned ? "pinned" : "chronological");
const iconSpec = getIconSpec(event, details, isActive);
- const mutedTextBase = isMuted ? "text-muted-foreground/70" : "text-[#959596]";
+ const mutedTextBase = isMuted ? "text-muted-foreground/70" : "text-(--hex-959596)";
const mutedTextHover = isMuted ? "" : "group-hover:text-white";
const card = (
<div
data-fc="card"
className={cn(
- "group ml-3 mr-3 md:ml-0 my-2 flex items-center gap-2 rounded-lg border bg-card p-[18px] text-xs",
- "transition-[background-color,border-color] duration-150",
+ "group ml-3 mr-3 md:ml-0 my-2 flex items-center gap-2 rounded-lg border bg-card p-(--sz-18px) text-xs",
+ "transition-(--tp-background-color-border-color) duration-150",
content.link && "cursor-pointer hover:bg-accent hover:border-muted-foreground/30",
className,
)}
diff --git a/ui/src/components/FileTree.tsx b/ui/src/components/FileTree.tsx
index 338484a1ed..650a50ad38 100644
--- a/ui/src/components/FileTree.tsx
+++ b/ui/src/components/FileTree.tsx
@@ -417,8 +417,8 @@ export function FileTree({
className={cn(
node.kind === "dir"
? showCheckboxes
- ? "group grid w-full grid-cols-[auto_minmax(0,1fr)_2.25rem] items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground"
- : "group grid w-full grid-cols-[minmax(0,1fr)_2.25rem] items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground max-[480px]:grid-cols-[minmax(0,1fr)]"
+ ? "group grid w-full grid-cols-(--gtc-2) items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground"
+ : "group grid w-full grid-cols-(--gtc-3) items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground max-[480px]:grid-cols-(--gtc-4)"
: "group flex w-full items-center gap-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground cursor-pointer",
TREE_ROW_HEIGHT_CLASS,
isSelected && "text-foreground bg-accent/20",
@@ -466,7 +466,7 @@ export function FileTree({
{badge && (
<span
className={cn(
- "ml-3 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide",
+ "ml-3 shrink-0 rounded-full px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide",
statusBadge[badge.status] ?? statusBadgeDefault,
)}
title={badge.tooltip}
@@ -478,7 +478,7 @@ export function FileTree({
{node.kind === "dir" && (
<button
type="button"
- className="flex h-9 w-9 items-center justify-center self-center rounded-sm text-muted-foreground opacity-70 transition-[background-color,color,opacity] hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50 max-[480px]:hidden"
+ className="flex h-9 w-9 items-center justify-center self-center rounded-sm text-muted-foreground opacity-70 transition-(--tp-background-color-color-opacity) hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50 max-[480px]:hidden"
onClick={(event) => {
event.stopPropagation();
onToggleDir(node.path);
diff --git a/ui/src/components/FileViewerSheet.test.tsx b/ui/src/components/FileViewerSheet.test.tsx
index c01eb2a42b..8e1ba75d02 100644
--- a/ui/src/components/FileViewerSheet.test.tsx
+++ b/ui/src/components/FileViewerSheet.test.tsx
@@ -164,7 +164,7 @@ describe("FileViewerMetadataRow", () => {
it("reserves metadata row height while file details load", () => {
const markup = renderToStaticMarkup(<FileViewerMetadataRow state={state} />);
- expect(markup).toContain("min-h-[18px]");
+ expect(markup).toContain("min-h-(--sz-18px)");
expect(markup).toContain("Loading file details");
});
});
diff --git a/ui/src/components/FileViewerSheet.tsx b/ui/src/components/FileViewerSheet.tsx
index 5706bda1ec..f70b7cf24e 100644
--- a/ui/src/components/FileViewerSheet.tsx
+++ b/ui/src/components/FileViewerSheet.tsx
@@ -223,7 +223,7 @@ export function FileViewerMetadataRow({
state: FileViewerUrlState | null;
}) {
return (
- <div className="flex min-h-[18px] flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground">
+ <div className="flex min-h-(--sz-18px) flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground">
{resolvedResource ? (
<>
{resolvedResource.previewKind ? <span className="capitalize">{resolvedResource.previewKind}</span> : null}
@@ -354,7 +354,7 @@ export function FileContentViewer({ content, highlightedLine, onLoaded }: FileCo
role="region"
aria-label={`${resource.title} source`}
tabIndex={0}
- className="paperclip-file-viewer-code flex-1 overflow-auto bg-[var(--paperclip-code-bg,theme(colors.muted.DEFAULT))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ className="paperclip-file-viewer-code flex-1 overflow-auto bg-(--code-bg-resolved) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
>
<pre className="m-0 font-mono text-xs leading-5">
{lines.map((lineText, index) => {
@@ -366,17 +366,20 @@ export function FileContentViewer({ content, highlightedLine, onLoaded }: FileCo
ref={isHighlighted ? highlightedLineRef : undefined}
data-line-number={lineNumber}
className={cn(
- "grid grid-cols-[auto_minmax(0,1fr)]",
- isHighlighted && "bg-[var(--paperclip-code-highlight-bg,rgba(250,204,21,0.12))]",
+ "grid grid-cols-(--gtc-5)",
+ // Batch 4 resolved the former half-migrated var(--x, fallback)
+ // pattern here into --code-highlight-bg-resolved (see
+ // ui/src/index.css MISC token block + TOKEN-AUDIT.md Batch 4 log).
+ isHighlighted && "bg-(--code-highlight-bg-resolved)",
)}
>
<span
aria-hidden="true"
className={cn(
- "sticky left-0 z-10 shrink-0 select-none pl-3 pr-4 text-right text-[var(--paperclip-code-gutter-fg,theme(colors.muted.foreground))] opacity-70",
- "bg-[var(--paperclip-code-bg,theme(colors.muted.DEFAULT))]",
+ "sticky left-0 z-10 shrink-0 select-none pl-3 pr-4 text-right text-(--code-gutter-fg-resolved) opacity-70",
+ "bg-(--code-bg-resolved)",
isHighlighted &&
- "opacity-100 bg-[var(--paperclip-code-highlight-bg,rgba(250,204,21,0.12))] border-l-2 border-[var(--paperclip-code-highlight-border,rgb(234,179,8))]",
+ "opacity-100 bg-(--code-highlight-bg-resolved) border-l-2 border-(--code-highlight-border-resolved)",
)}
style={{ width: gutterWidth, minWidth: gutterWidth }}
>
@@ -733,7 +736,7 @@ export function FileViewerSheet({
return (
<Dialog open={computedOpen} onOpenChange={handleOpenChange}>
<DialogContent
- className="flex h-[min(840px,calc(100dvh-2rem))] w-[calc(100vw-2rem)] max-w-[min(1280px,calc(100vw-2rem))] flex-col gap-0 overflow-hidden p-0 sm:w-[94vw] sm:max-w-[1280px]"
+ className="flex h-(--sz-calc-3) w-(--sz-calc-4) max-w-(--sz-calc-5) flex-col gap-0 overflow-hidden p-0 sm:w-(--sz-94vw) sm:max-w-(--sz-1280px)"
aria-labelledby={FILE_VIEWER_LABELLED_BY_ID}
aria-describedby={FILE_VIEWER_DESCRIBED_BY_ID}
showCloseButton={false}
@@ -746,7 +749,7 @@ export function FileViewerSheet({
}}
>
<DialogHeader className="border-b border-border gap-1 p-3">
- <div className="grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2">
+ <div className="grid min-w-0 grid-cols-(--gtc-6) items-start gap-2">
{browseMode ? (
<FolderSearch aria-hidden="true" className="mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" />
) : (
diff --git a/ui/src/components/FinanceBillerCard.tsx b/ui/src/components/FinanceBillerCard.tsx
index 542c10507b..e2673b9f96 100644
--- a/ui/src/components/FinanceBillerCard.tsx
+++ b/ui/src/components/FinanceBillerCard.tsx
@@ -19,22 +19,22 @@ export function FinanceBillerCard({ row }: FinanceBillerCardProps) {
</div>
<div className="text-right">
<div className="text-lg font-semibold tabular-nums">{formatCents(row.netCents)}</div>
- <div className="text-[11px] uppercase tracking-[0.16em] text-muted-foreground">net</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">net</div>
</div>
</div>
</CardHeader>
<CardContent className="space-y-3 px-4 pb-4 pt-3">
<div className="grid gap-2 text-sm sm:grid-cols-3">
<div className="border border-border p-3">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">debits</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">debits</div>
<div className="mt-1 font-medium tabular-nums">{formatCents(row.debitCents)}</div>
</div>
<div className="border border-border p-3">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">credits</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">credits</div>
<div className="mt-1 font-medium tabular-nums">{formatCents(row.creditCents)}</div>
</div>
<div className="border border-border p-3">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">estimated</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">estimated</div>
<div className="mt-1 font-medium tabular-nums">{formatCents(row.estimatedDebitCents)}</div>
</div>
</div>
diff --git a/ui/src/components/FinanceTimelineCard.tsx b/ui/src/components/FinanceTimelineCard.tsx
index 1fa516ba77..c01ab39c30 100644
--- a/ui/src/components/FinanceTimelineCard.tsx
+++ b/ui/src/components/FinanceTimelineCard.tsx
@@ -59,7 +59,7 @@ export function FinanceTimelineCard({
<div className="text-right tabular-nums">
<div className="text-sm font-semibold">{formatCents(row.amountCents)}</div>
<div className="text-xs text-muted-foreground">{row.currency}</div>
- {row.estimated ? <div className="text-[11px] uppercase tracking-[0.12em] text-amber-600">estimated</div> : null}
+ {row.estimated ? <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-amber-600">estimated</div> : null}
</div>
</div>
</div>
diff --git a/ui/src/components/FoldCurtain.tsx b/ui/src/components/FoldCurtain.tsx
index a6370b26ce..0a42356720 100644
--- a/ui/src/components/FoldCurtain.tsx
+++ b/ui/src/components/FoldCurtain.tsx
@@ -102,7 +102,7 @@ export function FoldCurtain({
ref={contentRef}
className={cn(
"fold-curtain__content relative overflow-hidden",
- allowTransition && "motion-safe:transition-[max-height] motion-reduce:transition-none",
+ allowTransition && "motion-safe:transition-(--tp-max-height) motion-reduce:transition-none",
contentClassName,
)}
style={{
diff --git a/ui/src/components/FrontDoor.tsx b/ui/src/components/FrontDoor.tsx
index 9aa8984528..24345fa7f9 100644
--- a/ui/src/components/FrontDoor.tsx
+++ b/ui/src/components/FrontDoor.tsx
@@ -7,7 +7,7 @@ interface FrontDoorProps {
export function FrontDoor({ onChoose }: FrontDoorProps) {
return (
- <div className="flex flex-col items-center justify-center min-h-[60vh] px-8">
+ <div className="flex flex-col items-center justify-center min-h-(--sz-60vh) px-8">
<div className="text-center mb-10">
<h2 className="text-2xl font-bold tracking-tight">
Welcome to Paperclip
diff --git a/ui/src/components/ImageGalleryModal.tsx b/ui/src/components/ImageGalleryModal.tsx
index 0d0d1f994b..72e0fafd80 100644
--- a/ui/src/components/ImageGalleryModal.tsx
+++ b/ui/src/components/ImageGalleryModal.tsx
@@ -93,7 +93,7 @@ export function ImageGalleryModal({
>
{/* Top bar */}
<div className="flex items-center justify-between px-5 py-3 text-white/80 text-sm shrink-0">
- <span className="truncate max-w-[50%] font-medium" title={filename}>
+ <span className="truncate max-w-(--pct-50) font-medium" title={filename}>
{filename}
</span>
<div className="flex items-center gap-4">
diff --git a/ui/src/components/InlineEditor.tsx b/ui/src/components/InlineEditor.tsx
index 094566243a..77f6905adc 100644
--- a/ui/src/components/InlineEditor.tsx
+++ b/ui/src/components/InlineEditor.tsx
@@ -356,7 +356,7 @@ export function InlineEditor({
<div className="flex min-h-4 items-center justify-end pr-1">
<span
className={cn(
- "text-[11px] transition-opacity duration-150",
+ "text-(length:--text-micro) transition-opacity duration-150",
autosaveState === "error" ? "text-destructive" : "text-muted-foreground",
autosaveState === "idle" ? "opacity-0" : "opacity-100",
)}
diff --git a/ui/src/components/InlineEntitySelector.tsx b/ui/src/components/InlineEntitySelector.tsx
index 58fea66970..316899d16b 100644
--- a/ui/src/components/InlineEntitySelector.tsx
+++ b/ui/src/components/InlineEntitySelector.tsx
@@ -131,7 +131,7 @@ export const InlineEntitySelector = forwardRef<HTMLButtonElement, InlineEntitySe
align="start"
side="bottom"
collisionPadding={16}
- className="w-[min(20rem,calc(100vw-2rem))] p-1"
+ className="w-(--sz-calc-6) p-1"
disablePortal={disablePortal}
onOpenAutoFocus={(event) => {
event.preventDefault();
diff --git a/ui/src/components/IssueAssignedBacklogNotice.tsx b/ui/src/components/IssueAssignedBacklogNotice.tsx
index fb52d69b77..5e3fcc1bad 100644
--- a/ui/src/components/IssueAssignedBacklogNotice.tsx
+++ b/ui/src/components/IssueAssignedBacklogNotice.tsx
@@ -34,8 +34,8 @@ export function IssueAssignedBacklogNotice({
<p className="leading-5">
<span className="font-medium">Parked</span> —{" "}
<span className="font-medium">{assigneeLabel}</span> will not be woken until status changes to{" "}
- <code className="rounded bg-amber-100 px-1 py-0.5 text-[12px] dark:bg-amber-400/15">todo</code> or{" "}
- <code className="rounded bg-amber-100 px-1 py-0.5 text-[12px] dark:bg-amber-400/15">in_progress</code>.
+ <code className="rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-400/15">todo</code> or{" "}
+ <code className="rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-400/15">in_progress</code>.
</p>
{assigneeAgent ? (
<p className="text-xs leading-5 text-amber-800 dark:text-amber-200">
diff --git a/ui/src/components/IssueAttachmentsSection.tsx b/ui/src/components/IssueAttachmentsSection.tsx
index 9901fcd696..c68fee2781 100644
--- a/ui/src/components/IssueAttachmentsSection.tsx
+++ b/ui/src/components/IssueAttachmentsSection.tsx
@@ -94,7 +94,7 @@ function AttachmentActions({
function AttachmentMeta({ attachment }: { attachment: IssueAttachment }) {
return (
- <p className="mt-0.5 text-[11px] text-muted-foreground">
+ <p className="mt-0.5 text-(length:--text-micro) text-muted-foreground">
Attachment · {attachment.contentType} · {formatBytes(attachment.byteSize)}
</p>
);
@@ -134,7 +134,7 @@ function MarkdownAttachmentCard({
<p className="px-1 py-2 text-xs text-destructive">Could not load markdown preview.</p>
) : (
<FoldCurtain>
- <MarkdownBody className="paperclip-edit-in-place-content min-h-[220px] text-[15px] leading-7" softBreaks={false}>
+ <MarkdownBody className="paperclip-edit-in-place-content min-h-(--sz-220px) text-sm leading-7" softBreaks={false}>
{data ?? ""}
</MarkdownBody>
</FoldCurtain>
@@ -198,7 +198,7 @@ function GenericAttachmentRow({
>
{filename}
</a>
- <p className="truncate text-[11px] text-muted-foreground">
+ <p className="truncate text-(length:--text-micro) text-muted-foreground">
Attachment · {attachment.contentType} · {formatBytes(attachment.byteSize)}
</p>
</div>
diff --git a/ui/src/components/IssueBlockedNotice.tsx b/ui/src/components/IssueBlockedNotice.tsx
index 0595cf2500..8e9203e1ee 100644
--- a/ui/src/components/IssueBlockedNotice.tsx
+++ b/ui/src/components/IssueBlockedNotice.tsx
@@ -34,7 +34,7 @@ function BlockerRecoveryIndicator({ action }: { action: IssueRecoveryAction }) {
role="status"
aria-label={label}
title={`${label} — open the source task to act.`}
- className={`inline-flex shrink-0 items-center gap-0.5 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${tone.className}`}
+ className={`inline-flex shrink-0 items-center gap-0.5 rounded-full border px-1.5 py-0.5 text-(length:--text-nano) font-medium ${tone.className}`}
>
<Icon className="h-2.5 w-2.5" aria-hidden />
{label}
@@ -189,7 +189,7 @@ export function IssueBlockedNotice({
className="inline-flex max-w-full items-center gap-1 rounded-md border border-amber-300/70 bg-background/80 px-2 py-1 font-mono text-xs text-amber-950 transition-colors hover:border-amber-500 hover:bg-amber-100 hover:underline dark:border-amber-500/40 dark:bg-background/40 dark:text-amber-100 dark:hover:bg-amber-500/15"
>
<span>{blocker.identifier ?? blocker.id.slice(0, 8)}</span>
- <span className="max-w-[18rem] truncate font-sans text-[11px] text-amber-800 dark:text-amber-200">
+ <span className="max-w-(--sz-18rem) truncate font-sans text-(length:--text-micro) text-amber-800 dark:text-amber-200">
{blocker.title}
</span>
{recoveryAction ? <BlockerRecoveryIndicator action={recoveryAction} /> : null}
@@ -211,7 +211,7 @@ export function IssueBlockedNotice({
<p className="font-medium leading-5">This task still needs a next step.</p>
<p className="leading-5">
A run finished successfully, but this task is still open in{" "}
- <code className="rounded bg-amber-100 px-1 py-0.5 text-[12px] dark:bg-amber-400/15">
+ <code className="rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-400/15">
in_progress
</code>{" "}
with no clear owner for the next action.
diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx
index 2ede85effd..93ff00880c 100644
--- a/ui/src/components/IssueChatThread.test.tsx
+++ b/ui/src/components/IssueChatThread.test.tsx
@@ -347,7 +347,7 @@ describe("IssueChatThread", () => {
const viewport = container.querySelector('[data-testid="thread-viewport"]') as HTMLDivElement | null;
expect(viewport).not.toBeNull();
expect(viewport?.className).not.toContain("overflow-y-auto");
- expect(viewport?.className).not.toContain("max-h-[70vh]");
+ expect(viewport?.className).not.toContain("max-h-(--sz-70vh)");
act(() => {
root.unmount();
@@ -1754,10 +1754,10 @@ describe("IssueChatThread", () => {
);
expect(bubble).toBeDefined();
expect(bubble?.textContent).toContain("Here is my agent reply.");
- expect(bubble?.className).toContain("max-w-[calc(100%-0.5rem)]");
- expect(bubble?.className).toContain("sm:max-w-[85%]");
- // Neutral, not the human liveness-blue bubble.
- expect(bubble?.className).not.toContain("bg-[#2563EB]");
+ expect(bubble?.className).toContain("max-w-(--sz-calc-7)");
+ expect(bubble?.className).toContain("sm:max-w-(--pct-85)");
+ // Neutral, not the human liveness-blue bubble (--liveness-blue, DECISION-SHEET.md A6).
+ expect(bubble?.className).not.toContain("bg-(--liveness-blue)");
act(() => {
root.unmount();
@@ -2647,19 +2647,19 @@ describe("IssueChatThread", () => {
const dock = container.querySelector('[data-testid="issue-chat-composer-dock"]') as HTMLDivElement | null;
expect(dock).not.toBeNull();
expect(dock?.className).toContain("sticky");
- expect(dock?.className).toContain("bottom-[calc(env(safe-area-inset-bottom)+20px)]");
+ expect(dock?.className).toContain("bottom-(--sz-calc-8)");
expect(dock?.className).toContain("z-20");
const composer = container.querySelector('[data-testid="issue-chat-composer"]') as HTMLDivElement | null;
expect(composer).not.toBeNull();
expect(composer?.className).toContain("rounded-md");
expect(composer?.className).not.toContain("rounded-lg");
- expect(composer?.className).toContain("p-[15px]");
+ expect(composer?.className).toContain("p-(--sz-15px)");
const editor = container.querySelector('textarea[aria-label="Issue chat editor"]') as HTMLTextAreaElement | null;
- expect(editor?.dataset.contentClassName).toContain("max-h-[28dvh]");
+ expect(editor?.dataset.contentClassName).toContain("max-h-(--sz-28dvh)");
expect(editor?.dataset.contentClassName).toContain("overflow-y-auto");
- expect(editor?.dataset.contentClassName).not.toContain("min-h-[72px]");
+ expect(editor?.dataset.contentClassName).not.toContain("min-h-(--sz-72px)");
expect(editor?.dataset.fileDropTarget).toBe("parent");
act(() => {
diff --git a/ui/src/components/IssueChatThread.tsx b/ui/src/components/IssueChatThread.tsx
index a394ea15dc..b9e6fe1155 100644
--- a/ui/src/components/IssueChatThread.tsx
+++ b/ui/src/components/IssueChatThread.tsx
@@ -162,6 +162,7 @@ import {
} from "../lib/transcriptPresentation";
import { buildAgentMentionHref } from "@paperclipai/shared";
import { cn, formatDateTime, formatShortDate } from "../lib/utils";
+import { brandChipBadge } from "../lib/status-colors";
import { nextWorkMode, titleForPendingWorkMode, workModeMetaFor, workModeMetaList } from "../lib/work-mode-meta";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
@@ -232,7 +233,7 @@ const IssueChatCtx = createContext<IssueChatMessageContext>({
successfulRunHandoff: null,
});
-const AGENT_COMMENT_BUBBLE_WIDTH_CLASS = "max-w-[calc(100%-0.5rem)] sm:max-w-[85%]";
+const AGENT_COMMENT_BUBBLE_WIDTH_CLASS = "max-w-(--sz-calc-7) sm:max-w-(--pct-85)";
export type IssueChatRunFinalizationAction = {
id: "cancel" | "done";
@@ -659,7 +660,7 @@ function IssueChatFallbackThread({
<div className="mb-2 flex items-center gap-2 text-sm">
<span className="font-medium text-foreground">{fallbackAuthorLabel(message)}</span>
{message.createdAt ? (
- <span className="text-[11px] text-muted-foreground">
+ <span className="text-(length:--text-micro) text-muted-foreground">
{commentDateLabel(message.createdAt)}
</span>
) : null}
@@ -1055,7 +1056,7 @@ function IssueChatReasoningPart({ text }: { text: string }) {
{ticker.exiting !== null && (
<span
key={`out-${ticker.key}`}
- className="cot-line-exit absolute inset-x-0 truncate text-[13px] italic leading-5 text-muted-foreground/70"
+ className="cot-line-exit absolute inset-x-0 truncate text-(length:--text-compact) italic leading-5 text-muted-foreground/70"
onAnimationEnd={() => setTicker((t) => ({ ...t, exiting: null }))}
>
{ticker.exiting}
@@ -1064,7 +1065,7 @@ function IssueChatReasoningPart({ text }: { text: string }) {
<span
key={`in-${ticker.key}`}
className={cn(
- "absolute inset-x-0 truncate text-[13px] italic leading-5 text-muted-foreground/70",
+ "absolute inset-x-0 truncate text-(length:--text-compact) italic leading-5 text-muted-foreground/70",
ticker.key > 0 && "cot-line-enter",
)}
>
@@ -1112,7 +1113,7 @@ function IssueChatRollingToolPart({ toolParts }: { toolParts: ToolCallMessagePar
{ticker.exiting !== null && (
<span
key={`out-${ticker.key}`}
- className="cot-line-exit absolute inset-x-0 truncate text-[13px] leading-5 text-muted-foreground/70"
+ className="cot-line-exit absolute inset-x-0 truncate text-(length:--text-compact) leading-5 text-muted-foreground/70"
onAnimationEnd={() => setTicker((t) => ({ ...t, exiting: null }))}
>
{ticker.exiting}
@@ -1121,7 +1122,7 @@ function IssueChatRollingToolPart({ toolParts }: { toolParts: ToolCallMessagePar
<span
key={`in-${ticker.key}`}
className={cn(
- "absolute inset-x-0 truncate text-[13px] leading-5 text-muted-foreground/70",
+ "absolute inset-x-0 truncate text-(length:--text-compact) leading-5 text-muted-foreground/70",
ticker.key > 0 && "cot-line-enter",
)}
>
@@ -1222,7 +1223,7 @@ function IssueChatToolPart({
className="flex w-full items-center gap-2 rounded-md py-0.5 text-left transition-colors hover:bg-accent/5"
onClick={() => setOpen((current) => !current)}
>
- <span className="min-w-0 flex-1 truncate text-[13px] text-muted-foreground/80">
+ <span className="min-w-0 flex-1 truncate text-(length:--text-compact) text-muted-foreground/80">
{title}
{!intentDetail && summary ? <span className="ml-1.5 text-muted-foreground/50">{summary}</span> : null}
</span>
@@ -1236,16 +1237,16 @@ function IssueChatToolPart({
<div className="mt-1 space-y-2 pb-1">
{nonIntentDetails.length > 0 ? (
<div>
- <div className="mb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/60">
+ <div className="mb-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground/60">
Input
</div>
<dl className="space-y-1.5">
{nonIntentDetails.map((detail) => (
<div key={`${detail.label}:${detail.value}`}>
- <dt className="text-[10px] font-medium text-muted-foreground/60">
+ <dt className="text-(length:--text-nano) font-medium text-muted-foreground/60">
{detail.label}
</dt>
- <dd className={cn("text-xs leading-5 text-foreground/70", detail.tone === "code" && "font-mono text-[11px]")}>
+ <dd className={cn("text-xs leading-5 text-foreground/70", detail.tone === "code" && "font-mono text-(length:--text-micro)")}>
{detail.value}
</dd>
</div>
@@ -1254,18 +1255,18 @@ function IssueChatToolPart({
</div>
) : rawArgsText ? (
<div>
- <div className="mb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/60">
+ <div className="mb-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground/60">
Input
</div>
- <CopyablePreBlock className="overflow-x-auto rounded-md bg-accent/30 p-2 text-[11px] leading-4 text-foreground/70">{rawArgsText}</CopyablePreBlock>
+ <CopyablePreBlock className="overflow-x-auto rounded-md bg-accent/30 p-2 text-(length:--text-micro) leading-4 text-foreground/70">{rawArgsText}</CopyablePreBlock>
</div>
) : null}
{result !== undefined ? (
<div>
- <div className="mb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/60">
+ <div className="mb-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground/60">
Result
</div>
- <CopyablePreBlock className="overflow-x-auto rounded-md bg-accent/30 p-2 text-[11px] leading-4 text-foreground/70">{resultText}</CopyablePreBlock>
+ <CopyablePreBlock className="overflow-x-auto rounded-md bg-accent/30 p-2 text-(length:--text-micro) leading-4 text-foreground/70">{resultText}</CopyablePreBlock>
</div>
) : null}
</div>
@@ -1432,12 +1433,12 @@ function IssueChatUserMessage({
void onDeleteComment?.(commentId);
};
const messageBody = (
- <div className={cn("flex min-w-0 max-w-[85%] flex-col", isCurrentUser && "items-end")}>
+ <div className={cn("flex min-w-0 max-w-(--pct-85) flex-col", isCurrentUser && "items-end")}>
<div className={cn("mb-1 flex items-center gap-2 px-1", isCurrentUser ? "justify-end" : "justify-start")}>
<span className="text-sm font-medium text-foreground">{resolvedAuthorName}</span>
<SourceTrustBadge sourceTrust={sourceTrust} artifactLabel="comment" />
{followUpRequested ? (
- <Badge variant="outline" className="text-[10px] uppercase tracking-[0.14em]">
+ <Badge variant="outline" className="text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow)">
Follow-up
</Badge>
) : null}
@@ -1447,28 +1448,29 @@ function IssueChatUserMessage({
"min-w-0 max-w-full overflow-hidden break-all rounded-2xl px-4 py-2.5",
// Tail-hugging corner: flatten the bottom corner nearest the avatar so
// the bubble points at it (bottom-right for the right-aligned human).
- isCurrentUser ? "rounded-br-[4px]" : "rounded-bl-[4px]",
+ isCurrentUser ? "rounded-br-(--rad-4)" : "rounded-bl-(--rad-4)",
queued
? "bg-amber-50/80 dark:bg-amber-500/10"
: deleted
? "bg-muted/50 text-muted-foreground"
: isCurrentUser
- // Liveness blue (#2563EB) for the human's own messages (PAP-95 rev 5).
- ? "bg-[#2563EB] text-white"
+ // Liveness blue (--liveness-blue, decoupled from --status-task-in_progress
+ // in DECISION-SHEET.md A6) for the human's own messages (PAP-95 rev 5).
+ ? "bg-(--liveness-blue) text-white"
: "bg-muted",
pending && "opacity-80",
)}
>
{queued ? (
<div className="mb-1.5 flex items-center gap-2">
- <span className="inline-flex items-center rounded-full border border-amber-400/60 bg-amber-100/70 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.14em] text-amber-800 dark:border-amber-400/40 dark:bg-amber-500/20 dark:text-amber-200">
+ <span className="inline-flex items-center rounded-full border border-amber-400/60 bg-amber-100/70 px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-amber-800 dark:border-amber-400/40 dark:bg-amber-500/20 dark:text-amber-200">
{queueBadgeLabel}
</span>
{queueTargetRunId && onInterruptQueued ? (
<Button
size="sm"
variant="outline"
- className="h-6 border-red-300 px-2 text-[11px] text-red-700 hover:bg-red-50 hover:text-red-800 dark:border-red-500/40 dark:text-red-300 dark:hover:bg-red-500/10"
+ className="h-6 border-red-300 px-2 text-(length:--text-micro) text-red-700 hover:bg-red-50 hover:text-red-800 dark:border-red-500/40 dark:text-red-300 dark:hover:bg-red-500/10"
disabled={isInterruptingQueuedRun}
onClick={() => void onInterruptQueued(queueTargetRunId)}
>
@@ -1479,7 +1481,7 @@ function IssueChatUserMessage({
<Button
size="sm"
variant="outline"
- className="h-6 border-amber-300 px-2 text-[11px] text-amber-900 hover:bg-amber-100/80 hover:text-amber-950 dark:border-amber-500/40 dark:text-amber-100 dark:hover:bg-amber-500/10"
+ className="h-6 border-amber-300 px-2 text-(length:--text-micro) text-amber-900 hover:bg-amber-100/80 hover:text-amber-950 dark:border-amber-500/40 dark:text-amber-100 dark:hover:bg-amber-500/10"
onClick={() => onCancelQueued(commentId)}
>
Cancel
@@ -1497,7 +1499,7 @@ function IssueChatUserMessage({
</div>
{pending ? (
- <div className={cn("mt-1 flex px-1 text-[11px] text-muted-foreground", isCurrentUser ? "justify-end" : "justify-start")}>
+ <div className={cn("mt-1 flex px-1 text-(length:--text-micro) text-muted-foreground", isCurrentUser ? "justify-end" : "justify-start")}>
Sending...
</div>
) : (
@@ -1511,7 +1513,7 @@ function IssueChatUserMessage({
<TooltipTrigger asChild>
<a
href={anchorId ? `#${anchorId}` : undefined}
- className="text-[11px] text-muted-foreground hover:text-foreground hover:underline"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground hover:underline"
>
{message.createdAt ? commentDateLabel(message.createdAt) : ""}
</a>
@@ -1737,7 +1739,7 @@ function IssueChatAssistantMessage({
<TooltipTrigger asChild>
<a
href={anchorId ? `#${anchorId}` : undefined}
- className="text-[11px] text-muted-foreground hover:text-foreground hover:underline"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground hover:underline"
>
{message.createdAt ? commentDateLabel(message.createdAt) : ""}
</a>
@@ -1819,14 +1821,14 @@ function IssueChatAssistantMessage({
<AgentIcon icon={agentIcon} className="h-4 w-4" />
) : (
<Avatar size="sm" className="size-5">
- <AvatarFallback className="text-[10px]">{initialsForName(authorName)}</AvatarFallback>
+ <AvatarFallback className="text-(length:--text-nano)">{initialsForName(authorName)}</AvatarFallback>
</Avatar>
)}
</span>
<span className="text-sm font-medium text-foreground">{authorName}</span>
<SourceTrustBadge sourceTrust={sourceTrust} artifactLabel="comment" />
{followUpRequested ? (
- <Badge variant="outline" className="text-[10px] uppercase tracking-[0.14em]">
+ <Badge variant="outline" className="text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow)">
Follow-up
</Badge>
) : null}
@@ -1884,7 +1886,7 @@ function IssueChatAssistantMessage({
<span className="text-xs text-muted-foreground/60">{chainOfThoughtLabel?.toLowerCase()}</span>
<span className="ml-auto flex items-center gap-1.5">
{message.createdAt ? (
- <span className="text-[11px] text-muted-foreground/50">
+ <span className="text-(length:--text-micro) text-muted-foreground/50">
{commentDateLabel(message.createdAt)}
</span>
) : null}
@@ -1896,12 +1898,19 @@ function IssueChatAssistantMessage({
<span className="text-sm font-medium text-foreground">{authorName}</span>
<SourceTrustBadge sourceTrust={sourceTrust} artifactLabel="comment" />
{followUpRequested ? (
- <Badge variant="outline" className="text-[10px] uppercase tracking-[0.14em]">
+ <Badge variant="outline" className="text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow)">
Follow-up
</Badge>
) : null}
{isRunning ? (
- <span className="inline-flex items-center gap-1 rounded-full border border-cyan-400/40 bg-cyan-500/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.14em] text-cyan-700 dark:text-cyan-200">
+ // Gallery feedback r1: running chip uses the canonical brand blue
+ // (brandChipBadge.blue), not cyan; layout/size classes unchanged.
+ <span
+ className={cn(
+ "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow)",
+ brandChipBadge.blue,
+ )}
+ >
<Loader2 className="h-3 w-3 animate-spin" />
Running
</span>
@@ -2227,7 +2236,7 @@ function ExpiredRequestConfirmationActivity({
</a>
<button
type="button"
- className="inline-flex items-center gap-1 rounded-md border border-border/70 bg-background/70 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:border-border hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
+ className="inline-flex items-center gap-1 rounded-md border border-border/70 bg-background/70 px-1.5 py-0.5 text-(length:--text-micro) font-medium text-muted-foreground transition-colors hover:border-border hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
aria-expanded={expanded}
aria-controls={detailsId}
onClick={() => setExpanded((current) => !current)}
@@ -2344,7 +2353,7 @@ function isStaleSuccessfulRunHandoffNotice(input: {
function StaleDispositionWarningMetadataRow({ row }: { row: SystemNoticeMetadataRow }) {
const label = (
- <span className="text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground">
+ <span className="text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{row.label}
</span>
);
@@ -2354,7 +2363,7 @@ function StaleDispositionWarningMetadataRow({ row }: { row: SystemNoticeMetadata
return <span>{row.value}</span>;
case "code":
return (
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground/80">
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-(length:--text-micro) text-foreground/80">
{row.value}
</code>
);
@@ -2385,7 +2394,7 @@ function StaleDispositionWarningMetadataRow({ row }: { row: SystemNoticeMetadata
const runShort = row.runId.length > 12 ? `${row.runId.slice(0, 8)}...` : row.runId;
const content = (
<>
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground/80">
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-(length:--text-micro) text-foreground/80">
{runShort}
</code>
{row.status ? <span>{row.status}</span> : null}
@@ -2403,7 +2412,7 @@ function StaleDispositionWarningMetadataRow({ row }: { row: SystemNoticeMetadata
})();
return (
- <div className="grid grid-cols-[7.5rem_minmax(0,1fr)] gap-2 text-xs leading-5">
+ <div className="grid grid-cols-(--gtc-7) gap-2 text-xs leading-5">
{label}
<div className="min-w-0 break-words text-foreground/80">{value}</div>
</div>
@@ -2460,7 +2469,7 @@ function StaleDispositionWarningDetails({
{sections.map((section) => (
<div key={metadataSectionKey(section)} className="space-y-1.5">
{section.title ? (
- <div className="text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground">
+ <div className="text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{section.title}
</div>
) : null}
@@ -2507,7 +2516,7 @@ function StaleDispositionWarningRow({
</span>
<span className="ml-auto flex items-center gap-1.5">
{message.createdAt ? (
- <span data-testid="stale-disposition-warning-time" className="text-[11px] text-muted-foreground/50">
+ <span data-testid="stale-disposition-warning-time" className="text-(length:--text-micro) text-muted-foreground/50">
{commentDateLabel(message.createdAt)}
</span>
) : null}
@@ -2628,7 +2637,7 @@ function SystemNoticeCommentRow({
<TooltipTrigger asChild>
<a
href={anchorId ? `#${anchorId}` : undefined}
- className="text-[11px] text-muted-foreground hover:text-foreground hover:underline"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground hover:underline"
>
{message.createdAt ? commentDateLabel(message.createdAt) : ""}
</a>
@@ -2682,7 +2691,7 @@ function IssueChatMetadataRow({
return (
<div id={anchorId} data-testid={testid}>
<div className="ml-3 flex items-start gap-2.5 border-l-2 border-border/50 py-0.5 pl-3">
- <span className="mt-px flex size-[18px] shrink-0 items-center justify-center rounded-full border border-border/70 bg-muted/30 text-muted-foreground/60">
+ <span className="mt-px flex size-(--sz-18px) shrink-0 items-center justify-center rounded-full border border-border/70 bg-muted/30 text-muted-foreground/60">
{icon}
</span>
<div className="min-w-0 flex-1 space-y-1">{children}</div>
@@ -2796,7 +2805,7 @@ function IssueChatSystemMessage({ message }: { message: ThreadMessage }) {
{statusChange ? (
<div className="flex flex-wrap items-center gap-1.5 text-xs">
- <span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70">
+ <span className="text-(length:--text-nano) font-medium uppercase tracking-wider text-muted-foreground/70">
Status
</span>
<span className="text-muted-foreground">{humanizeValue(statusChange.from)}</span>
@@ -2808,7 +2817,7 @@ function IssueChatSystemMessage({ message }: { message: ThreadMessage }) {
{assigneeChange ? (
<div className="space-y-1">
<div className={cn("flex flex-wrap items-center gap-1.5 text-xs", isCurrentUser && "justify-end")}>
- <span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70">
+ <span className="text-(length:--text-nano) font-medium uppercase tracking-wider text-muted-foreground/70">
Assignee
</span>
<AssigneeChip assignee={assigneeChange.from} resolvers={handoffResolvers} />
@@ -2827,7 +2836,7 @@ function IssueChatSystemMessage({ message }: { message: ThreadMessage }) {
{workspaceChange ? (
<div className="flex flex-wrap items-center gap-1.5 text-xs">
- <span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70">
+ <span className="text-(length:--text-nano) font-medium uppercase tracking-wider text-muted-foreground/70">
Workspace
</span>
<span className="text-muted-foreground">
@@ -2859,7 +2868,7 @@ function IssueChatSystemMessage({ message }: { message: ThreadMessage }) {
<span className="text-muted-foreground">run</span>
<Link
to={`/agents/${runAgentId}/runs/${runId}`}
- className="inline-flex items-center rounded-md border border-border bg-accent/40 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground"
+ className="inline-flex items-center rounded-md border border-border bg-accent/40 px-1.5 py-0.5 font-mono text-(length:--text-nano) text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground"
>
{runId.slice(0, 8)}
</Link>
@@ -3858,9 +3867,9 @@ const IssueChatComposer = forwardRef<IssueChatComposerHandle, IssueChatComposerP
data-testid="issue-chat-composer"
data-pending-work-mode={pendingWorkMode}
className={cn(
- "relative rounded-md border border-border/70 bg-background/95 p-[15px] shadow-[0_-12px_28px_rgba(15,23,42,0.08)] backdrop-blur transition-[border-color,background-color,box-shadow] duration-150 supports-[backdrop-filter]:bg-background/85 dark:shadow-[0_-12px_28px_rgba(0,0,0,0.28)]",
+ "relative rounded-md border border-border/70 bg-background/95 p-(--sz-15px) shadow-(--shadow-extract-4) backdrop-blur transition-(--tp-border-color-background-color-box-shadow) duration-150 supports-[backdrop-filter]:bg-background/85 dark:shadow-(--shadow-extract-5)",
pendingWorkModeMeta.classes.container,
- isDragOver && "border-primary/45 bg-background shadow-[0_-12px_28px_rgba(15,23,42,0.08),0_0_0_1px_hsl(var(--primary)/0.16)]",
+ isDragOver && "border-primary/45 bg-background shadow-(--shadow-extract-7)",
)}
onKeyDownCapture={handleComposerKeyDown}
onDragEnterCapture={handleFileDragEnter}
@@ -3871,7 +3880,7 @@ const IssueChatComposer = forwardRef<IssueChatComposerHandle, IssueChatComposerP
{isDragOver && canAcceptFiles ? (
<div
data-testid="issue-chat-composer-drop-overlay"
- className="pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-sm border border-dashed border-primary/55 bg-background/75 px-4 py-3 text-center shadow-sm backdrop-blur-[2px] dark:bg-background/65"
+ className="pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-sm border border-dashed border-primary/55 bg-background/75 px-4 py-3 text-center shadow-sm backdrop-blur-(--blur-2px) dark:bg-background/65"
>
<div className="flex max-w-md items-center gap-3 rounded-md bg-background/80 px-3 py-2 text-left shadow-sm ring-1 ring-border/60">
<span className="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary">
@@ -3897,7 +3906,7 @@ const IssueChatComposer = forwardRef<IssueChatComposerHandle, IssueChatComposerP
imageUploadHandler={onImageUpload}
fileDropTarget="parent"
bordered={false}
- contentClassName="max-h-[28dvh] overflow-y-auto pr-1 pb-2 text-sm scrollbar-auto-hide"
+ contentClassName="max-h-(--sz-28dvh) overflow-y-auto pr-1 pb-2 text-sm scrollbar-auto-hide"
/>
{coachVisible && plainNameCandidate ? (
@@ -3912,7 +3921,7 @@ const IssueChatComposer = forwardRef<IssueChatComposerHandle, IssueChatComposerP
) : null}
{composerHint ? (
- <div className="inline-flex items-center rounded-full border border-border/70 bg-muted/30 px-2 py-1 text-[11px] text-muted-foreground">
+ <div className="inline-flex items-center rounded-full border border-border/70 bg-muted/30 px-2 py-1 text-(length:--text-micro) text-muted-foreground">
{composerHint}
</div>
) : null}
@@ -4004,7 +4013,7 @@ const IssueChatComposer = forwardRef<IssueChatComposerHandle, IssueChatComposerP
aria-keyshortcuts="Meta+Period Control+Period"
title={titleForPendingWorkMode(pendingWorkMode)}
className={cn(
- "inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11px] font-semibold transition-colors",
+ "inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-(length:--text-micro) font-semibold transition-colors",
pendingWorkModeMeta.classes.chip,
)}
>
@@ -4043,7 +4052,7 @@ const IssueChatComposer = forwardRef<IssueChatComposerHandle, IssueChatComposerP
</button>
);
})}
- <div className="mt-1 border-t px-2 py-1.5 text-[10px] text-muted-foreground">
+ <div className="mt-1 border-t px-2 py-1.5 text-(length:--text-nano) text-muted-foreground">
Cmd/Ctrl+. cycles modes
</div>
</PopoverContent>
@@ -4938,7 +4947,7 @@ export function IssueChatThread({
<div
ref={composerViewportAnchorRef}
data-testid="issue-chat-composer-dock"
- className="sticky bottom-[calc(env(safe-area-inset-bottom)+20px)] z-20 space-y-2 bg-gradient-to-t from-background via-background/95 to-background/0 pt-6"
+ className="sticky bottom-(--sz-calc-8) z-20 space-y-2 bg-gradient-to-t from-background via-background/95 to-background/0 pt-6"
>
<IssueChatComposer
ref={composerRef}
diff --git a/ui/src/components/IssueColumns.tsx b/ui/src/components/IssueColumns.tsx
index 2a921237e7..ab76ae10a9 100644
--- a/ui/src/components/IssueColumns.tsx
+++ b/ui/src/components/IssueColumns.tsx
@@ -93,10 +93,10 @@ export function IssueColumnPicker({
{!iconOnly && "Columns"}
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="w-[300px] rounded-xl border-border/70 p-1.5 shadow-xl shadow-black/10">
+ <DropdownMenuContent align="end" className="w-(--sz-300px) rounded-xl border-border/70 p-1.5 shadow-xl shadow-black/10">
<DropdownMenuLabel className="px-2 pb-1 pt-1.5">
<div className="space-y-1">
- <div className="text-[10px] font-semibold uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Desktop task rows
</div>
<div className="text-sm font-medium text-foreground">
@@ -190,7 +190,7 @@ export function InboxIssueMetaLeading({
</span>
<span
className={cn(
- "hidden text-[11px] font-medium sm:inline",
+ "hidden text-(length:--text-micro) font-medium sm:inline",
"text-blue-600 dark:text-blue-400",
)}
>
@@ -213,7 +213,7 @@ export function InboxIssueMetaLeading({
)}
aria-hidden="true"
/>
- <span className="hidden text-[11px] font-medium text-muted-foreground sm:inline">
+ <span className="hidden text-(length:--text-micro) font-medium text-muted-foreground sm:inline">
{subtreeLiveCount} live below
</span>
</span>
@@ -359,6 +359,7 @@ export function InboxIssueTrailingColumns({
if (column === "project") {
if (projectName) {
+ // token-extraction: allowlisted — accentColor also feeds pickTextColorForPillBg() contrast math; a var() string can't be parsed as a hex color there.
const accentColor = projectColor ?? "#64748b";
return (
<span
@@ -389,7 +390,7 @@ export function InboxIssueTrailingColumns({
{(issue.labels ?? []).slice(0, 2).map((label) => (
<span
key={label.id}
- className="inline-flex min-w-0 max-w-full shrink-0 items-center rounded-full border px-1.5 py-0 text-[10px] font-medium"
+ className="inline-flex min-w-0 max-w-full shrink-0 items-center rounded-full border px-1.5 py-0 text-(length:--text-nano) font-medium"
style={{
borderColor: label.color,
color: pickTextColorForPillBg(label.color, 0.12),
@@ -400,7 +401,7 @@ export function InboxIssueTrailingColumns({
</span>
))}
{(issue.labels ?? []).length > 2 ? (
- <span className="shrink-0 text-[10px] font-medium text-muted-foreground">
+ <span className="shrink-0 text-(length:--text-nano) font-medium text-muted-foreground">
+{(issue.labels ?? []).length - 2}
</span>
) : null}
@@ -462,7 +463,7 @@ export function InboxIssueTrailingColumns({
if (column === "updated") {
return (
- <span key={column} className="min-w-0 truncate text-right text-[11px] font-medium text-muted-foreground">
+ <span key={column} className="min-w-0 truncate text-right text-(length:--text-micro) font-medium text-muted-foreground">
{activityText}
</span>
);
diff --git a/ui/src/components/IssueContinuationHandoff.tsx b/ui/src/components/IssueContinuationHandoff.tsx
index 4d4c4b6cbc..431b0a0cb6 100644
--- a/ui/src/components/IssueContinuationHandoff.tsx
+++ b/ui/src/components/IssueContinuationHandoff.tsx
@@ -77,11 +77,11 @@ export function IssueContinuationHandoff({
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-2">
<span className="text-sm font-medium text-foreground">{title}</span>
- <span className="rounded-full border border-border px-2 py-0.5 font-mono text-[10px] uppercase text-muted-foreground">
+ <span className="rounded-full border border-border px-2 py-0.5 font-mono text-(length:--text-nano) uppercase text-muted-foreground">
handoff
</span>
</div>
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
Updated {relativeTime(document.updatedAt)}
{document.latestRevisionNumber > 0 ? ` - revision ${document.latestRevisionNumber}` : ""}
</div>
diff --git a/ui/src/components/IssueDocumentAnnotations.test.tsx b/ui/src/components/IssueDocumentAnnotations.test.tsx
index 2df463d0ae..b99165579c 100644
--- a/ui/src/components/IssueDocumentAnnotations.test.tsx
+++ b/ui/src/components/IssueDocumentAnnotations.test.tsx
@@ -306,7 +306,7 @@ describe("IssueDocumentAnnotations", () => {
const anchor = container.querySelector('[data-testid="document-annotation-panel-anchor"]');
expect(anchor).not.toBeNull();
expect(anchor?.className).toContain("fixed");
- expect(anchor?.className).toContain("z-[60]");
+ expect(anchor?.className).toContain("z-(--z-60)");
});
it("keeps the desktop annotation panel inside the issue content area when properties are visible", async () => {
@@ -982,7 +982,7 @@ describe("IssueDocumentAnnotations", () => {
expect(sheet).not.toBeNull();
expect(sheet?.getAttribute("data-side")).toBe("bottom");
expect(sheet?.className).toContain("paperclip-doc-annotation-sheet");
- expect(sheet?.className).toContain("z-[60]");
+ expect(sheet?.className).toContain("z-(--z-60)");
expect(sheet?.className).toContain("bg-popover");
} finally {
Object.defineProperty(window, "matchMedia", {
diff --git a/ui/src/components/IssueDocumentAnnotations.tsx b/ui/src/components/IssueDocumentAnnotations.tsx
index bb93c38e11..2e959c15bd 100644
--- a/ui/src/components/IssueDocumentAnnotations.tsx
+++ b/ui/src/components/IssueDocumentAnnotations.tsx
@@ -344,7 +344,7 @@ export function IssueDocumentAnnotations({
className="relative min-w-0"
data-testid={`document-annotation-body-${doc.key}`}
>
- <div className="relative z-[1]">
+ <div className="relative z-(--z-1)">
{children}
</div>
{!historicalPreview && doc.latestRevisionId ? (
@@ -368,7 +368,7 @@ export function IssueDocumentAnnotations({
{panelOpen && !isMobile && renderedDesktopPanelFrame ? (
<div
data-testid="document-annotation-panel-anchor"
- className="pointer-events-auto fixed z-[60] hidden lg:block"
+ className="pointer-events-auto fixed z-(--z-60) hidden lg:block"
style={{
left: renderedDesktopPanelFrame.left,
maxHeight: renderedDesktopPanelFrame.maxHeight,
@@ -425,7 +425,7 @@ export function DocumentAnnotationsCountChip({
variant="ghost"
data-state={panelOpen ? "open" : "closed"}
className={cn(
- "h-auto gap-1 rounded-md px-1.5 py-0 text-[11px] font-normal text-muted-foreground hover:text-foreground",
+ "h-auto gap-1 rounded-md px-1.5 py-0 text-(length:--text-micro) font-normal text-muted-foreground hover:text-foreground",
panelOpen && "bg-muted text-foreground",
openCount > 0 && "text-foreground",
)}
diff --git a/ui/src/components/IssueDocumentsSection.tsx b/ui/src/components/IssueDocumentsSection.tsx
index 22803fe4f0..42688138dc 100644
--- a/ui/src/components/IssueDocumentsSection.tsx
+++ b/ui/src/components/IssueDocumentsSection.tsx
@@ -762,7 +762,7 @@ export function IssueDocumentsSection({
const documentBodyShellClassName = "mt-3";
const documentBodyPaddingClassName = "";
- const documentBodyContentClassName = "paperclip-edit-in-place-content min-h-[220px] text-[15px] leading-7";
+ const documentBodyContentClassName = "paperclip-edit-in-place-content min-h-(--sz-220px) text-sm leading-7";
const toggleFoldedDocument = (key: string) => {
setFoldedDocumentKeys((current) =>
current.includes(key)
@@ -850,7 +850,7 @@ export function IssueDocumentsSection({
placeholder="Markdown body"
bordered={false}
className="bg-transparent"
- contentClassName="min-h-[220px] text-[15px] leading-7"
+ contentClassName="min-h-(--sz-220px) text-sm leading-7"
mentions={mentions}
imageUploadHandler={imageUploadHandler}
onSubmit={() => void commitDraft(draft, { clearAfterSave: false, trackAutosave: false })}
@@ -881,7 +881,7 @@ export function IssueDocumentsSection({
>
<div className="mb-2 flex items-center gap-2">
<FileText className="h-4 w-4 text-amber-600" />
- <span className="rounded-full border border-amber-500/30 px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em] text-amber-700 dark:text-amber-300">
+ <span className="rounded-full border border-amber-500/30 px-2 py-0.5 font-mono text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-amber-700 dark:text-amber-300">
PLAN
</span>
</div>
@@ -964,7 +964,7 @@ export function IssueDocumentsSection({
size="icon-xs"
className={cn(
"text-muted-foreground transition-colors",
- isLocked && "text-amber-300 hover:text-amber-200",
+ isLocked && "text-amber-700 hover:text-amber-800 dark:text-amber-300 dark:hover:text-amber-200",
)}
title={isLocked ? "Unlock document" : "Lock document"}
aria-label={isLocked ? `Unlock ${doc.key} document` : `Lock ${doc.key} document`}
@@ -974,7 +974,7 @@ export function IssueDocumentsSection({
{isLocked ? <Lock className="h-3.5 w-3.5" /> : <Unlock className="h-3.5 w-3.5" />}
</Button>
) : isLocked ? (
- <span title="Locked document" aria-label="Locked document" className="inline-flex h-6 w-6 items-center justify-center text-amber-300">
+ <span title="Locked document" aria-label="Locked document" className="inline-flex h-6 w-6 items-center justify-center text-amber-700 dark:text-amber-300">
<Lock className="h-3.5 w-3.5" />
</span>
) : null}
@@ -1063,7 +1063,7 @@ export function IssueDocumentsSection({
<div className="rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-3">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1">
- <p className="text-sm font-medium text-amber-200">
+ <p className="text-sm font-medium text-amber-800 dark:text-amber-200">
Viewing revision {selectedHistoricalRevision.revisionNumber}
</p>
<p className="text-xs text-muted-foreground">
@@ -1100,7 +1100,7 @@ export function IssueDocumentsSection({
<div className="rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-3">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1">
- <p className="text-sm font-medium text-amber-200">Out of date</p>
+ <p className="text-sm font-medium text-amber-800 dark:text-amber-200">Out of date</p>
<p className="text-xs text-muted-foreground">
This document changed while you were editing. Your local draft is preserved and autosave is paused.
</p>
@@ -1144,7 +1144,7 @@ export function IssueDocumentsSection({
</div>
{activeConflict.showRemote && (
<div className="mt-3 rounded-md border border-border/70 bg-background/60 p-3">
- <div className="mb-2 flex items-center gap-2 text-[11px] text-muted-foreground">
+ <div className="mb-2 flex items-center gap-2 text-(length:--text-micro) text-muted-foreground">
<span>Remote revision {activeConflict.serverDocument.latestRevisionNumber}</span>
<span>•</span>
<span>updated {relativeTime(activeConflict.serverDocument.updatedAt)}</span>
@@ -1152,7 +1152,7 @@ export function IssueDocumentsSection({
{!isPlanKey(doc.key) && activeConflict.serverDocument.title ? (
<p className="mb-2 text-sm font-medium">{activeConflict.serverDocument.title}</p>
) : null}
- {renderFoldableBody(activeConflict.serverDocument.body, "text-[14px] leading-7", externalReferences)}
+ {renderFoldableBody(activeConflict.serverDocument.body, "text-sm leading-7", externalReferences)}
</div>
)}
</div>
@@ -1218,11 +1218,11 @@ export function IssueDocumentsSection({
</div>
<div className="flex min-h-4 items-center justify-end px-1">
<span
- className={`text-[11px] transition-opacity duration-150 ${
+ className={`text-(length:--text-micro) transition-opacity duration-150 ${
isHistoricalPreview
- ? "text-amber-300"
+ ? "text-amber-700 dark:text-amber-300"
: activeConflict
- ? "text-amber-300"
+ ? "text-amber-700 dark:text-amber-300"
: autosaveState === "error"
? "text-destructive"
: "text-muted-foreground"
diff --git a/ui/src/components/IssueFiltersPopover.test.tsx b/ui/src/components/IssueFiltersPopover.test.tsx
index 74a40304e4..4fe6a11c12 100644
--- a/ui/src/components/IssueFiltersPopover.test.tsx
+++ b/ui/src/components/IssueFiltersPopover.test.tsx
@@ -73,7 +73,7 @@ describe("IssueFiltersPopover", () => {
const popoverContent = container.querySelector("[data-testid='popover-content']");
expect(popoverContent).not.toBeNull();
expect(popoverContent?.className).toContain("overflow-y-auto");
- expect(popoverContent?.className).toContain("max-h-[min(80vh,42rem)]");
+ expect(popoverContent?.className).toContain("max-h-(--sz-calc-9)");
const layoutGrid = Array.from(popoverContent?.querySelectorAll("div") ?? []).find((element) =>
element.className.includes("md:grid-cols-3"),
diff --git a/ui/src/components/IssueFiltersPopover.tsx b/ui/src/components/IssueFiltersPopover.tsx
index dbd1468cf2..d702bad7b5 100644
--- a/ui/src/components/IssueFiltersPopover.tsx
+++ b/ui/src/components/IssueFiltersPopover.tsx
@@ -117,8 +117,8 @@ export function IssueFiltersPopover({
<Button variant={buttonVariant} size={iconOnly ? "icon" : "sm"} className={`text-xs ${iconOnly ? "relative h-8 w-8 shrink-0" : ""} ${activeFilterCount > 0 ? "text-blue-600 dark:text-blue-400" : ""}`} title={iconOnly ? (activeFilterCount > 0 ? `Filters: ${activeFilterCount}` : "Filter") : undefined}>
<Filter className={iconOnly ? "h-3.5 w-3.5" : "h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1"} />
{!iconOnly && <span className="hidden sm:inline">{activeFilterCount > 0 ? `Filters: ${activeFilterCount}` : "Filter"}</span>}
- {!iconOnly && activeFilterCount > 0 ? <span className="ml-0.5 text-[10px] font-medium sm:hidden">{activeFilterCount}</span> : null}
- {iconOnly && activeFilterCount > 0 ? <span className="absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-[9px] font-bold text-white">{activeFilterCount}</span> : null}
+ {!iconOnly && activeFilterCount > 0 ? <span className="ml-0.5 text-(length:--text-nano) font-medium sm:hidden">{activeFilterCount}</span> : null}
+ {iconOnly && activeFilterCount > 0 ? <span className="absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-(length:--text-nano) font-bold text-white">{activeFilterCount}</span> : null}
{!iconOnly && activeFilterCount > 0 ? (
<X
className="ml-1 hidden h-3 w-3 sm:block"
@@ -132,7 +132,7 @@ export function IssueFiltersPopover({
</PopoverTrigger>
<PopoverContent
align="end"
- className="w-[min(780px,calc(100vw-2rem))] max-h-[min(80vh,42rem)] overflow-y-auto overscroll-contain p-0"
+ className="w-(--sz-calc-10) max-h-(--sz-calc-9) overflow-y-auto overscroll-contain p-0"
>
<div className="space-y-3 p-3">
<div className="flex items-center justify-between">
diff --git a/ui/src/components/IssuePlanDecompositionsSection.tsx b/ui/src/components/IssuePlanDecompositionsSection.tsx
index da18e2cb5e..cf7e3577cd 100644
--- a/ui/src/components/IssuePlanDecompositionsSection.tsx
+++ b/ui/src/components/IssuePlanDecompositionsSection.tsx
@@ -16,14 +16,14 @@ interface IssuePlanDecompositionsSectionProps {
function StatusBadge({ status }: { status: AcceptedPlanDecompositionSummary["status"] }) {
if (status === "completed") {
return (
- <span className="inline-flex items-center gap-1 rounded-sm border border-emerald-500/50 bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-900 dark:text-emerald-100">
+ <span className="inline-flex items-center gap-1 rounded-sm border border-emerald-500/50 bg-emerald-500/10 px-2 py-0.5 text-(length:--text-micro) font-medium text-emerald-900 dark:text-emerald-100">
<CheckCircle2 className="h-3 w-3" />
Completed
</span>
);
}
return (
- <span className="inline-flex items-center gap-1 rounded-sm border border-amber-500/50 bg-amber-500/10 px-2 py-0.5 text-[11px] font-medium text-amber-900 dark:text-amber-100">
+ <span className="inline-flex items-center gap-1 rounded-sm border border-amber-500/50 bg-amber-500/10 px-2 py-0.5 text-(length:--text-micro) font-medium text-amber-900 dark:text-amber-100">
<Loader2 className="h-3 w-3 animate-spin" />
In flight
</span>
@@ -47,7 +47,7 @@ export function IssuePlanDecompositionsSection({
<div className="space-y-3">
<div className="flex items-center justify-between gap-2">
<h3 className="text-sm font-medium text-muted-foreground">Plan decomposition</h3>
- <span className="text-[11px] text-muted-foreground/80">
+ <span className="text-(length:--text-micro) text-muted-foreground/80">
{items.length === 1 ? "1 accepted plan revision" : `${items.length} accepted plan revisions`}
</span>
</div>
@@ -99,7 +99,7 @@ export function IssuePlanDecompositionsSection({
</span>
{record.status === "completed" && requested > 0 ? (
<span
- className="inline-flex items-center gap-1 rounded-sm border border-sky-500/40 bg-sky-500/10 px-1.5 py-0.5 text-[10px] font-medium text-sky-900 dark:text-sky-100"
+ className="inline-flex items-center gap-1 rounded-sm border border-sky-500/40 bg-sky-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-sky-900 dark:text-sky-100"
title="Repeat attempts with this fingerprint reuse this record instead of creating new children"
>
<Repeat className="h-3 w-3" />
@@ -108,7 +108,7 @@ export function IssuePlanDecompositionsSection({
) : null}
</div>
- <div className="mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-muted-foreground">
+ <div className="mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-(length:--text-micro) text-muted-foreground">
{ownerName ? <span>Owner: {ownerName}</span> : null}
{startedAt ? (
<span title={formatDateTime(startedAt)}>Started {relativeTime(startedAt)}</span>
@@ -135,14 +135,14 @@ export function IssuePlanDecompositionsSection({
<Link
to={`/issues/${child.identifier ?? child.id}`}
className={cn(
- "inline-flex max-w-full items-center gap-1 rounded-sm border border-border bg-background px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent/40",
+ "inline-flex max-w-full items-center gap-1 rounded-sm border border-border bg-background px-2 py-0.5 text-(length:--text-micro) text-foreground transition-colors hover:bg-accent/40",
)}
title={child.title}
>
<span className="font-medium">
{child.identifier ?? child.id.slice(0, 8)}
</span>
- <span className="truncate max-w-[24ch] text-muted-foreground">
+ <span className="truncate max-w-(--sz-24ch) text-muted-foreground">
{child.title}
</span>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
diff --git a/ui/src/components/IssueRecoveryActionCard.tsx b/ui/src/components/IssueRecoveryActionCard.tsx
index 51ea6aabad..3181361d58 100644
--- a/ui/src/components/IssueRecoveryActionCard.tsx
+++ b/ui/src/components/IssueRecoveryActionCard.tsx
@@ -293,18 +293,18 @@ function BranchFacet({
const shortSha = formatShortSha(sha);
return (
<div className="min-w-0 rounded-md border border-border/70 bg-background/60 px-2.5 py-2">
- <div className="text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground">
+ <div className="text-(length:--text-nano) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">
{label}
</div>
<div className="mt-1 flex items-center gap-1.5">
<GitBranch className="h-3.5 w-3.5 shrink-0 text-muted-foreground" aria-hidden />
{branch ? (
- <code className="truncate font-mono text-[12px] text-foreground/90">{branch}</code>
+ <code className="truncate font-mono text-xs text-foreground/90">{branch}</code>
) : (
- <span className="text-[12px] italic text-muted-foreground">detached / unknown</span>
+ <span className="text-xs italic text-muted-foreground">detached / unknown</span>
)}
</div>
- <div className="mt-0.5 pl-5 font-mono text-[11px] text-muted-foreground">
+ <div className="mt-0.5 pl-5 font-mono text-(length:--text-micro) text-muted-foreground">
{shortSha ? `@ ${shortSha}` : "@ —"}
</div>
</div>
@@ -328,13 +328,13 @@ function DivergenceDiagnosis({
)}
>
<div className="flex flex-wrap items-center gap-2">
- <span className="text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground">
+ <span className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Divergence diagnosis
</span>
<span
data-testid="recovery-ancestry-verdict"
className={cn(
- "inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.08em]",
+ "inline-flex items-center rounded-full border px-2 py-0.5 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-label)",
badge.className,
)}
>
@@ -354,7 +354,7 @@ function DivergenceDiagnosis({
/>
</div>
{divergence.plainLanguageReason ? (
- <p className="text-[12px] leading-5 text-foreground/80">{divergence.plainLanguageReason}</p>
+ <p className="text-xs leading-5 text-foreground/80">{divergence.plainLanguageReason}</p>
) : null}
</div>
);
@@ -412,8 +412,8 @@ function MetadataRow({
children: React.ReactNode;
}) {
return (
- <div className="grid grid-cols-[7.5rem_1fr] gap-x-3 gap-y-0 px-3 py-1.5 text-xs sm:px-4">
- <dt className="truncate text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">
+ <div className="grid grid-cols-(--gtc-8) gap-x-3 gap-y-0 px-3 py-1.5 text-xs sm:px-4">
+ <dt className="truncate text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">
{label}
</dt>
<dd className="min-w-0 break-words text-foreground/90">{children}</dd>
@@ -465,11 +465,11 @@ function RunChip({
const short = shortenRunId(runId);
const inner = (
<>
- <code className="rounded bg-background/80 px-1.5 py-0.5 font-mono text-[11px] text-foreground/80">
+ <code className="rounded bg-background/80 px-1.5 py-0.5 font-mono text-(length:--text-micro) text-foreground/80">
run {short}
</code>
{status ? (
- <span className="font-sans text-[11px] text-muted-foreground">{status}</span>
+ <span className="font-sans text-(length:--text-micro) text-muted-foreground">{status}</span>
) : null}
</>
);
@@ -594,7 +594,7 @@ export function IssueRecoveryActionCard({
data-recovery-state={cardState}
data-recovery-kind={action.kind}
className={cn(
- "relative w-full overflow-hidden rounded-lg border text-sm shadow-[0_1px_0_rgba(15,23,42,0.02)]",
+ "relative w-full overflow-hidden rounded-lg border text-sm shadow-(--shadow-extract-8)",
tone.containerClass,
className,
)}
@@ -610,10 +610,10 @@ export function IssueRecoveryActionCard({
<ToneIcon className={cn("h-4 w-4", tone.iconClass)} />
</span>
<div className="min-w-0 flex-1">
- <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] font-semibold uppercase tracking-[0.14em]">
+ <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow)">
<span className={tone.labelClass}>{tone.label}</span>
<span className="text-muted-foreground/60" aria-hidden>·</span>
- <code className="rounded bg-background/70 px-1.5 py-0.5 font-mono text-[11px] tracking-normal text-muted-foreground">
+ <code className="rounded bg-background/70 px-1.5 py-0.5 font-mono text-(length:--text-micro) tracking-normal text-muted-foreground">
{KIND_LABEL[action.kind] ?? action.kind}
</code>
{updatedAtLabel ? (
@@ -625,7 +625,7 @@ export function IssueRecoveryActionCard({
</>
) : null}
</div>
- <p className="mt-1 text-[14px] leading-6">{headline}</p>
+ <p className="mt-1 text-sm leading-6">{headline}</p>
</div>
</header>
<dl className={cn("border-t bg-background/40 dark:bg-background/20", tone.divider)}>
@@ -663,7 +663,7 @@ export function IssueRecoveryActionCard({
) : null}
<MetadataRow label="Evidence">
{evidenceSummary ? (
- <span className="break-words font-mono text-[11px] text-foreground/80">{evidenceSummary}</span>
+ <span className="break-words font-mono text-(length:--text-micro) text-foreground/80">{evidenceSummary}</span>
) : (
<MissingValue />
)}
@@ -675,12 +675,12 @@ export function IssueRecoveryActionCard({
<span className="inline-flex flex-wrap items-center gap-1.5">
{wakeSummary ? <span>{wakeSummary}</span> : <MissingValue />}
{showAttempt ? (
- <span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5 text-[11px] text-muted-foreground">
+ <span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5 text-(length:--text-micro) text-muted-foreground">
attempt {action.attemptCount} of {action.maxAttempts}
</span>
) : null}
{showTimeoutInline ? (
- <span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5 text-[11px] text-muted-foreground">
+ <span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5 text-(length:--text-micro) text-muted-foreground">
Times out {formatTimeShort(action.timeoutAt) ?? "soon"}
</span>
) : null}
@@ -716,7 +716,7 @@ export function IssueRecoveryActionCard({
sideOffset={6}
className="w-72 p-1.5"
>
- <div className="px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground">
+ <div className="px-2 py-1 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Resolve recovery
</div>
<div className="flex flex-col">
@@ -732,7 +732,7 @@ export function IssueRecoveryActionCard({
)}
>
<span className="font-medium leading-5">{option.label}</span>
- <span className="text-[11px] leading-4 text-muted-foreground">{option.description}</span>
+ <span className="text-(length:--text-micro) leading-4 text-muted-foreground">{option.description}</span>
</button>
))}
</div>
@@ -759,15 +759,15 @@ export function IssueRecoveryActionCard({
</PopoverTrigger>
<PopoverContent align="start" sideOffset={6} className="w-80 space-y-3 p-3">
<div className="space-y-1">
- <div className="text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Re-issue on isolated workspace
</div>
- <p className="text-[12px] leading-5 text-muted-foreground">
+ <p className="text-xs leading-5 text-muted-foreground">
Creates a fresh copy of this task on an isolated git worktree based on the live
branch. Your current workspace and its commits are left untouched.
</p>
</div>
- <dl className="space-y-1 rounded-md border border-border/70 bg-muted/30 px-2.5 py-2 text-[11px]">
+ <dl className="space-y-1 rounded-md border border-border/70 bg-muted/30 px-2.5 py-2 text-(length:--text-micro)">
<div className="flex items-center justify-between gap-2">
<dt className="text-muted-foreground">Base ref</dt>
<dd className="min-w-0 truncate font-mono text-foreground/90">{reissueBaseRef}</dd>
@@ -807,11 +807,11 @@ export function IssueRecoveryActionCard({
) : null}
{showResolveActions ? (
cardState === "observe_only" ? (
- <span className="text-[11px] text-muted-foreground">
+ <span className="text-(length:--text-micro) text-muted-foreground">
Recovery is observing without interrupting the live run.
</span>
) : (
- <span className="text-[11px] text-muted-foreground">
+ <span className="text-(length:--text-micro) text-muted-foreground">
The card stays open until an explicit decision is recorded.
</span>
)
diff --git a/ui/src/components/IssueReferencePill.tsx b/ui/src/components/IssueReferencePill.tsx
index 90ddd25e13..1e23262212 100644
--- a/ui/src/components/IssueReferencePill.tsx
+++ b/ui/src/components/IssueReferencePill.tsx
@@ -20,7 +20,7 @@ export function IssueReferencePill({
const classNames = cn(
"paperclip-mention-chip paperclip-mention-chip--issue",
"inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-xs no-underline",
- issue.identifier && "hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
+ issue.identifier && "hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring",
strikethrough && "opacity-60 line-through decoration-muted-foreground",
className,
);
diff --git a/ui/src/components/IssueRelatedWorkPanel.tsx b/ui/src/components/IssueRelatedWorkPanel.tsx
index 9d5fad9df7..c194663aa3 100644
--- a/ui/src/components/IssueRelatedWorkPanel.tsx
+++ b/ui/src/components/IssueRelatedWorkPanel.tsx
@@ -72,7 +72,7 @@ function Section({
>
<span>{group.label}</span>
{group.count > 1 ? (
- <span className="tabular-nums text-[10px] font-medium opacity-80">×{group.count}</span>
+ <span className="tabular-nums text-(length:--text-nano) font-medium opacity-80">×{group.count}</span>
) : null}
</span>
))}
diff --git a/ui/src/components/IssueRow.tsx b/ui/src/components/IssueRow.tsx
index 394ccb0853..412bbb7ee7 100644
--- a/ui/src/components/IssueRow.tsx
+++ b/ui/src/components/IssueRow.tsx
@@ -101,7 +101,7 @@ export function IssueRow({
const parkedBlockerIndicator = hasAssignedBacklogBlocker(issue.blockedBy) ? (
<span
data-testid="issue-row-parked-blocker"
- className="ml-1.5 inline-flex shrink-0 items-center gap-0.5 rounded-full border border-amber-500/60 bg-amber-500/15 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300"
+ className="ml-1.5 inline-flex shrink-0 items-center gap-0.5 rounded-full border border-amber-500/60 bg-amber-500/15 px-2 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:text-amber-300"
title="Blocked by parked work — at least one assigned blocker is in backlog and will not wake its assignee."
>
<Flag className="h-2.5 w-2.5" aria-hidden />
@@ -122,7 +122,7 @@ export function IssueRow({
className={cn(
"group flex items-start gap-2 border-b border-border py-2.5 pl-2 pr-3 text-sm no-underline text-inherit transition-colors last:border-b-0 sm:items-center sm:py-2 sm:pl-1",
selected ? "hover:bg-transparent" : "hover:bg-accent/50",
- checklistCurrentStep ? "border-l-2 border-l-primary bg-primary/5 pl-[calc(theme(spacing.2)-2px)] sm:pl-[calc(theme(spacing.1)-2px)]" : null,
+ checklistCurrentStep ? "border-l-2 border-l-primary bg-primary/5 pl-(--sz-calc-11) sm:pl-(--sz-calc-12)" : null,
className,
)}
>
@@ -137,7 +137,7 @@ export function IssueRow({
{issue.title}{titleSuffix}
</span>
{checklistDependencyChips ? (
- <span className="flex flex-wrap gap-1 sm:order-3 sm:ml-[calc(theme(spacing.3)+theme(spacing.2))]">
+ <span className="flex flex-wrap gap-1 sm:order-3 sm:ml-(--sz-calc-13)">
{checklistDependencyChips}
</span>
) : null}
@@ -256,7 +256,7 @@ function renderRecoveryChip(action: IssueRecoveryAction, selected: boolean): Rea
role="status"
aria-label={label}
className={cn(
- "ml-1.5 inline-flex shrink-0 items-center gap-0.5 rounded-full border px-2 py-0.5 text-[10px] font-medium",
+ "ml-1.5 inline-flex shrink-0 items-center gap-0.5 rounded-full border px-2 py-0.5 text-(length:--text-nano) font-medium",
tone.className,
selected ? "!border-muted-foreground !text-muted-foreground" : null,
)}
diff --git a/ui/src/components/IssueRunLedger.tsx b/ui/src/components/IssueRunLedger.tsx
index 3b0b44d704..40e51043e5 100644
--- a/ui/src/components/IssueRunLedger.tsx
+++ b/ui/src/components/IssueRunLedger.tsx
@@ -121,7 +121,7 @@ const PENDING_LIVENESS_COPY: LivenessCopy = {
const RETRY_PENDING_LIVENESS_COPY: LivenessCopy = {
label: "Retry pending",
- tone: "border-cyan-500/30 bg-cyan-500/10 text-cyan-700 dark:text-cyan-300",
+ tone: "border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",
description: "Paperclip queued an automatic retry that has not started yet.",
};
@@ -580,7 +580,7 @@ export function IssueRunLedgerContent({
<Link
key={child.id}
to={`/issues/${child.identifier ?? child.id}`}
- className="inline-flex min-w-0 max-w-full items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-[11px] hover:bg-accent/40"
+ className="inline-flex min-w-0 max-w-full items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-(length:--text-micro) hover:bg-accent/40"
>
<span className="shrink-0 font-mono text-muted-foreground">{child.identifier ?? child.id.slice(0, 8)}</span>
<span className="truncate">{child.title}</span>
@@ -588,7 +588,7 @@ export function IssueRunLedgerContent({
</Link>
))}
{children.active.length > 4 ? (
- <span className="rounded-md border border-border px-2 py-1 text-[11px] text-muted-foreground">
+ <span className="rounded-md border border-border px-2 py-1 text-(length:--text-micro) text-muted-foreground">
+{children.active.length - 4} more
</span>
) : null}
@@ -632,7 +632,7 @@ export function IssueRunLedgerContent({
<div className="mt-2 flex flex-wrap gap-1.5">
<button
type="button"
- className="rounded-md border border-border bg-background/80 px-2 py-1 text-[11px] text-foreground hover:bg-background"
+ className="rounded-md border border-border bg-background/80 px-2 py-1 text-(length:--text-micro) text-foreground hover:bg-background"
onClick={() =>
onWatchdogDecision({
runId: latestSilentRun.runId,
@@ -645,7 +645,7 @@ export function IssueRunLedgerContent({
</button>
<button
type="button"
- className="rounded-md border border-border bg-background/80 px-2 py-1 text-[11px] text-foreground hover:bg-background"
+ className="rounded-md border border-border bg-background/80 px-2 py-1 text-(length:--text-micro) text-foreground hover:bg-background"
onClick={() =>
onWatchdogDecision({
runId: latestSilentRun.runId,
@@ -660,7 +660,7 @@ export function IssueRunLedgerContent({
</button>
<button
type="button"
- className="rounded-md border border-border bg-background/80 px-2 py-1 text-[11px] text-foreground hover:bg-background"
+ className="rounded-md border border-border bg-background/80 px-2 py-1 text-(length:--text-micro) text-foreground hover:bg-background"
onClick={() =>
onWatchdogDecision({
runId: latestSilentRun.runId,
@@ -675,7 +675,7 @@ export function IssueRunLedgerContent({
</div>
) : null}
{watchdogDecisionError ? (
- <p className="mt-2 rounded-md border border-red-500/30 bg-red-500/10 px-2 py-1 text-[11px] text-red-900 dark:text-red-200">
+ <p className="mt-2 rounded-md border border-red-500/30 bg-red-500/10 px-2 py-1 text-(length:--text-micro) text-red-900 dark:text-red-200">
{watchdogDecisionError}
</p>
) : null}
@@ -730,18 +730,18 @@ export function IssueRunLedgerContent({
on behalf of <span className="text-foreground">{onBehalfOfLabel}</span>
</span>
) : null}
- <span className="rounded-md border border-border px-1.5 py-0.5 text-[11px] capitalize text-muted-foreground">
+ <span className="rounded-md border border-border px-1.5 py-0.5 text-(length:--text-micro) capitalize text-muted-foreground">
{statusLabel(run.status)}
</span>
{run.isLive ? (
- <span className="inline-flex items-center gap-1 rounded-md border border-cyan-500/30 bg-cyan-500/10 px-1.5 py-0.5 text-[11px] text-cyan-700 dark:text-cyan-300">
- <span className="h-1.5 w-1.5 rounded-full bg-cyan-400" />
+ <span className="inline-flex items-center gap-1 rounded-md border border-blue-500/30 bg-blue-500/10 px-1.5 py-0.5 text-(length:--text-micro) text-blue-700 dark:text-blue-300">
+ <span className="h-1.5 w-1.5 rounded-full bg-blue-500" />
live
</span>
) : null}
<span
className={cn(
- "rounded-md border px-1.5 py-0.5 text-[11px] font-medium",
+ "rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
liveness.tone,
)}
title={liveness.description}
@@ -749,17 +749,17 @@ export function IssueRunLedgerContent({
{liveness.label}
</span>
{exhausted ? (
- <span className="rounded-md border border-red-500/30 bg-red-500/10 px-1.5 py-0.5 text-[11px] font-medium text-red-700 dark:text-red-300">
+ <span className="rounded-md border border-red-500/30 bg-red-500/10 px-1.5 py-0.5 text-(length:--text-micro) font-medium text-red-700 dark:text-red-300">
Exhausted
</span>
) : null}
{continuation ? (
- <span className="text-[11px] text-muted-foreground">{continuation}</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">{continuation}</span>
) : null}
{retryState ? (
<span
className={cn(
- "rounded-md border px-1.5 py-0.5 text-[11px] font-medium",
+ "rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
retryState.tone,
)}
>
@@ -769,7 +769,7 @@ export function IssueRunLedgerContent({
{run.outputSilence && RUN_OUTPUT_SILENCE_COPY[run.outputSilence.level] ? (
<span
className={cn(
- "rounded-md border px-1.5 py-0.5 text-[11px] font-medium",
+ "rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
RUN_OUTPUT_SILENCE_COPY[run.outputSilence.level]?.tone,
)}
>
@@ -787,7 +787,7 @@ export function IssueRunLedgerContent({
return (
<span
className={cn(
- "rounded-md border px-1.5 py-0.5 text-[11px] font-medium",
+ "rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
modelProfileBadgeTone(profile),
)}
title={modelProfileTitle(profile)}
@@ -837,7 +837,7 @@ export function IssueRunLedgerContent({
const profile = modelProfileForRun(run);
if (!profile?.fallbackReason || profile.applied === profile.requested) return null;
return (
- <p className="min-w-0 break-words text-[11px] leading-5 text-amber-700 dark:text-amber-300">
+ <p className="min-w-0 break-words text-(length:--text-micro) leading-5 text-amber-700 dark:text-amber-300">
{profile.requested === "cheap"
? "Cheap profile fell back to primary"
: `${profile.requested} profile unavailable`}
diff --git a/ui/src/components/IssueScheduledRetryCard.tsx b/ui/src/components/IssueScheduledRetryCard.tsx
index bd6eef0c3e..aeeb1802c9 100644
--- a/ui/src/components/IssueScheduledRetryCard.tsx
+++ b/ui/src/components/IssueScheduledRetryCard.tsx
@@ -69,12 +69,12 @@ export function IssueScheduledRetryCard({
return (
<div
data-testid="issue-scheduled-retry-card"
- className="mb-3 rounded-lg border border-cyan-500/30 bg-cyan-500/5 px-3 py-3"
+ className="mb-3 rounded-lg border border-blue-500/30 bg-blue-500/5 px-3 py-3"
>
<div className="flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between">
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-2 text-xs">
- <span className="inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/10 px-2 py-0.5 font-medium text-cyan-700 dark:text-cyan-300">
+ <span className="inline-flex items-center gap-1 rounded-full border border-blue-500/30 bg-blue-500/10 px-2 py-0.5 font-medium text-blue-700 dark:text-blue-300">
<Clock className="h-3 w-3" aria-hidden="true" />
{badgeLabel}
</span>
@@ -145,7 +145,7 @@ export function IssueScheduledRetryCard({
</span>
)}
</Button>
- <span className="text-right text-xs text-muted-foreground sm:max-w-[12rem]">
+ <span className="text-right text-xs text-muted-foreground sm:max-w-(--sz-12rem)">
{retryNow.isPending
? "Promoting scheduled retry"
: isSuccessTransient
diff --git a/ui/src/components/IssueSiblingNavigation.test.tsx b/ui/src/components/IssueSiblingNavigation.test.tsx
index abcbdab325..972469d8eb 100644
--- a/ui/src/components/IssueSiblingNavigation.test.tsx
+++ b/ui/src/components/IssueSiblingNavigation.test.tsx
@@ -105,7 +105,7 @@ describe("IssueSiblingNavigation", () => {
expect(links[0].className).toContain("rounded-lg");
expect(links[0].className).toContain("hover:bg-accent/50");
- expect(links[0].className).toContain("focus-visible:ring-[3px]");
+ expect(links[0].className).toContain("focus-visible:ring-(length:--rad-3)");
expect(node.querySelector(".truncate")?.textContent).toBe("Previous sibling title");
});
diff --git a/ui/src/components/IssueSiblingNavigation.tsx b/ui/src/components/IssueSiblingNavigation.tsx
index f5d2e7e480..7585e94771 100644
--- a/ui/src/components/IssueSiblingNavigation.tsx
+++ b/ui/src/components/IssueSiblingNavigation.tsx
@@ -60,7 +60,7 @@ function SiblingLink({
issueQuicklookAlign={direction === "previous" ? "start" : "end"}
aria-label={`${ariaDirection}: ${identifier} - ${issue.title}`}
className={cn(
- "group min-w-0 rounded-lg border border-border bg-card px-3 py-2.5 text-left no-underline transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
+ "group min-w-0 rounded-lg border border-border bg-card px-3 py-2.5 text-left no-underline transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring",
direction === "next" && "sm:text-right",
className,
)}
diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsx
index 6536768ad3..bd37062467 100644
--- a/ui/src/components/IssueThreadInteractionCard.tsx
+++ b/ui/src/components/IssueThreadInteractionCard.tsx
@@ -218,7 +218,7 @@ function TaskField({
return (
<span
className={cn(
- "inline-flex items-center rounded-sm border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em]",
+ "inline-flex items-center rounded-sm border px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow)",
tone === "default"
? "border-border/70 bg-transparent text-foreground"
: "border-border/60 bg-transparent text-muted-foreground",
@@ -316,7 +316,7 @@ function TaskTreeNode({
</div>
</div>
{depth > 0 ? (
- <div className="mt-0.5 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <div className="mt-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Child task
</div>
) : null}
@@ -332,13 +332,13 @@ function TaskTreeNode({
{createdTask?.issueId ? (
<Link
to={`/issues/${createdTask.identifier ?? createdTask.issueId}`}
- className="inline-flex shrink-0 items-center gap-1 rounded-sm border border-emerald-500/50 bg-emerald-500/10 px-2.5 py-1 text-[11px] font-medium text-emerald-900 transition-colors hover:bg-emerald-500/15 dark:text-emerald-100"
+ className="inline-flex shrink-0 items-center gap-1 rounded-sm border border-emerald-500/50 bg-emerald-500/10 px-2.5 py-1 text-(length:--text-micro) font-medium text-emerald-900 transition-colors hover:bg-emerald-500/15 dark:text-emerald-100"
>
{createdTask.identifier ?? createdTask.issueId.slice(0, 8)}
<ChevronRight className="h-3 w-3" />
</Link>
) : isSkipped ? (
- <span className="inline-flex shrink-0 items-center rounded-sm border border-amber-500/60 bg-amber-500/10 px-2.5 py-1 text-[11px] font-medium text-amber-900 dark:text-amber-100">
+ <span className="inline-flex shrink-0 items-center rounded-sm border border-amber-500/60 bg-amber-500/10 px-2.5 py-1 text-(length:--text-micro) font-medium text-amber-900 dark:text-amber-100">
Skipped
</span>
) : null}
@@ -540,7 +540,7 @@ function SuggestTasksCard({
{interaction.status === "accepted" ? (
<div className="rounded-sm border border-emerald-500/60 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-900 dark:text-emerald-100">
- <div className="text-[11px] font-semibold uppercase tracking-[0.16em] text-emerald-700">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-emerald-700">
Resolution summary
</div>
<p className="mt-1 leading-6">
@@ -553,7 +553,7 @@ function SuggestTasksCard({
{interaction.status === "rejected" ? (
<div className="rounded-sm border border-rose-500/60 bg-rose-500/10 px-4 py-3 text-sm text-rose-900 dark:text-rose-100">
- <div className="text-[11px] font-semibold uppercase tracking-[0.16em] text-rose-700">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-rose-700">
Rejection reason
</div>
<p className={cn(
@@ -671,7 +671,7 @@ function QuestionOptionButton({
role={selectionMode === "single" ? "radio" : "checkbox"}
aria-checked={selected}
className={cn(
- "w-full rounded-sm border px-4 py-3 text-left transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
+ "w-full rounded-sm border px-4 py-3 text-left transition-colors outline-none focus-visible:border-ring focus-visible:ring-(length:--rad-3) focus-visible:ring-ring/50",
selected
? "border-sky-500/80 bg-sky-500/10 text-sky-950 dark:border-sky-400/80 dark:bg-sky-400/15 dark:text-sky-50"
: "border-border/70 bg-transparent text-foreground hover:border-sky-500/70 hover:bg-sky-500/10 dark:hover:border-sky-400/70 dark:hover:bg-sky-400/10",
@@ -842,7 +842,7 @@ function AskUserQuestionsCard({
return (
<div className="space-y-4">
<div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
- <span className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 font-medium uppercase tracking-[0.16em] text-foreground/70">
+ <span className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 font-medium uppercase tracking-(--tracking-eyebrow) text-foreground/70">
<MessageSquareQuote className="h-3 w-3" />
Ask user questions
</span>
@@ -858,11 +858,11 @@ function AskUserQuestionsCard({
{questions.map((question, index) => (
<div
key={question.id}
- className="rounded-2xl border border-border/70 bg-background/82 p-4 shadow-[0_18px_42px_rgba(15,23,42,0.06)]"
+ className="rounded-2xl border border-border/70 bg-background/82 p-4 shadow-(--shadow-extract-9)"
>
<div className="flex items-start justify-between gap-3">
<div>
- <div className="text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Question {index + 1}
</div>
<div
@@ -908,7 +908,7 @@ function AskUserQuestionsCard({
id={`${interaction.id}-${question.id}-other`}
aria-expanded={otherActiveQuestions[question.id] === true}
className={cn(
- "text-sm font-medium underline underline-offset-4 transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",
+ "text-sm font-medium underline underline-offset-4 transition-colors outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring/50",
otherActiveQuestions[question.id]
? "text-sky-700 hover:text-sky-800 dark:text-sky-300 dark:hover:text-sky-200"
: "text-muted-foreground hover:text-foreground",
@@ -1031,7 +1031,7 @@ function AskUserQuestionsCard({
{interaction.result?.summaryMarkdown ? (
<div className="rounded-2xl border border-emerald-300/60 bg-emerald-50/85 p-4">
- <div className="mb-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-emerald-700">
+ <div className="mb-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-emerald-700">
Submitted summary
</div>
<MarkdownBody externalReferences={externalReferences}>{interaction.result.summaryMarkdown}</MarkdownBody>
@@ -1080,7 +1080,7 @@ function RequestConfirmationTargetChip({
const href = requestConfirmationTargetHref({ interaction, target });
const className = cn(
- "inline-flex max-w-full items-center gap-1.5 rounded-sm border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em]",
+ "inline-flex max-w-full items-center gap-1.5 rounded-sm border px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow)",
tone === "default"
? "border-border/70 bg-transparent text-foreground"
: "border-border/60 bg-transparent text-muted-foreground",
@@ -1147,7 +1147,7 @@ function RequestConfirmationResolution({
const expiredByTargetChange = outcome === "stale_target";
return (
<div className="space-y-3 rounded-sm border border-amber-500/60 bg-amber-500/10 px-4 py-3 text-sm text-amber-900 dark:text-amber-100">
- <div className="text-[11px] font-semibold uppercase tracking-[0.16em] text-amber-700">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-amber-700">
{expiredByComment ? "Expired by comment" : "Expired by target change"}
</div>
<p className="leading-6">
@@ -1497,7 +1497,7 @@ function RequestCheckboxConfirmationResolution({
const hiddenCount = selectedLabels.length - CHECKBOX_SUMMARY_LABEL_LIMIT;
const hasHiddenLabels = hiddenCount > 0;
const chipClassName =
- "inline-flex items-center rounded-sm border border-border/60 bg-transparent px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-muted-foreground";
+ "inline-flex items-center rounded-sm border border-border/60 bg-transparent px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground";
return (
<div className="space-y-3">
@@ -1935,7 +1935,7 @@ export function IssueThreadInteractionCard({
<div className="flex flex-wrap items-start justify-between gap-4">
<div className="min-w-0 flex-1 basis-64">
<div className="flex flex-wrap items-center gap-2">
- <span className={cn("inline-flex items-center gap-1 rounded-sm border px-2.5 py-1 text-[11px] font-semibold uppercase tracking-[0.16em]", styles.badge)}>
+ <span className={cn("inline-flex items-center gap-1 rounded-sm border px-2.5 py-1 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow)", styles.badge)}>
<StatusIcon className="h-3.5 w-3.5" />
{isPlan ? "Plan" : interactionKindLabel(interaction.kind)}
<span className="text-current/60">/</span>
diff --git a/ui/src/components/IssueWorkspaceCard.tsx b/ui/src/components/IssueWorkspaceCard.tsx
index 49ea928b7d..a4a096c4f5 100644
--- a/ui/src/components/IssueWorkspaceCard.tsx
+++ b/ui/src/components/IssueWorkspaceCard.tsx
@@ -144,7 +144,7 @@ function statusBadge(status: string) {
archived: "bg-muted text-muted-foreground",
};
return (
- <span className={cn("text-[10px] px-1.5 py-0.5 rounded-full font-medium", colors[status] ?? colors.idle)}>
+ <span className={cn("text-(length:--text-nano) px-1.5 py-0.5 rounded-full font-medium", colors[status] ?? colors.idle)}>
{status.replace(/_/g, " ")}
</span>
);
@@ -405,7 +405,7 @@ export function IssueWorkspaceCard({
)}
{workspace?.repoUrl && (
<div className="flex items-center gap-1.5 text-muted-foreground">
- <span className="text-[11px]">Repo:</span>
+ <span className="text-(length:--text-micro)">Repo:</span>
<CopyableInline value={workspace.repoUrl} mono />
</div>
)}
@@ -447,7 +447,7 @@ export function IssueWorkspaceCard({
<div className="pt-0.5">
<Link
to={currentWorkspaceLink}
- className="text-[11px] text-muted-foreground hover:text-foreground hover:underline"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground hover:underline"
>
View workspace details →
</Link>
@@ -493,7 +493,7 @@ export function IssueWorkspaceCard({
{/* Current workspace summary when editing */}
{workspace && (
- <div className="text-[11px] text-muted-foreground space-y-0.5 pt-1 border-t border-border/50">
+ <div className="text-(length:--text-micro) text-muted-foreground space-y-0.5 pt-1 border-t border-border/50">
<div style={{ overflowWrap: "anywhere" }}>
Current:{" "}
{currentWorkspaceLink ? (
diff --git a/ui/src/components/IssuesList.tsx b/ui/src/components/IssuesList.tsx
index 4c10714e93..2758ed98da 100644
--- a/ui/src/components/IssuesList.tsx
+++ b/ui/src/components/IssuesList.tsx
@@ -1763,7 +1763,7 @@ export function IssuesList({
target.scrollIntoView({ behavior: "smooth", block: "nearest" });
target.focus?.();
}}
- className="inline-flex items-center rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 hover:bg-amber-100/80 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300"
+ className="inline-flex items-center rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-amber-700 hover:bg-amber-100/80 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300"
title={firstVisibleBlockerTitle}
aria-label={firstVisibleBlockerTitle}
>
@@ -1803,7 +1803,7 @@ export function IssuesList({
{issueBadge ? (
issueBadge === "Paused" ? (
<span
- className={cn("ml-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium", statusBadge.paused)}
+ className={cn("ml-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium", statusBadge.paused)}
aria-label="Paused"
title="Paused"
>
@@ -1811,14 +1811,14 @@ export function IssuesList({
Paused
</span>
) : (
- <span className="ml-1.5 inline-flex items-center rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300">
+ <span className="ml-1.5 inline-flex items-center rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:text-amber-300">
{issueBadge}
</span>
)
) : null}
{isSuccessfulRunHandoffRequired(issue) ? (
<span
- className="ml-1.5 inline-flex items-center gap-1 rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300"
+ className="ml-1.5 inline-flex items-center gap-1 rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300"
aria-label="Needs next step"
title="This task needs a next step"
>
diff --git a/ui/src/components/JsonSchemaForm.tsx b/ui/src/components/JsonSchemaForm.tsx
index c6aa30b061..eaa9540539 100644
--- a/ui/src/components/JsonSchemaForm.tsx
+++ b/ui/src/components/JsonSchemaForm.tsx
@@ -363,12 +363,12 @@ const FieldWrapper = React.memo(({
</div>
{children}
{description && (
- <p className="text-[12px] text-muted-foreground leading-relaxed">
+ <p className="text-xs text-muted-foreground leading-relaxed">
{description}
</p>
)}
{error && (
- <p className="text-[12px] font-medium text-destructive">{error}</p>
+ <p className="text-xs font-medium text-destructive">{error}</p>
)}
</div>
);
@@ -597,7 +597,7 @@ const SecretField = React.memo(({
onChange={(e) => onChange(e.target.value)}
placeholder={String(defaultValue ?? "")}
disabled={disabled}
- className="min-h-[140px] pr-10 font-mono text-xs"
+ className="min-h-(--sz-140px) pr-10 font-mono text-xs"
aria-invalid={!!error}
/>
) : (
@@ -614,7 +614,7 @@ const SecretField = React.memo(({
readOnly
placeholder={String(defaultValue ?? "")}
disabled={disabled}
- className="min-h-[140px] pr-10 font-mono text-xs italic text-muted-foreground"
+ className="min-h-(--sz-140px) pr-10 font-mono text-xs italic text-muted-foreground"
aria-invalid={!!error}
/>
)}
@@ -695,7 +695,7 @@ const SecretField = React.memo(({
{!hasRawValue ? (
<button
type="button"
- className="text-[11px] text-muted-foreground hover:text-foreground"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground"
onClick={() => {
setShowRawInput(false);
setIsVisible(false);
@@ -709,7 +709,7 @@ const SecretField = React.memo(({
) : (
<button
type="button"
- className="text-[11px] text-muted-foreground hover:text-foreground"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground"
onClick={() => setShowRawInput(true)}
disabled={disabled}
>
@@ -837,7 +837,7 @@ const StringField = React.memo(({
onChange={(e) => onChange(e.target.value)}
placeholder={String(defaultValue ?? "")}
disabled={disabled}
- className="min-h-[100px]"
+ className="min-h-(--sz-100px)"
aria-invalid={!!error}
/>
) : (
diff --git a/ui/src/components/KanbanBoard.tsx b/ui/src/components/KanbanBoard.tsx
index fc1e67acc4..88eeb6248e 100644
--- a/ui/src/components/KanbanBoard.tsx
+++ b/ui/src/components/KanbanBoard.tsx
@@ -153,17 +153,17 @@ function KanbanColumn({
<div
ref={setNodeRef}
className={cn(
- "flex min-h-[220px] w-[52px] shrink-0 flex-col items-center rounded-md border px-1.5 py-2 transition-colors",
+ "flex min-h-(--sz-220px) w-(--sz-52px) shrink-0 flex-col items-center rounded-md border px-1.5 py-2 transition-colors",
tone.rail,
isOver && tone.railOver,
)}
title={`${statusLabel(status)}: ${issues.length}`}
>
<StatusIcon status={status} />
- <span className={cn("mt-2 [writing-mode:vertical-rl] rotate-180 text-[10px] font-semibold uppercase tracking-wide", tone.header)}>
+ <span className={cn("mt-2 [writing-mode:vertical-rl] rotate-180 text-(length:--text-nano) font-semibold uppercase tracking-wide", tone.header)}>
{statusLabel(status)}
</span>
- <span className={cn("mt-auto rounded-full bg-background px-1.5 py-0.5 text-[10px] font-medium tabular-nums", tone.header)}>
+ <span className={cn("mt-auto rounded-full bg-background px-1.5 py-0.5 text-(length:--text-nano) font-medium tabular-nums", tone.header)}>
{issues.length}
</span>
</div>
@@ -171,7 +171,7 @@ function KanbanColumn({
}
return (
- <div className={`flex flex-col shrink-0 transition-[width,min-width] ${isEmpty && !isOver ? "min-w-[48px] w-[48px]" : "min-w-[260px] w-[260px]"}`}>
+ <div className={`flex flex-col shrink-0 transition-(--tp-width-min-width) ${isEmpty && !isOver ? "min-w-(--sz-48px) w-(--sz-48px)" : "min-w-(--sz-260px) w-(--sz-260px)"}`}>
<div className={`flex items-center gap-2 px-2 py-2 mb-1 ${isEmpty && !isOver ? "justify-center" : ""}`}>
<StatusIcon status={status} />
{(!isEmpty || isOver) && (
@@ -188,7 +188,7 @@ function KanbanColumn({
<div
ref={setNodeRef}
className={cn(
- "flex-1 min-h-[120px] rounded-md p-1 space-y-1 transition-colors",
+ "flex-1 min-h-(--sz-120px) rounded-md p-1 space-y-1 transition-colors",
isOver ? tone.bodyOver : tone.body,
)}
>
@@ -219,7 +219,7 @@ function KanbanColumn({
</button>
) : null}
{issues.length > 0 && (hiddenCount > 0 || issues.length >= visibleCount) ? (
- <p className="px-1 pt-1 text-[11px] text-muted-foreground">
+ <p className="px-1 pt-1 text-(length:--text-micro) text-muted-foreground">
Showing {visibleIssues.length} of {issues.length}
</p>
) : null}
@@ -295,7 +295,7 @@ function KanbanCard({
</span>
{isSuccessfulRunHandoffRequired(issue) ? (
<span
- className="inline-flex items-center gap-1 rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300"
+ className="inline-flex items-center gap-1 rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300"
title="This task needs a next step"
aria-label="Needs next step"
>
@@ -304,7 +304,7 @@ function KanbanCard({
</span>
) : null}
{isLive && (
- <span className="inline-flex shrink-0 items-center gap-1 text-[10px] font-medium text-blue-600 dark:text-blue-400">
+ <span className="inline-flex shrink-0 items-center gap-1 text-(length:--text-nano) font-medium text-blue-600 dark:text-blue-400">
<span className="relative flex h-2 w-2">
<span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500" />
@@ -314,7 +314,7 @@ function KanbanCard({
)}
{!isLive && subtreeLiveCount > 0 && (
<span
- className="inline-flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"
+ className="inline-flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-0.5 text-(length:--text-nano) font-medium text-muted-foreground"
title={`${subtreeLiveCount} sub-task${subtreeLiveCount === 1 ? "" : "s"} running below`}
>
<span className="h-2 w-2 shrink-0 rounded-full border border-muted-foreground/60" aria-hidden="true" />
diff --git a/ui/src/components/KeyboardShortcutsCheatsheet.tsx b/ui/src/components/KeyboardShortcutsCheatsheet.tsx
index c6847e0e6a..ea86e52d23 100644
--- a/ui/src/components/KeyboardShortcutsCheatsheet.tsx
+++ b/ui/src/components/KeyboardShortcutsCheatsheet.tsx
@@ -64,7 +64,7 @@ const sections: ShortcutSection[] = [
function KeyCap({ children }: { children: string }) {
return (
- <kbd className="inline-flex h-6 min-w-6 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-xs font-medium text-foreground shadow-[0_1px_0_1px_hsl(var(--border))]">
+ <kbd className="inline-flex h-6 min-w-6 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-xs font-medium text-foreground shadow-(--shadow-extract-10)">
{children}
</kbd>
);
@@ -76,7 +76,7 @@ export function KeyboardShortcutsCheatsheetContent() {
<div className="divide-y divide-border border-t border-border">
{sections.map((section) => (
<div key={section.title} className="px-5 py-3">
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground">
+ <h3 className="mb-2 text-(length:--text-micro) font-semibold uppercase tracking-wider text-muted-foreground">
{section.title}
</h3>
<div className="space-y-1.5">
diff --git a/ui/src/components/Layout.tsx b/ui/src/components/Layout.tsx
index 8619a3247a..080f362283 100644
--- a/ui/src/components/Layout.tsx
+++ b/ui/src/components/Layout.tsx
@@ -498,7 +498,7 @@ export function Layout() {
<GeneralSettingsProvider value={{ keyboardShortcutsEnabled }}>
<div
className={cn(
- "bg-background text-foreground pt-[env(safe-area-inset-top)]",
+ "bg-background text-foreground pt-(--sz-safe-top)",
// overflow-x-clip on mobile keeps a stray wide descendant from making the
// whole viewport scroll horizontally. clip (not hidden) leaves overflow-y
// computed as visible, so native body scroll + the sticky breadcrumb keep
@@ -508,7 +508,7 @@ export function Layout() {
>
<a
href="#main-content"
- className="sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-[200] focus:rounded-md focus:bg-background focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className="sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-background focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
Skip to Main Content
</a>
@@ -527,7 +527,7 @@ export function Layout() {
{isMobile ? (
<div
className={cn(
- "fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-[env(safe-area-inset-top)] transition-transform duration-100 ease-out",
+ "fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",
sidebarOpen ? "translate-x-0" : "-translate-x-full"
)}
>
@@ -591,7 +591,7 @@ export function Layout() {
// changes (e.g. switching skill-detail tabs) don't widen/shift
// when the vertical scrollbar appears or disappears (PAP-10907).
isMobile
- ? "overflow-visible pb-[calc(5rem+env(safe-area-inset-bottom))]"
+ ? "overflow-visible pb-(--sz-calc-14)"
: "overflow-auto [scrollbar-gutter:stable]",
)}
>
diff --git a/ui/src/components/LiveRunWidget.tsx b/ui/src/components/LiveRunWidget.tsx
index 3947923853..027c74e37a 100644
--- a/ui/src/components/LiveRunWidget.tsx
+++ b/ui/src/components/LiveRunWidget.tsx
@@ -89,9 +89,9 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
if (runs.length === 0) return null;
return (
- <div className="overflow-hidden rounded-xl border border-cyan-500/25 bg-background/80 shadow-[0_18px_50px_rgba(6,182,212,0.08)]">
- <div className="border-b border-border/60 bg-cyan-500/[0.04] px-4 py-3">
- <div className="text-xs font-semibold uppercase tracking-[0.18em] text-cyan-700 dark:text-cyan-300">
+ <div className="overflow-hidden rounded-xl border border-blue-500/25 bg-background/80 shadow-(--shadow-extract-11)">
+ <div className="border-b border-border/60 bg-blue-500/[0.04] px-4 py-3">
+ <div className="text-xs font-semibold uppercase tracking-(--tracking-caps) text-blue-700 dark:text-blue-300">
Live Runs
</div>
<div className="mt-1 text-xs text-muted-foreground">
@@ -113,7 +113,7 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
<Link
to={`/agents/${run.agentId}/runs/${run.id}`}
- className="inline-flex items-center rounded-full border border-border/70 bg-background/70 px-2 py-1 font-mono hover:border-cyan-500/30 hover:text-foreground"
+ className="inline-flex items-center rounded-full border border-border/70 bg-background/70 px-2 py-1 font-mono hover:border-blue-500/30 hover:text-foreground"
>
{run.id.slice(0, 8)}
</Link>
@@ -127,7 +127,7 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
<button
onClick={() => handleCancelRun(run.id)}
disabled={cancellingRunIds.has(run.id)}
- className="inline-flex items-center gap-1 rounded-full border border-red-500/20 bg-red-500/[0.06] px-2.5 py-1 text-[11px] font-medium text-red-700 transition-colors hover:bg-red-500/[0.12] dark:text-red-300 disabled:opacity-50"
+ className="inline-flex items-center gap-1 rounded-full border border-red-500/20 bg-red-500/[0.06] px-2.5 py-1 text-(length:--text-micro) font-medium text-red-700 transition-colors hover:bg-red-500/[0.12] dark:text-red-300 disabled:opacity-50"
>
<Square className="h-2.5 w-2.5" fill="currentColor" />
{cancellingRunIds.has(run.id) ? "Stopping…" : "Stop"}
@@ -135,7 +135,7 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
)}
<Link
to={`/agents/${run.agentId}/runs/${run.id}`}
- className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 text-[11px] font-medium text-cyan-700 transition-colors hover:border-cyan-500/30 hover:text-cyan-600 dark:text-cyan-300"
+ className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 text-(length:--text-micro) font-medium text-blue-700 transition-colors hover:border-blue-500/30 hover:text-blue-600 dark:text-blue-300"
>
Open run
<ExternalLink className="h-3 w-3" />
@@ -143,7 +143,7 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
</div>
</div>
- <div className="max-h-[320px] overflow-y-auto pr-1">
+ <div className="max-h-(--sz-320px) overflow-y-auto pr-1">
<RunChatSurface
run={run}
transcript={transcript}
diff --git a/ui/src/components/MarkdownBody.test.tsx b/ui/src/components/MarkdownBody.test.tsx
index 1f35741cd8..3774624e32 100644
--- a/ui/src/components/MarkdownBody.test.tsx
+++ b/ui/src/components/MarkdownBody.test.tsx
@@ -283,7 +283,7 @@ describe("MarkdownBody", () => {
expect(html).toContain('data-workspace-file-link="true"');
expect(html).toContain('data-workspace-file-path="videos/90-days-paperclip/out/90-days-paperclip-1x1.mp4"');
expect(html).toContain("videos/90-days-paperclip/out/90-days-paperclip-1x1.mp4");
- expect(html).not.toContain("max-w-[38ch]");
+ expect(html).not.toContain("max-w-(--sz-38ch)");
expect(html).not.toContain("paperclip-markdown-issue-ref");
expect(html).not.toContain('href="/issues/PAP-10306"');
});
@@ -433,7 +433,7 @@ describe("MarkdownBody", () => {
const html = renderMarkdown("[https://github.com/paperclipai/paperclip/pull/4099](https://github.com/paperclipai/paperclip/pull/4099)");
expect(html).toContain('<a href="https://github.com/paperclipai/paperclip/pull/4099"');
- expect(html).toContain('class="lucide lucide-github mr-1 inline h-3.5 w-3.5 align-[-0.125em]"');
+ expect(html).toContain('class="lucide lucide-github mr-1 inline h-3.5 w-3.5 align-(--va-0_125em)"');
// The icon and first character "h" must sit in a no-wrap span so the
// icon can never be orphaned on the previous line from the URL text.
expect(html).toMatch(/<span style="white-space:nowrap">.*lucide-github.*?<\/svg>h<\/span>/);
@@ -445,7 +445,7 @@ describe("MarkdownBody", () => {
const html = renderMarkdown("See https://github.com/paperclipai/paperclip/issues/1778");
expect(html).toContain('<a href="https://github.com/paperclipai/paperclip/issues/1778"');
- expect(html).toContain('class="lucide lucide-github mr-1 inline h-3.5 w-3.5 align-[-0.125em]"');
+ expect(html).toContain('class="lucide lucide-github mr-1 inline h-3.5 w-3.5 align-(--va-0_125em)"');
});
it("does not prefix non-GitHub markdown links with the GitHub icon", () => {
@@ -559,7 +559,7 @@ describe("MarkdownBody", () => {
// PAP-243b: the lg glyph is optically centered to the body text
// (vertical-align: middle + a 1px lift), not floating off the baseline.
expect(html).toContain("align-middle");
- expect(html).not.toContain("align-[-0.125em]");
+ expect(html).not.toContain("align-(--va-0_125em)");
// Legacy h-3 w-3 sizing is gone.
expect(html).not.toContain("mr-1 h-3 w-3");
});
diff --git a/ui/src/components/MarkdownBody.tsx b/ui/src/components/MarkdownBody.tsx
index bf4e0fa580..b64f31ef27 100644
--- a/ui/src/components/MarkdownBody.tsx
+++ b/ui/src/components/MarkdownBody.tsx
@@ -194,7 +194,7 @@ const codeBlockActionStyle: React.CSSProperties = {
border: "1px solid color-mix(in oklab, var(--foreground) 14%, transparent)",
backgroundColor: "color-mix(in oklab, var(--muted) 92%, var(--background) 8%)",
color: "var(--muted-foreground)",
- fontSize: "0.7rem",
+ fontSize: "var(--text-micro)",
lineHeight: 1,
cursor: "pointer",
};
@@ -827,10 +827,10 @@ function MarkdownBodyImpl({
const isGitHubLink = isGitHubUrl(href);
const isExternal = isExternalHttpUrl(href);
const leadingIcon = isGitHubLink ? (
- <Github aria-hidden="true" className="mr-1 inline h-3.5 w-3.5 align-[-0.125em]" />
+ <Github aria-hidden="true" className="mr-1 inline h-3.5 w-3.5 align-(--va-0_125em)" />
) : null;
const trailingIcon = isExternal && !isGitHubLink ? (
- <ExternalLink aria-hidden="true" className="ml-1 inline h-3 w-3 align-[-0.125em]" />
+ <ExternalLink aria-hidden="true" className="ml-1 inline h-3 w-3 align-(--va-0_125em)" />
) : null;
return (
<a
diff --git a/ui/src/components/MarkdownEditor.test.tsx b/ui/src/components/MarkdownEditor.test.tsx
index e607c6c27d..7c3c1be645 100644
--- a/ui/src/components/MarkdownEditor.test.tsx
+++ b/ui/src/components/MarkdownEditor.test.tsx
@@ -950,7 +950,7 @@ describe("MarkdownEditor", () => {
const options = Array.from(menu.querySelectorAll('button[type="button"]'));
expect(options).toHaveLength(12);
- expect(menu.className).toContain("max-h-[208px]");
+ expect(menu.className).toContain("max-h-(--sz-208px)");
expect(menu.className).toContain("overflow-y-auto");
expect(menu.style.touchAction).toBe("pan-y");
diff --git a/ui/src/components/MarkdownEditor.tsx b/ui/src/components/MarkdownEditor.tsx
index b111f253c1..41ad6de02e 100644
--- a/ui/src/components/MarkdownEditor.tsx
+++ b/ui/src/components/MarkdownEditor.tsx
@@ -1177,7 +1177,7 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
}
}}
className={cn(
- "min-h-[12rem] w-full resize-none bg-transparent px-3 pb-3 pt-2 font-mono text-sm leading-6 outline-none",
+ "min-h-(--sz-12rem) w-full resize-none bg-transparent px-3 pb-3 pt-2 font-mono text-sm leading-6 outline-none",
contentClassName,
)}
/>
@@ -1345,7 +1345,7 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
<div
data-paperclip-floating-ui=""
data-testid="mention-autocomplete-menu"
- className="pointer-events-auto fixed z-[9999] min-w-[180px] max-w-[calc(100vw-16px)] max-h-[208px] overflow-y-auto rounded-md border border-border bg-popover shadow-md"
+ className="pointer-events-auto fixed z-(--z-9999) min-w-(--sz-180px) max-w-(--sz-calc-15) max-h-(--sz-208px) overflow-y-auto rounded-md border border-border bg-popover shadow-md"
style={{
top: mentionMenuPosition.top,
left: mentionMenuPosition.left,
@@ -1391,7 +1391,7 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
) : option.kind === "project" && option.projectId ? (
<span
className="inline-flex h-2 w-2 rounded-full border border-border/50"
- style={{ backgroundColor: option.projectColor ?? "#64748b" }}
+ style={{ backgroundColor: option.projectColor ?? "var(--project-none)" }}
/>
) : option.kind === "user" ? (
<User className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
@@ -1403,7 +1403,7 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
)}
{option.kind === "issue" && option.issueIdentifier ? (
<span className="flex min-w-0 items-baseline gap-1.5">
- <span className="shrink-0 font-mono text-[11px] text-muted-foreground">
+ <span className="shrink-0 font-mono text-(length:--text-micro) text-muted-foreground">
{option.issueIdentifier}
</span>
<span className="truncate">{issueMentionTitle(option)}</span>
@@ -1416,27 +1416,27 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
</span>
)}
{option.kind === "issue" && (
- <span className="ml-auto text-[10px] uppercase tracking-wide text-muted-foreground">
+ <span className="ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
Task
</span>
)}
{option.kind === "project" && option.projectId && (
- <span className="ml-auto text-[10px] uppercase tracking-wide text-muted-foreground">
+ <span className="ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
Project
</span>
)}
{option.kind === "user" && (
- <span className="ml-auto text-[10px] uppercase tracking-wide text-muted-foreground">
+ <span className="ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
User
</span>
)}
{option.kind === "skill" && (
- <span className="ml-auto text-[10px] uppercase tracking-wide text-muted-foreground">
+ <span className="ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
Skill
</span>
)}
{option.kind === "routine" && (
- <span className="ml-auto text-[10px] uppercase tracking-wide text-muted-foreground">
+ <span className="ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
Routine
</span>
)}
diff --git a/ui/src/components/MembershipAction.tsx b/ui/src/components/MembershipAction.tsx
index 83b2e15eed..1ecc7b9913 100644
--- a/ui/src/components/MembershipAction.tsx
+++ b/ui/src/components/MembershipAction.tsx
@@ -41,7 +41,7 @@ export function MembershipAction({
return (
<span
className={cn(
- "flex w-[66px] shrink-0 justify-end",
+ "flex w-(--sz-66px) shrink-0 justify-end",
!isLeft && !compact
? "opacity-100 sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"
: "opacity-100",
@@ -55,7 +55,7 @@ export function MembershipAction({
aria-busy={pending ? "true" : undefined}
disabled={pending}
onClick={handleClick}
- className="w-[66px]"
+ className="w-(--sz-66px)"
>
<Icon className={cn("h-3 w-3", pending && "motion-safe:animate-spin")} />
<span>{label}</span>
diff --git a/ui/src/components/MobileBottomNav.tsx b/ui/src/components/MobileBottomNav.tsx
index e32a68b93c..44eda28a97 100644
--- a/ui/src/components/MobileBottomNav.tsx
+++ b/ui/src/components/MobileBottomNav.tsx
@@ -60,7 +60,7 @@ export function MobileBottomNav({ visible }: MobileBottomNavProps) {
return (
<nav
className={cn(
- "fixed bottom-0 left-0 right-0 z-30 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/85 transition-transform duration-200 ease-out md:hidden pb-[env(safe-area-inset-bottom)]",
+ "fixed bottom-0 left-0 right-0 z-30 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/85 transition-transform duration-200 ease-out md:hidden pb-(--sz-safe-bottom)",
visible ? "translate-y-0" : "translate-y-full",
)}
aria-label="Mobile navigation"
@@ -76,13 +76,13 @@ export function MobileBottomNav({ visible }: MobileBottomNavProps) {
type="button"
onClick={item.onClick}
className={cn(
- "relative flex min-w-0 flex-col items-center justify-center gap-1 rounded-md text-[10px] font-medium transition-colors",
+ "relative flex min-w-0 flex-col items-center justify-center gap-1 rounded-md text-(length:--text-nano) font-medium transition-colors",
active
? "text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
- <Icon className="h-[18px] w-[18px]" />
+ <Icon className="h-(--sz-18px) w-(--sz-18px)" />
<span className="truncate">{item.label}</span>
</button>
);
@@ -96,7 +96,7 @@ export function MobileBottomNav({ visible }: MobileBottomNavProps) {
state={SIDEBAR_SCROLL_RESET_STATE}
className={({ isActive }) =>
cn(
- "relative flex min-w-0 flex-col items-center justify-center gap-1 rounded-md text-[10px] font-medium transition-colors",
+ "relative flex min-w-0 flex-col items-center justify-center gap-1 rounded-md text-(length:--text-nano) font-medium transition-colors",
isActive
? "text-foreground"
: "text-muted-foreground hover:text-foreground",
@@ -106,9 +106,9 @@ export function MobileBottomNav({ visible }: MobileBottomNavProps) {
{({ isActive }) => (
<>
<span className="relative">
- <Icon className={cn("h-[18px] w-[18px]", isActive && "stroke-[2.3]")} />
+ <Icon className={cn("h-(--sz-18px) w-(--sz-18px)", isActive && "stroke-(length:--sw-2_3)")} />
{item.badge != null && item.badge > 0 && (
- <span className="absolute -right-2 -top-2 rounded-full bg-primary px-1.5 py-0.5 text-[10px] leading-none text-primary-foreground">
+ <span className="absolute -right-2 -top-2 rounded-full bg-primary px-1.5 py-0.5 text-(length:--text-nano) leading-none text-primary-foreground">
{item.badge > 99 ? "99+" : item.badge}
</span>
)}
diff --git a/ui/src/components/NewAgentDialog.tsx b/ui/src/components/NewAgentDialog.tsx
index 6062d4438d..be489954ea 100644
--- a/ui/src/components/NewAgentDialog.tsx
+++ b/ui/src/components/NewAgentDialog.tsx
@@ -226,7 +226,7 @@ export function NewAgentDialog() {
<DialogContent
showCloseButton={false}
className={cn(
- "max-h-[min(calc(100dvh-2rem),46rem)] p-0 gap-0 overflow-hidden flex flex-col",
+ "max-h-(--sz-calc-16) p-0 gap-0 overflow-hidden flex flex-col",
mode === "invite" || mode === "prompt" ? "sm:max-w-2xl" : "sm:max-w-md",
)}
>
@@ -311,13 +311,13 @@ export function NewAgentDialog() {
}}
>
{opt.recommended && (
- <span className="absolute -top-1.5 right-1.5 bg-green-500 text-white text-[9px] font-semibold px-1.5 py-0.5 rounded-full leading-none">
+ <span className="absolute -top-1.5 right-1.5 bg-green-500 text-white text-(length:--text-nano) font-semibold px-1.5 py-0.5 rounded-full leading-none">
Recommended
</span>
)}
<opt.icon className="h-4 w-4" />
<span className="font-medium">{opt.label}</span>
- <span className="text-muted-foreground text-[10px]">
+ <span className="text-muted-foreground text-(length:--text-nano)">
{opt.desc}
</span>
</button>
@@ -395,7 +395,7 @@ export function NewAgentDialog() {
<Textarea
readOnly
value={latestAgentPrompt ?? ""}
- className="h-[24rem] resize-y font-mono text-xs"
+ className="h-(--sz-24rem) resize-y font-mono text-xs"
/>
<Button
size="sm"
diff --git a/ui/src/components/NewGoalDialog.tsx b/ui/src/components/NewGoalDialog.tsx
index 1ebb473971..a589cfae8d 100644
--- a/ui/src/components/NewGoalDialog.tsx
+++ b/ui/src/components/NewGoalDialog.tsx
@@ -168,14 +168,14 @@ export function NewGoalDialog() {
</div>
{/* Description */}
- <div className="px-4 pb-2 overflow-y-auto max-h-[50vh]">
+ <div className="px-4 pb-2 overflow-y-auto max-h-(--sz-50vh)">
<MarkdownEditor
ref={descriptionEditorRef}
value={description}
onChange={setDescription}
placeholder="Add description..."
bordered={false}
- contentClassName={cn("text-sm text-muted-foreground", expanded ? "min-h-[220px]" : "min-h-[120px]")}
+ contentClassName={cn("text-sm text-muted-foreground", expanded ? "min-h-(--sz-220px)" : "min-h-(--sz-120px)")}
imageUploadHandler={async (file) => {
const asset = await uploadDescriptionImage.mutateAsync(file);
return asset.contentPath;
diff --git a/ui/src/components/NewIssueDialog.test.tsx b/ui/src/components/NewIssueDialog.test.tsx
index 3de44e7e57..cf5fe5227a 100644
--- a/ui/src/components/NewIssueDialog.test.tsx
+++ b/ui/src/components/NewIssueDialog.test.tsx
@@ -1068,9 +1068,9 @@ describe("NewIssueDialog", () => {
await flush();
const dialogContent = Array.from(container.querySelectorAll("div")).find((element) =>
- typeof element.className === "string" && element.className.includes("max-h-[var(--new-issue-dialog-height)]"),
+ typeof element.className === "string" && element.className.includes("max-h-(--new-issue-dialog-height)"),
);
- expect(dialogContent?.className).toContain("h-[var(--new-issue-dialog-height)]");
+ expect(dialogContent?.className).toContain("h-(--new-issue-dialog-height)");
expect(dialogContent?.className).toContain("overflow-hidden");
expect(dialogContent?.getAttribute("style")).toContain("env(safe-area-inset-top)");
expect(dialogContent?.getAttribute("style")).toContain("env(safe-area-inset-bottom)");
diff --git a/ui/src/components/NewIssueDialog.tsx b/ui/src/components/NewIssueDialog.tsx
index d2a6871bf1..87a62341f2 100644
--- a/ui/src/components/NewIssueDialog.tsx
+++ b/ui/src/components/NewIssueDialog.tsx
@@ -405,7 +405,7 @@ const IssueDescriptionEditor = memo(function IssueDescriptionEditor({
placeholder="Add description..."
bordered={false}
mentions={mentions}
- contentClassName={cn("text-sm text-muted-foreground pb-12", expanded ? "min-h-[220px]" : "min-h-[120px]")}
+ contentClassName={cn("text-sm text-muted-foreground pb-12", expanded ? "min-h-(--sz-220px)" : "min-h-(--sz-120px)")}
imageUploadHandler={imageUploadHandler}
/>
);
@@ -1277,9 +1277,9 @@ export function NewIssueDialog() {
aria-describedby={undefined}
style={{ "--new-issue-dialog-height": MOBILE_DIALOG_HEIGHT } as CSSProperties}
className={cn(
- "flex h-[var(--new-issue-dialog-height)] max-h-[var(--new-issue-dialog-height)] flex-col gap-0 overflow-hidden p-0 sm:h-auto",
+ "flex h-(--new-issue-dialog-height) max-h-(--new-issue-dialog-height) flex-col gap-0 overflow-hidden p-0 sm:h-auto",
expanded
- ? "sm:max-w-2xl sm:h-[var(--new-issue-dialog-height)]"
+ ? "sm:max-w-2xl sm:h-(--new-issue-dialog-height)"
: "sm:max-w-lg"
)}
onKeyDown={handleKeyDown}
@@ -1352,7 +1352,7 @@ export function NewIssueDialog() {
>
<span
className={cn(
- "px-1 py-0.5 rounded text-[10px] font-semibold leading-none",
+ "px-1 py-0.5 rounded text-(length:--text-nano) font-semibold leading-none",
!c.brandColor && "bg-muted",
)}
style={
@@ -1504,7 +1504,7 @@ export function NewIssueDialog() {
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: currentProject.color ?? "#6366f1" }}
+ style={{ backgroundColor: currentProject.color ?? "var(--project-seed)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -1519,7 +1519,7 @@ export function NewIssueDialog() {
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: project?.color ?? "#6366f1" }}
+ style={{ backgroundColor: project?.color ?? "var(--project-seed)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -1797,7 +1797,7 @@ export function NewIssueDialog() {
<div className="px-4 py-3 space-y-2">
<div className="space-y-1.5">
<div className="text-xs font-medium">Execution workspace</div>
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
Control whether this task runs in the shared workspace, a new isolated workspace, or an existing one.
</div>
<select
@@ -1827,12 +1827,12 @@ export function NewIssueDialog() {
/>
)}
{executionWorkspaceMode === "reuse_existing" && selectedReusableExecutionWorkspace && (
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
Reusing {selectedReusableExecutionWorkspace.name} from {selectedReusableExecutionWorkspace.branchName ?? selectedReusableExecutionWorkspace.cwd ?? "existing execution workspace"}.
</div>
)}
{showParentWorkspaceWarning ? (
- <div className="rounded-md border border-amber-300/60 bg-amber-50 px-2 py-1.5 text-[11px] text-amber-900 dark:border-amber-800/70 dark:bg-amber-950/30 dark:text-amber-100">
+ <div className="rounded-md border border-amber-300/60 bg-amber-50 px-2 py-1.5 text-(length:--text-micro) text-amber-900 dark:border-amber-800/70 dark:bg-amber-950/30 dark:text-amber-100">
Warning: this sub-task will no longer use the parent task workspace{parentExecutionWorkspaceLabel ? ` (${parentExecutionWorkspaceLabel})` : ""}.
</div>
) : null}
@@ -1879,7 +1879,7 @@ export function NewIssueDialog() {
))}
</div>
{assigneeModelLane === "cheap" && (
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Sends <code>modelProfile: "cheap"</code>{" "}
{assigneeCheapProfile?.adapterConfig && typeof (assigneeCheapProfile.adapterConfig as Record<string, unknown>).model === "string"
? <>· adapter default <code>{String((assigneeCheapProfile.adapterConfig as Record<string, unknown>).model)}</code></>
@@ -1889,10 +1889,10 @@ export function NewIssueDialog() {
</p>
)}
{assigneeModelLane === "primary" && (
- <p className="text-[11px] text-muted-foreground">Runs on the agent's primary model.</p>
+ <p className="text-(length:--text-micro) text-muted-foreground">Runs on the agent's primary model.</p>
)}
{assigneeModelLane === "custom" && (
- <p className="text-[11px] text-muted-foreground">Override the model and effort for this task only.</p>
+ <p className="text-(length:--text-micro) text-muted-foreground">Override the model and effort for this task only.</p>
)}
</div>
{assigneeModelLane === "custom" && (
@@ -1976,12 +1976,12 @@ export function NewIssueDialog() {
<div key={file.id} className="flex items-start justify-between gap-3 rounded-md border border-border/70 px-3 py-2">
<div className="min-w-0">
<div className="flex items-center gap-2">
- <span className="rounded-full border border-border px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground">
+ <span className="rounded-full border border-border px-2 py-0.5 font-mono text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{file.documentKey}
</span>
<span className="truncate text-sm">{file.file.name}</span>
</div>
- <div className="mt-1 flex items-center gap-2 text-[11px] text-muted-foreground">
+ <div className="mt-1 flex items-center gap-2 text-(length:--text-micro) text-muted-foreground">
<FileText className="h-3.5 w-3.5" />
<span>{file.title || file.file.name}</span>
<span>•</span>
@@ -2015,7 +2015,7 @@ export function NewIssueDialog() {
<Paperclip className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
<span className="truncate text-sm">{file.file.name}</span>
</div>
- <div className="mt-1 text-[11px] text-muted-foreground">
+ <div className="mt-1 text-(length:--text-micro) text-muted-foreground">
{file.file.type || "application/octet-stream"} • {formatFileSize(file.file)}
</div>
</div>
@@ -2063,7 +2063,7 @@ export function NewIssueDialog() {
<span className="flex flex-col text-left leading-tight">
<span>{s.label}</span>
{s.description ? (
- <span className="text-[10px] text-muted-foreground">{s.description}</span>
+ <span className="text-(length:--text-nano) text-muted-foreground">{s.description}</span>
) : null}
</span>
</button>
@@ -2187,7 +2187,7 @@ export function NewIssueDialog() {
</PopoverTrigger>
<PopoverContent className="w-44 p-1" align="start" data-testid="new-issue-more-menu">
<div className="sm:hidden">
- <div className="px-2 py-1 text-[10px] font-medium uppercase text-muted-foreground">
+ <div className="px-2 py-1 text-(length:--text-nano) font-medium uppercase text-muted-foreground">
Priority
</div>
{priorities.map((p) => (
@@ -2270,7 +2270,7 @@ export function NewIssueDialog() {
</div>
<Button
size="sm"
- className="min-w-[8.5rem] disabled:opacity-100"
+ className="min-w-(--sz-8_5rem) disabled:opacity-100"
disabled={!titleHasText || createIssue.isPending}
onClick={handleSubmit}
aria-busy={createIssue.isPending}
diff --git a/ui/src/components/NewProjectDialog.tsx b/ui/src/components/NewProjectDialog.tsx
index 2d732f69d3..df90e3f99c 100644
--- a/ui/src/components/NewProjectDialog.tsx
+++ b/ui/src/components/NewProjectDialog.tsx
@@ -271,7 +271,7 @@ export function NewProjectDialog() {
placeholder="Add description..."
bordered={false}
mentions={mentionOptions}
- contentClassName={cn("text-sm text-muted-foreground", expanded ? "min-h-[220px]" : "min-h-[120px]")}
+ contentClassName={cn("text-sm text-muted-foreground", expanded ? "min-h-(--sz-220px)" : "min-h-(--sz-120px)")}
imageUploadHandler={async (file) => {
const asset = await uploadDescriptionImage.mutateAsync(file);
return asset.contentPath;
@@ -288,7 +288,7 @@ export function NewProjectDialog() {
<TooltipTrigger asChild>
<HelpCircle className="h-3 w-3 text-muted-foreground/50 cursor-help" />
</TooltipTrigger>
- <TooltipContent side="top" className="max-w-[240px] text-xs">
+ <TooltipContent side="top" className="max-w-(--sz-240px) text-xs">
Link a GitHub repository so agents can clone, read, and push code for this project.
</TooltipContent>
</Tooltip>
@@ -309,7 +309,7 @@ export function NewProjectDialog() {
<TooltipTrigger asChild>
<HelpCircle className="h-3 w-3 text-muted-foreground/50 cursor-help" />
</TooltipTrigger>
- <TooltipContent side="top" className="max-w-[240px] text-xs">
+ <TooltipContent side="top" className="max-w-(--sz-240px) text-xs">
Set an absolute path on this machine where local agents will read and write files for this project.
</TooltipContent>
</Tooltip>
@@ -361,7 +361,7 @@ export function NewProjectDialog() {
className="inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs"
>
<Target className="h-3 w-3 text-muted-foreground" />
- <span className="max-w-[160px] truncate">{goal.title}</span>
+ <span className="max-w-(--sz-160px) truncate">{goal.title}</span>
<button
className="text-muted-foreground hover:text-foreground"
onClick={() => setGoalIds((prev) => prev.filter((id) => id !== goal.id))}
diff --git a/ui/src/components/OnboardingChat.tsx b/ui/src/components/OnboardingChat.tsx
index cb825b50ec..0061ddf580 100644
--- a/ui/src/components/OnboardingChat.tsx
+++ b/ui/src/components/OnboardingChat.tsx
@@ -259,7 +259,7 @@ export function OnboardingChat({
{/* Messages */}
<div
ref={scrollRef}
- className="flex-1 overflow-y-auto space-y-3 mb-3 min-h-[180px] max-h-[320px] pr-1"
+ className="flex-1 overflow-y-auto space-y-3 mb-3 min-h-(--sz-180px) max-h-(--sz-320px) pr-1"
>
{/* CEO welcome message + chips — delayed reveal */}
<WelcomeMessage
@@ -290,7 +290,7 @@ export function OnboardingChat({
<div className="flex items-center gap-1.5 mb-1">
<span
className={cn(
- "text-[10px] font-medium uppercase tracking-wide",
+ "text-(length:--text-nano) font-medium uppercase tracking-wide",
isAgent
? "text-muted-foreground"
: "text-foreground/70",
@@ -299,7 +299,7 @@ export function OnboardingChat({
{isAgent ? agentName : "You"}
</span>
{isPlan && (
- <span className="inline-flex items-center gap-0.5 text-[10px] text-green-600 dark:text-green-400 font-medium">
+ <span className="inline-flex items-center gap-0.5 text-(length:--text-nano) text-green-600 dark:text-green-400 font-medium">
<CheckCircle2 className="h-3 w-3" />
Hiring plan detected
</span>
@@ -323,8 +323,8 @@ export function OnboardingChat({
{hasActiveRun ? (
<>
<span className="relative flex h-2.5 w-2.5 shrink-0">
- <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75" />
- <span className="relative inline-flex rounded-full h-2.5 w-2.5 bg-cyan-500" />
+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
+ <span className="relative inline-flex rounded-full h-2.5 w-2.5 bg-blue-500" />
</span>
{getRunStatusMessage(activeRun.status, agentName, elapsed)}
</>
@@ -335,7 +335,7 @@ export function OnboardingChat({
</>
)}
</div>
- <span className="text-[11px] text-muted-foreground/60 tabular-nums shrink-0">
+ <span className="text-(length:--text-micro) text-muted-foreground/60 tabular-nums shrink-0">
{elapsedStr}
</span>
</div>
@@ -352,7 +352,7 @@ export function OnboardingChat({
<p className="text-sm font-medium">
{agentName} has prepared a hiring plan
</p>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Review it, make edits, then approve.
</p>
</div>
@@ -427,7 +427,7 @@ function WelcomeMessage({
{showMessage && (
<div className="rounded-md px-3 py-2 text-sm bg-muted/50 border border-border mr-8 animate-in fade-in duration-300">
<div className="flex items-center gap-1.5 mb-1">
- <span className="text-[10px] font-medium uppercase tracking-wide text-muted-foreground">
+ <span className="text-(length:--text-nano) font-medium uppercase tracking-wide text-muted-foreground">
{agentName}
</span>
</div>
@@ -468,8 +468,8 @@ function WelcomeMessage({
{!showMessage && (
<div className="flex items-center gap-2 text-sm text-muted-foreground px-3 py-2">
<span className="relative flex h-2.5 w-2.5 shrink-0">
- <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75" />
- <span className="relative inline-flex rounded-full h-2.5 w-2.5 bg-cyan-500" />
+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
+ <span className="relative inline-flex rounded-full h-2.5 w-2.5 bg-blue-500" />
</span>
{phase === "waking"
? `${agentName} is waking up...`
diff --git a/ui/src/components/OnboardingWizard.tsx b/ui/src/components/OnboardingWizard.tsx
index b68a7de9bb..1047217b46 100644
--- a/ui/src/components/OnboardingWizard.tsx
+++ b/ui/src/components/OnboardingWizard.tsx
@@ -783,7 +783,7 @@ export function OnboardingWizard() {
{step !== 0 && (
<div
className={cn(
- "w-full flex flex-col overflow-y-auto transition-[width] duration-500 ease-in-out",
+ "w-full flex flex-col overflow-y-auto transition-(--tp-width) duration-500 ease-in-out",
step === 1 || step === 2 ? "md:w-1/2" : "md:w-full"
)}
>
@@ -859,7 +859,7 @@ export function OnboardingWizard() {
glow="blue"
size="md"
/>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
{step === 3 ? (
"an empty slot for an agent"
) : step === 4 ? (
@@ -901,7 +901,7 @@ export function OnboardingWizard() {
<div className="group">
<label className="text-xs text-muted-foreground mb-1 block">What are your current workflows?</label>
<textarea
- className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-[60px]"
+ className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-(--sz-60px)"
placeholder="e.g. Manual content creation, spreadsheet tracking, email outreach"
value={growWorkflows}
onChange={(e) => setGrowWorkflows(e.target.value)}
@@ -910,7 +910,7 @@ export function OnboardingWizard() {
<div className="group">
<label className="text-xs text-muted-foreground mb-1 block">What pain points would you solve with AI?</label>
<textarea
- className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-[60px]"
+ className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-(--sz-60px)"
placeholder="e.g. Can't produce content fast enough, no time for social media"
value={growPainPoints}
onChange={(e) => setGrowPainPoints(e.target.value)}
@@ -945,7 +945,7 @@ export function OnboardingWizard() {
<div className="group">
<label className="text-xs text-foreground mb-1 block">Generated mission — edit however you like:</label>
<textarea
- className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-[60px]"
+ className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-(--sz-60px)"
value={companyGoal}
onChange={(e) => setCompanyGoal(e.target.value)}
/>
@@ -954,7 +954,7 @@ export function OnboardingWizard() {
</>
)}
<button
- className="text-[11px] text-muted-foreground hover:text-foreground transition-colors"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground transition-colors"
onClick={() => { setOnboardingPath(null); setStep(0); }}
>
← Back to start
@@ -1003,7 +1003,7 @@ export function OnboardingWizard() {
/>
</div>
<button
- className="text-[11px] text-muted-foreground hover:text-foreground transition-colors"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground transition-colors"
onClick={() => { setOnboardingPath(null); setStep(0); }}
>
← Back to start
@@ -1043,7 +1043,7 @@ export function OnboardingWizard() {
>
<Sparkles className="h-4 w-4" />
<span className="font-medium">I know my mission</span>
- <span className="text-muted-foreground text-[10px]">
+ <span className="text-muted-foreground text-(length:--text-nano)">
Type it directly
</span>
</button>
@@ -1058,7 +1058,7 @@ export function OnboardingWizard() {
>
<ListTodo className="h-4 w-4" />
<span className="font-medium">Help me figure it out</span>
- <span className="text-muted-foreground text-[10px]">
+ <span className="text-muted-foreground text-(length:--text-nano)">
Answer a few questions
</span>
</button>
@@ -1080,7 +1080,7 @@ export function OnboardingWizard() {
Mission
</label>
<textarea
- className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-[60px]"
+ className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-(--sz-60px)"
placeholder="What is your team trying to achieve?"
value={companyGoal}
onChange={(e) => setCompanyGoal(e.target.value)}
@@ -1093,7 +1093,7 @@ export function OnboardingWizard() {
<button
key={chip}
className={cn(
- "rounded-full border px-2.5 py-1 text-[11px] transition-colors",
+ "rounded-full border px-2.5 py-1 text-(length:--text-micro) transition-colors",
companyGoal === chip
? "border-foreground bg-accent text-foreground"
: "border-border text-muted-foreground hover:text-foreground hover:border-foreground/50"
@@ -1178,14 +1178,14 @@ export function OnboardingWizard() {
Here's your draft mission — edit it however you like:
</label>
<textarea
- className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-[80px]"
+ className="w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50 resize-none min-h-(--sz-80px)"
value={companyGoal}
onChange={(e) => setCompanyGoal(e.target.value)}
autoFocus
/>
</div>
<button
- className="text-[11px] text-muted-foreground hover:text-foreground transition-colors"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground transition-colors"
onClick={() => { setMissionConfirmed(false); setCompanyGoal(""); }}
>
← Back to questions
@@ -1195,13 +1195,13 @@ export function OnboardingWizard() {
{/* Confirm mission note */}
{companyGoal.trim() && (
- <p className="text-[11px] text-muted-foreground italic">
+ <p className="text-(length:--text-micro) text-muted-foreground italic">
You can always change your mission later in settings.
</p>
)}
<button
- className="text-[11px] text-muted-foreground hover:text-foreground transition-colors"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground transition-colors"
onClick={() => setStep(1)}
>
← Change company name
@@ -1265,13 +1265,13 @@ export function OnboardingWizard() {
}}
>
{opt.recommended && (
- <span className="absolute -top-1.5 right-1.5 bg-green-500 text-white text-[9px] font-semibold px-1.5 py-0.5 rounded-full leading-none">
+ <span className="absolute -top-1.5 right-1.5 bg-green-500 text-white text-(length:--text-nano) font-semibold px-1.5 py-0.5 rounded-full leading-none">
Recommended
</span>
)}
<opt.icon className="h-4 w-4" />
<span className="font-medium">{opt.label}</span>
- <span className="text-muted-foreground text-[10px]">
+ <span className="text-muted-foreground text-(length:--text-nano)">
{opt.description}
</span>
</button>
@@ -1326,7 +1326,7 @@ export function OnboardingWizard() {
>
<opt.icon className="h-4 w-4" />
<span className="font-medium">{opt.label}</span>
- <span className="text-muted-foreground text-[10px]">
+ <span className="text-muted-foreground text-(length:--text-nano)">
{opt.comingSoon
? opt.disabledLabel ?? "Coming soon"
: opt.description}
@@ -1369,7 +1369,7 @@ export function OnboardingWizard() {
</button>
</PopoverTrigger>
<PopoverContent
- className="w-[var(--radix-popover-trigger-width)] p-1"
+ className="w-(--radix-popover-trigger-width) p-1"
align="start"
>
<input
@@ -1393,14 +1393,14 @@ export function OnboardingWizard() {
Default
</button>
)}
- <div className="max-h-[240px] overflow-y-auto">
+ <div className="max-h-(--sz-240px) overflow-y-auto">
{groupedModels.map((group) => (
<div
key={group.provider}
className="mb-1 last:mb-0"
>
{adapterType === "opencode_local" && (
- <div className="px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground">
+ <div className="px-2 py-1 text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
{group.provider} ({group.entries.length})
</div>
)}
@@ -1447,7 +1447,7 @@ export function OnboardingWizard() {
<p className="text-xs font-medium">
Adapter environment check
</p>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Runs a live probe that asks the adapter CLI to
respond with hello.
</p>
@@ -1464,7 +1464,7 @@ export function OnboardingWizard() {
</div>
{adapterEnvError && (
- <div className="rounded-md border border-destructive/30 bg-destructive/10 px-2.5 py-2 text-[11px] text-destructive">
+ <div className="rounded-md border border-destructive/30 bg-destructive/10 px-2.5 py-2 text-(length:--text-micro) text-destructive">
{adapterEnvError}
</div>
)}
@@ -1481,7 +1481,7 @@ export function OnboardingWizard() {
{shouldSuggestUnsetAnthropicApiKey && (
<div className="rounded-md border border-amber-300/60 bg-amber-50/40 px-2.5 py-2 space-y-2">
- <p className="text-[11px] text-amber-900/90 leading-relaxed">
+ <p className="text-(length:--text-micro) text-amber-900/90 leading-relaxed">
Claude failed while{" "}
<span className="font-mono">ANTHROPIC_API_KEY</span>{" "}
is set. You can clear it in this adapter config
@@ -1504,7 +1504,7 @@ export function OnboardingWizard() {
)}
{adapterEnvResult && adapterEnvResult.status === "fail" && (
- <div className="rounded-md border border-border/70 bg-muted/20 px-2.5 py-2 text-[11px] space-y-1.5">
+ <div className="rounded-md border border-border/70 bg-muted/20 px-2.5 py-2 text-(length:--text-micro) space-y-1.5">
<p className="font-medium">Manual debug</p>
<p className="text-muted-foreground font-mono break-all">
{adapterType === "cursor"
@@ -1719,7 +1719,7 @@ export function OnboardingWizard() {
name + mission steps) */}
<div
className={cn(
- "hidden md:block overflow-hidden bg-[#1d1d1d] transition-[width,opacity] duration-500 ease-in-out",
+ "hidden md:block overflow-hidden bg-(--hex-1d1d1d) transition-(--tp-width-opacity) duration-500 ease-in-out",
step === 1 || step === 2 ? "w-1/2 opacity-100" : "w-0 opacity-0"
)}
>
@@ -1750,7 +1750,7 @@ function AdapterEnvironmentResult({
: "text-red-700 dark:text-red-300 border-red-300 dark:border-red-500/40 bg-red-50 dark:bg-red-500/10";
return (
- <div className={`rounded-md border px-2.5 py-2 text-[11px] ${statusClass}`}>
+ <div className={`rounded-md border px-2.5 py-2 text-(length:--text-micro) ${statusClass}`}>
<div className="flex items-center justify-between gap-2">
<span className="font-medium">{statusLabel}</span>
<span className="opacity-80">
diff --git a/ui/src/components/PageSkeleton.tsx b/ui/src/components/PageSkeleton.tsx
index cf2e2abd41..ef23654c31 100644
--- a/ui/src/components/PageSkeleton.tsx
+++ b/ui/src/components/PageSkeleton.tsx
@@ -99,7 +99,7 @@ export function PageSkeleton({ variant = "list" }: PageSkeletonProps) {
if (variant === "org-chart") {
return (
<div className="space-y-4">
- <Skeleton className="h-[calc(100vh-4rem)] w-full rounded-lg border border-border" />
+ <Skeleton className="h-(--sz-calc-17) w-full rounded-lg border border-border" />
</div>
);
}
diff --git a/ui/src/components/PipelineItemBodyDocument.tsx b/ui/src/components/PipelineItemBodyDocument.tsx
index a7fcdbdf7e..128c1b6c4d 100644
--- a/ui/src/components/PipelineItemBodyDocument.tsx
+++ b/ui/src/components/PipelineItemBodyDocument.tsx
@@ -242,7 +242,7 @@ export function PipelineItemBodyDocument({
[conversationIssueId, doc?.latestRevisionId, latestBody, onStartConversation, pushToast, saveMutation],
);
- const bodyContentClassName = "paperclip-edit-in-place-content min-h-[220px] text-[15px] leading-7";
+ const bodyContentClassName = "paperclip-edit-in-place-content min-h-(--sz-220px) text-sm leading-7";
const renderReadOnlyBody = (body: string) => (
<FoldCurtain className="max-w-3xl">
@@ -268,7 +268,7 @@ export function PipelineItemBodyDocument({
onChange={setDraftBody}
placeholder="Write the item body in Markdown…"
bordered={false}
- className="min-h-[220px] bg-transparent"
+ className="min-h-(--sz-220px) bg-transparent"
contentClassName={bodyContentClassName}
mentions={mentions}
imageUploadHandler={imageUploadHandler}
@@ -276,7 +276,7 @@ export function PipelineItemBodyDocument({
/>
</div>
<div className="mt-2 flex flex-wrap items-center justify-between gap-2">
- <span className="text-[11px] text-muted-foreground">
+ <span className="text-(length:--text-micro) text-muted-foreground">
Saving creates rev {(doc?.latestRevisionNumber ?? 0) + 1} · ⌘↵ to save · Esc to cancel
</span>
<div className="flex items-center gap-2">
@@ -297,7 +297,7 @@ export function PipelineItemBodyDocument({
<div className="rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-3">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1">
- <p className="text-sm font-medium text-amber-200">
+ <p className="text-sm font-medium text-amber-800 dark:text-amber-200">
Viewing revision {selectedHistoricalRevision.revisionNumber}
</p>
<p className="text-xs text-muted-foreground">
@@ -360,7 +360,7 @@ export function PipelineItemBodyDocument({
className="relative min-w-0"
data-testid="pipeline-item-body-unlinked"
>
- <div className="relative z-[1]">{renderReadOnlyBody(displayedBody)}</div>
+ <div className="relative z-(--z-1)">{renderReadOnlyBody(displayedBody)}</div>
<DocumentAnnotationLayer
containerRef={containerRef}
markdown={displayedBody}
@@ -415,7 +415,7 @@ export function PipelineItemBodyDocument({
/>
) : null}
actionsSlot={editing ? (
- <span className="text-[11px] font-medium text-amber-300">● Editing · unsaved</span>
+ <span className="text-(length:--text-micro) font-medium text-amber-700 dark:text-amber-300">● Editing · unsaved</span>
) : (
<Button variant="ghost" size="sm" className="h-auto gap-1.5 px-2 py-1 text-xs" onClick={beginEdit}>
<FilePenLine className="h-3.5 w-3.5" />
diff --git a/ui/src/components/PipelineStageHistoryPanel.tsx b/ui/src/components/PipelineStageHistoryPanel.tsx
index 9e53571a32..864604e556 100644
--- a/ui/src/components/PipelineStageHistoryPanel.tsx
+++ b/ui/src/components/PipelineStageHistoryPanel.tsx
@@ -113,7 +113,7 @@ export function PipelineStageHistoryPanel({
<p className="text-sm font-medium">
Revision {revision.revisionNumber}
{isCurrent ? (
- <span className="ml-2 rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground">
+ <span className="ml-2 rounded-full bg-muted px-2 py-0.5 text-(length:--text-micro) font-medium text-muted-foreground">
Current
</span>
) : null}
diff --git a/ui/src/components/ProductivityReviewBadge.tsx b/ui/src/components/ProductivityReviewBadge.tsx
index 7b6b04c6cb..e49b3dfc14 100644
--- a/ui/src/components/ProductivityReviewBadge.tsx
+++ b/ui/src/components/ProductivityReviewBadge.tsx
@@ -46,7 +46,7 @@ export function ProductivityReviewBadge({
<Link
to={reviewPath}
className={cn(
- "inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300 shrink-0 hover:bg-amber-500/20 transition-colors",
+ "inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:text-amber-300 shrink-0 hover:bg-amber-500/20 transition-colors",
className,
)}
aria-label={`Under review · productivity review ${reviewIdentifier} (${label})`}
diff --git a/ui/src/components/ProjectProperties.tsx b/ui/src/components/ProjectProperties.tsx
index 2d895a4c38..8e44a92c2f 100644
--- a/ui/src/components/ProjectProperties.tsx
+++ b/ui/src/components/ProjectProperties.tsx
@@ -59,7 +59,7 @@ export type ProjectConfigFieldKey =
function SaveIndicator({ state }: { state: ProjectFieldSaveState }) {
if (state === "saving") {
return (
- <span className="inline-flex items-center gap-1 text-[11px] text-muted-foreground">
+ <span className="inline-flex items-center gap-1 text-(length:--text-micro) text-muted-foreground">
<Loader2 className="h-3 w-3 animate-spin" />
Saving
</span>
@@ -67,7 +67,7 @@ function SaveIndicator({ state }: { state: ProjectFieldSaveState }) {
}
if (state === "saved") {
return (
- <span className="inline-flex items-center gap-1 text-[11px] text-green-600 dark:text-green-400">
+ <span className="inline-flex items-center gap-1 text-(length:--text-micro) text-green-600 dark:text-green-400">
<Check className="h-3 w-3" />
Saved
</span>
@@ -75,7 +75,7 @@ function SaveIndicator({ state }: { state: ProjectFieldSaveState }) {
}
if (state === "error") {
return (
- <span className="inline-flex items-center gap-1 text-[11px] text-destructive">
+ <span className="inline-flex items-center gap-1 text-(length:--text-micro) text-destructive">
<AlertCircle className="h-3 w-3" />
Failed
</span>
@@ -641,7 +641,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
}}
onChange={(env) => commitField("env", { env: env ?? null })}
/>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Applied to all runs for tasks in this project. Project values override agent env on key conflicts.
</p>
</div>
@@ -669,7 +669,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
<TooltipTrigger asChild>
<button
type="button"
- className="inline-flex h-4 w-4 items-center justify-center rounded-full border border-border text-[10px] text-muted-foreground hover:text-foreground"
+ className="inline-flex h-4 w-4 items-center justify-center rounded-full border border-border text-(length:--text-nano) text-muted-foreground hover:text-foreground"
aria-label="Codebase help"
>
?
@@ -682,7 +682,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
</div>
<div className="space-y-2 rounded-md border border-border/70 p-3">
<div className="space-y-1">
- <div className="text-[11px] uppercase tracking-wide text-muted-foreground">Repo</div>
+ <div className="text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">Repo</div>
{codebase.repoUrl ? (
<div className="flex items-center justify-between gap-2">
{isSafeExternalUrl(codebase.repoUrl) ? (
@@ -745,14 +745,14 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
</div>
<div className="space-y-1">
- <div className="text-[11px] uppercase tracking-wide text-muted-foreground">Local folder</div>
+ <div className="text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">Local folder</div>
<div className="flex items-center justify-between gap-2">
<div className="min-w-0 space-y-1">
<div className="min-w-0 break-all font-mono text-xs text-muted-foreground">
{codebase.effectiveLocalFolder}
</div>
{codebase.origin === "managed_checkout" && (
- <div className="text-[11px] text-muted-foreground">Paperclip-managed folder.</div>
+ <div className="text-(length:--text-micro) text-muted-foreground">Paperclip-managed folder.</div>
)}
</div>
<div className="flex items-center gap-1">
@@ -783,7 +783,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
</div>
{hasAdditionalLegacyWorkspaces && (
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
Additional legacy workspace records exist on this project. Paperclip is using the primary workspace as the codebase view.
</div>
)}
@@ -797,10 +797,10 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
>
<div className="min-w-0 space-y-0.5">
<div className="flex items-center gap-2">
- <span className="text-[11px] font-medium">{service.serviceName}</span>
+ <span className="text-(length:--text-micro) font-medium">{service.serviceName}</span>
<span
className={cn(
- "rounded-full px-1.5 py-0.5 text-[10px] uppercase tracking-wide",
+ "rounded-full px-1.5 py-0.5 text-(length:--text-nano) uppercase tracking-wide",
service.status === "running"
? "bg-green-500/15 text-green-700 dark:text-green-300"
: service.status === "failed"
@@ -811,7 +811,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
{service.status}
</span>
</div>
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
{service.url ? (
<a
href={service.url}
@@ -826,7 +826,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
)}
</div>
</div>
- <div className="text-[10px] text-muted-foreground whitespace-nowrap">
+ <div className="text-(length:--text-nano) text-muted-foreground whitespace-nowrap">
{service.lifecycle}
</div>
</div>
@@ -928,7 +928,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
<TooltipTrigger asChild>
<button
type="button"
- className="inline-flex h-4 w-4 items-center justify-center rounded-full border border-border text-[10px] text-muted-foreground hover:text-foreground"
+ className="inline-flex h-4 w-4 items-center justify-center rounded-full border border-border text-(length:--text-nano) text-muted-foreground hover:text-foreground"
aria-label="Execution workspaces help"
>
?
@@ -974,7 +974,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
<span>New tasks default to isolated checkout</span>
<SaveIndicator state={fieldState("execution_workspace_default_mode")} />
</div>
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
If disabled, new tasks stay on the project's primary checkout unless someone opts in.
</div>
</div>
@@ -1158,7 +1158,7 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
placeholder="bash ./scripts/teardown-worktree.sh"
/>
</div>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Provision runs inside the derived worktree before agent execution. Teardown is stored here for
future cleanup flows.
</p>
diff --git a/ui/src/components/ProjectWorkspaceSummaryCard.tsx b/ui/src/components/ProjectWorkspaceSummaryCard.tsx
index 1dc968b8c4..fb6887ac15 100644
--- a/ui/src/components/ProjectWorkspaceSummaryCard.tsx
+++ b/ui/src/components/ProjectWorkspaceSummaryCard.tsx
@@ -59,7 +59,7 @@ export function ProjectWorkspaceSummaryCard({
<div className="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
<div className="min-w-0 space-y-2">
<div className="flex flex-wrap items-center gap-2">
- <span className="inline-flex items-center rounded-full border border-border bg-background px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <span className="inline-flex items-center rounded-full border border-border bg-background px-2.5 py-1 text-(length:--text-micro) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{workspaceKindLabel(summary.kind)}
</span>
<span className="inline-flex items-center rounded-full border border-border/70 bg-background px-2.5 py-1 text-xs text-muted-foreground">
@@ -149,7 +149,7 @@ export function ProjectWorkspaceSummaryCard({
<div className="flex items-start gap-2">
<GitBranch className="mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" />
<div className="min-w-0 flex-1">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">Branch</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Branch</div>
<div className="flex items-start gap-2">
<CopyText
text={summary.branchName}
@@ -176,7 +176,7 @@ export function ProjectWorkspaceSummaryCard({
<div className="flex items-start gap-2">
<FolderOpen className="mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" />
<div className="min-w-0 flex-1">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">Path</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Path</div>
<div className="flex items-start gap-2">
<CopyText
text={summary.cwd}
@@ -204,7 +204,7 @@ export function ProjectWorkspaceSummaryCard({
<div className="flex items-start gap-2">
<ExternalLink className="mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" />
<div className="min-w-0">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">Service</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Service</div>
<a
href={summary.primaryServiceUrl}
target="_blank"
@@ -226,7 +226,7 @@ export function ProjectWorkspaceSummaryCard({
{summary.issues.length > 0 ? (
<div className="space-y-2">
- <div className="text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Linked tasks
</div>
<div className="flex flex-wrap gap-2">
diff --git a/ui/src/components/ProjectWorkspacesContent.tsx b/ui/src/components/ProjectWorkspacesContent.tsx
index 02600d0a0f..f73c53aa10 100644
--- a/ui/src/components/ProjectWorkspacesContent.tsx
+++ b/ui/src/components/ProjectWorkspacesContent.tsx
@@ -76,7 +76,7 @@ export function ProjectWorkspacesContent({
</div>
{cleanupFailedSummaries.length > 0 ? (
<div className="space-y-2">
- <div className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Cleanup attention needed
</div>
<div className="space-y-3">
diff --git a/ui/src/components/PropertiesPanel.tsx b/ui/src/components/PropertiesPanel.tsx
index c289a3126e..d304a5ad23 100644
--- a/ui/src/components/PropertiesPanel.tsx
+++ b/ui/src/components/PropertiesPanel.tsx
@@ -10,10 +10,10 @@ export function PropertiesPanel() {
return (
<aside
- className="hidden md:flex border-l border-border bg-card flex-col shrink-0 overflow-hidden transition-[width,opacity] duration-200 ease-in-out h-full"
+ className="hidden md:flex border-l border-border bg-card flex-col shrink-0 overflow-hidden transition-(--tp-width-opacity) duration-200 ease-in-out h-full"
style={{ width: panelVisible ? 320 : 0, opacity: panelVisible ? 1 : 0 }}
>
- <div className="w-80 flex-1 flex flex-col min-w-[320px] min-h-0">
+ <div className="w-80 flex-1 flex flex-col min-w-(--sz-320px) min-h-0">
<div className="flex items-center justify-between px-4 py-2 border-b border-border">
<span className="text-sm font-medium">Properties</span>
<Button variant="ghost" size="icon-xs" onClick={() => setPanelVisible(false)}>
diff --git a/ui/src/components/ProviderQuotaCard.tsx b/ui/src/components/ProviderQuotaCard.tsx
index 21800bc1cd..bd20aedbe5 100644
--- a/ui/src/components/ProviderQuotaCard.tsx
+++ b/ui/src/components/ProviderQuotaCard.tsx
@@ -205,7 +205,7 @@ export function ProviderQuotaCard({
</div>
<div className="h-2 w-full border border-border overflow-hidden">
<div
- className="h-full bg-primary/60 transition-[width] duration-150"
+ className="h-full bg-primary/60 transition-(--tp-width) duration-150"
style={{ width: `${barPct}%` }}
/>
</div>
@@ -242,7 +242,7 @@ export function ProviderQuotaCard({
<>
<div className="h-1.5 w-full border border-border overflow-hidden">
<div
- className="h-full bg-primary/60 transition-[width] duration-150"
+ className="h-full bg-primary/60 transition-(--tp-width) duration-150"
style={{ width: `${subSharePct}%` }}
/>
</div>
@@ -272,7 +272,7 @@ export function ProviderQuotaCard({
<span className="text-xs text-muted-foreground truncate font-mono block">
{row.model}
</span>
- <span className="text-[11px] text-muted-foreground truncate block">
+ <span className="text-(length:--text-micro) text-muted-foreground truncate block">
{providerDisplayName(row.biller)} · {billingTypeDisplayName(row.billingType)}
</span>
</div>
@@ -286,13 +286,13 @@ export function ProviderQuotaCard({
{/* token share bar */}
<div className="relative h-2 w-full border border-border overflow-hidden">
<div
- className="absolute inset-y-0 left-0 bg-primary/60 transition-[width] duration-150"
+ className="absolute inset-y-0 left-0 bg-primary/60 transition-(--tp-width) duration-150"
style={{ width: `${tokenPct}%` }}
title={`${Math.round(tokenPct)}% of provider tokens`}
/>
{/* cost share overlay — narrower, opaque, shows relative cost weight */}
<div
- className="absolute inset-y-0 left-0 bg-primary/85 transition-[width] duration-150"
+ className="absolute inset-y-0 left-0 bg-primary/85 transition-(--tp-width) duration-150"
style={{ width: `${costPct}%` }}
title={`${Math.round(costPct)}% of provider cost`}
/>
@@ -314,7 +314,7 @@ export function ProviderQuotaCard({
Subscription quota
</p>
{quotaSource && !isClaudeQuotaPanel && !isCodexQuotaPanel ? (
- <span className="text-[10px] uppercase tracking-[0.16em] text-muted-foreground">
+ <span className="text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{quotaSourceDisplayName(quotaSource)}
</span>
) : null}
@@ -338,10 +338,10 @@ export function ProviderQuotaCard({
qw.usedPercent == null
? null
: qw.usedPercent >= 90
- ? "bg-red-400"
+ ? "bg-(--status-task-blocked)"
: qw.usedPercent >= 70
- ? "bg-yellow-400"
- : "bg-green-400";
+ ? "bg-(--status-task-todo)"
+ : "bg-(--status-task-done)";
return (
<div key={qw.label} className="space-y-1">
<div className="flex items-center justify-between gap-2 text-xs">
@@ -356,7 +356,7 @@ export function ProviderQuotaCard({
{qw.usedPercent != null && fillColor != null && (
<div className="h-2 w-full border border-border overflow-hidden">
<div
- className={`h-full transition-[width] duration-150 ${fillColor}`}
+ className={`h-full transition-(--tp-width) duration-150 ${fillColor}`}
style={{ width: `${qw.usedPercent}%` }}
/>
</div>
diff --git a/ui/src/components/QuotaBar.tsx b/ui/src/components/QuotaBar.tsx
index 89c25c6e82..0fcefde135 100644
--- a/ui/src/components/QuotaBar.tsx
+++ b/ui/src/components/QuotaBar.tsx
@@ -12,9 +12,9 @@ interface QuotaBarProps {
}
function fillColor(pct: number): string {
- if (pct > 90) return "bg-red-400";
- if (pct > 70) return "bg-yellow-400";
- return "bg-green-400";
+ if (pct > 90) return "bg-(--status-task-blocked)";
+ if (pct > 70) return "bg-(--status-task-todo)";
+ return "bg-(--status-task-done)";
}
export function QuotaBar({
@@ -47,7 +47,7 @@ export function QuotaBar({
{/* fill */}
<div
className={cn(
- "absolute inset-y-0 left-0 transition-[width,background-color] duration-150",
+ "absolute inset-y-0 left-0 transition-(--tp-width-background-color) duration-150",
fillColor(clampedPct),
)}
style={{ width: `${clampedPct}%` }}
@@ -55,7 +55,7 @@ export function QuotaBar({
{/* deficit notch — 2px wide, sits at the fill tip */}
{showDeficitNotch && clampedPct > 0 && (
<div
- className="absolute inset-y-0 w-[2px] bg-destructive z-10"
+ className="absolute inset-y-0 w-(--sz-2px) bg-destructive z-10"
style={{ left: `${notchLeft}%` }}
/>
)}
diff --git a/ui/src/components/ReusableExecutionWorkspaceSelect.tsx b/ui/src/components/ReusableExecutionWorkspaceSelect.tsx
index c2789ceecc..50cb278e1d 100644
--- a/ui/src/components/ReusableExecutionWorkspaceSelect.tsx
+++ b/ui/src/components/ReusableExecutionWorkspaceSelect.tsx
@@ -57,7 +57,7 @@ export function ReusableExecutionWorkspaceSelect<TWorkspace extends ReusableExec
renderOption={(option, { selected }) => (
<span className="flex min-w-0 flex-col">
<span className={cn("truncate", selected && "font-medium")}>{option.label}</span>
- <span className="truncate text-[11px] text-muted-foreground">
+ <span className="truncate text-(length:--text-micro) text-muted-foreground">
{option.workspace.status ? `${option.workspace.status} - ` : ""}
{option.description}
</span>
diff --git a/ui/src/components/RoutineHistoryTab.tsx b/ui/src/components/RoutineHistoryTab.tsx
index 35bd4cfb47..13bdc28a45 100644
--- a/ui/src/components/RoutineHistoryTab.tsx
+++ b/ui/src/components/RoutineHistoryTab.tsx
@@ -184,7 +184,7 @@ export function RoutineHistoryTab({
if (revisionsQuery.isLoading) {
return (
- <div className="grid gap-5 md:grid-cols-[300px_minmax(0,1fr)]">
+ <div className="grid gap-5 md:grid-cols-(--gtc-9)">
<div className="space-y-2">
{Array.from({ length: 5 }).map((_, idx) => (
<Skeleton key={idx} className="h-10 w-full" />
@@ -216,7 +216,7 @@ export function RoutineHistoryTab({
const onlyBootstrapRevision = revisions.length <= 1;
return (
- <div className="grid gap-5 md:grid-cols-[300px_minmax(0,1fr)]">
+ <div className="grid gap-5 md:grid-cols-(--gtc-9)">
<RevisionList
revisions={visibleRevisions}
latestRevisionId={routine.latestRevisionId}
@@ -335,7 +335,7 @@ function HistoricalPreviewBanner({
<div className="rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1">
- <p className="text-sm font-medium text-amber-200">
+ <p className="text-sm font-medium text-amber-800 dark:text-amber-200">
Viewing revision {revisionNumber} (read-only)
</p>
<p className="text-xs text-muted-foreground">
@@ -374,7 +374,7 @@ function ConflictBanner({
<div className="rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1">
- <p className="text-sm font-medium text-amber-200">Unsaved routine edits</p>
+ <p className="text-sm font-medium text-amber-800 dark:text-amber-200">Unsaved routine edits</p>
<p className="text-xs text-muted-foreground">
You changed {fieldsText} but haven&apos;t saved yet. Save or discard before previewing or
restoring an older revision.
@@ -427,10 +427,10 @@ function RevisionList({
return (
<aside className="space-y-1">
<header className="flex items-center justify-between pb-2">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Revisions
</p>
- <span className="text-[11px] text-muted-foreground">{totalRevisions} total</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">{totalRevisions} total</span>
</header>
{revisions.map((revision) => {
const isSelected = revision.id === selectedRevisionId;
@@ -460,12 +460,12 @@ function RevisionList({
<div className="flex items-center gap-2 text-sm font-medium">
<span>rev {revision.revisionNumber}</span>
{isCurrent && (
- <span className="rounded-full border border-border px-1.5 text-[10px] uppercase tracking-[0.12em] text-muted-foreground">
+ <span className="rounded-full border border-border px-1.5 text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Current
</span>
)}
{revision.restoredFromRevisionId && (
- <span className="rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 text-[10px] uppercase tracking-[0.12em] text-amber-200">
+ <span className="rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-amber-800 dark:text-amber-200">
Restored
</span>
)}
@@ -601,17 +601,17 @@ function RevisionPreview({
</header>
<div className={`${cardWrapper} p-3`}>
- <p className="pb-2 text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="pb-2 text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Structured fields
</p>
<div className="grid gap-3 md:grid-cols-2 divide-y md:divide-y-0 divide-border">
{fieldRows.map((row) => (
<div key={row.key} className="space-y-1 p-2">
- <p className="text-[11px] uppercase tracking-wide text-muted-foreground">{row.label}</p>
+ <p className="text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">{row.label}</p>
<p className="text-sm">
{row.value || <span className="text-muted-foreground">—</span>}
{row.differs && (
- <span className="ml-2 rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 text-[10px] uppercase tracking-[0.12em] text-amber-200">
+ <span className="ml-2 rounded-full border border-amber-500/40 bg-amber-500/10 px-1.5 text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-amber-800 dark:text-amber-200">
differs from current
</span>
)}
@@ -622,7 +622,7 @@ function RevisionPreview({
</div>
<div className={`${cardWrapper} p-3 space-y-2`}>
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Description
</p>
<div className="rounded-md bg-background/40 p-3 text-sm leading-7">
@@ -635,7 +635,7 @@ function RevisionPreview({
</div>
<div className={`${cardWrapper} p-3 space-y-2`}>
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Triggers ({triggers.length})
</p>
{triggers.length === 0 ? (
@@ -644,7 +644,7 @@ function RevisionPreview({
<ul className="divide-y divide-border">
{triggers.map((trigger) => (
<li key={trigger.id} className="py-2 flex flex-wrap items-center gap-2 text-sm">
- <span className="rounded-full border border-border px-2 py-0.5 text-[10px] uppercase tracking-[0.12em] text-muted-foreground">
+ <span className="rounded-full border border-border px-2 py-0.5 text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{trigger.kind}
</span>
<span className="font-medium">{trigger.label ?? trigger.kind}</span>
@@ -668,7 +668,7 @@ function RevisionPreview({
{snapshot.variables.length > 0 && (
<div className={`${cardWrapper} p-3 space-y-2`}>
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Variables ({snapshot.variables.length})
</p>
<ul className="divide-y divide-border">
@@ -738,7 +738,7 @@ function RestoreConfirmDialog({
Previous run history is preserved.
</li>
{recreatedWebhookLabels.map((label) => (
- <li key={label} className="flex items-start gap-2 text-amber-200">
+ <li key={label} className="flex items-start gap-2 text-amber-800 dark:text-amber-200">
<span className="mt-1 inline-block h-1.5 w-1.5 rounded-full bg-amber-400" />
The webhook trigger {label} will be recreated with a new URL and secret. Paperclip will
show the secret once after restore — copy it before closing.
@@ -818,7 +818,7 @@ function RoutineRevisionDiffModal({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="!max-w-[90%] w-full max-h-[85vh] overflow-hidden flex flex-col">
+ <DialogContent className="!max-w-(--pct-90) w-full max-h-(--sz-85vh) overflow-hidden flex flex-col">
<DialogHeader>
<DialogTitle>Compare routine revisions</DialogTitle>
</DialogHeader>
@@ -840,7 +840,7 @@ function RoutineRevisionDiffModal({
</div>
<div className="overflow-auto flex-1 space-y-4">
<section className="space-y-2">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Field changes
</p>
{fieldChanges.length === 0 ? (
@@ -858,10 +858,10 @@ function RoutineRevisionDiffModal({
{fieldChanges.map((change) => (
<tr key={change.field} className="border-t border-border/60">
<td className="px-3 py-2 align-top text-xs font-medium">{change.field}</td>
- <td className="px-3 py-2 align-top text-xs text-red-300">
+ <td className="px-3 py-2 align-top text-xs text-red-700 dark:text-red-300">
{change.oldValue ?? "—"}
</td>
- <td className="px-3 py-2 align-top text-xs text-emerald-300">
+ <td className="px-3 py-2 align-top text-xs text-emerald-700 dark:text-emerald-300">
{change.newValue ?? "—"}
</td>
</tr>
@@ -871,7 +871,7 @@ function RoutineRevisionDiffModal({
)}
</section>
<section className="space-y-2">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Description diff
</p>
<DiffTable rows={descriptionDiff} />
@@ -907,19 +907,19 @@ function RevisionPicker({
tone: "red" | "green";
}) {
const toneClass = tone === "red"
- ? "border-red-500/30 bg-red-500/10 text-red-300"
- : "border-green-500/30 bg-green-500/10 text-green-300";
+ ? "border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300"
+ : "border-green-500/30 bg-green-500/10 text-green-700 dark:text-green-300";
return (
<div className="flex items-center gap-2">
<span
- className={`rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider ${toneClass}`}
+ className={`rounded-full border px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wider ${toneClass}`}
>
{label}
</span>
<select
value={value}
onChange={(event) => onChange(event.target.value)}
- className="h-8 min-w-[12rem] rounded-md border border-border/60 bg-background px-2 text-xs"
+ className="h-8 min-w-(--sz-12rem) rounded-md border border-border/60 bg-background px-2 text-xs"
>
{revisions.map((revision) => (
<option key={revision.id} value={revision.id}>
@@ -941,8 +941,8 @@ function DiffTable({ rows }: { rows: DiffRow[] }) {
}
const lineClassesByKind: Record<DiffRow["kind"], string> = {
context: "bg-transparent",
- removed: "bg-red-500/10 text-red-100",
- added: "bg-green-500/10 text-green-100",
+ removed: "bg-red-500/10 text-red-900 dark:text-red-100",
+ added: "bg-green-500/10 text-green-900 dark:text-green-100",
};
const markerByKind: Record<DiffRow["kind"], string> = {
context: " ",
@@ -951,7 +951,7 @@ function DiffTable({ rows }: { rows: DiffRow[] }) {
};
return (
<div className="rounded-md border border-border text-xs font-mono leading-6 overflow-hidden">
- <div className="grid grid-cols-[56px_56px_24px_minmax(0,1fr)] border-b border-border/60 bg-muted/30 px-3 py-2 text-[11px] uppercase tracking-wide text-muted-foreground">
+ <div className="grid grid-cols-(--gtc-1) border-b border-border/60 bg-muted/30 px-3 py-2 text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">
<span>Old</span>
<span>New</span>
<span />
@@ -960,7 +960,7 @@ function DiffTable({ rows }: { rows: DiffRow[] }) {
{rows.map((row, index) => (
<div
key={`${row.kind}-${index}-${row.oldLineNumber ?? "x"}-${row.newLineNumber ?? "x"}`}
- className={`grid grid-cols-[56px_56px_24px_minmax(0,1fr)] gap-0 border-b border-border/30 px-3 ${lineClassesByKind[row.kind]}`}
+ className={`grid grid-cols-(--gtc-1) gap-0 border-b border-border/30 px-3 ${lineClassesByKind[row.kind]}`}
>
<span className="select-none border-r border-border/30 pr-3 text-right text-muted-foreground">
{row.oldLineNumber ?? ""}
diff --git a/ui/src/components/RoutineList.tsx b/ui/src/components/RoutineList.tsx
index 5c19bf524e..f2cf986cc5 100644
--- a/ui/src/components/RoutineList.tsx
+++ b/ui/src/components/RoutineList.tsx
@@ -118,7 +118,7 @@ export function RoutineListRow<TRoutine extends RoutineListRowItem>({
<span className="flex items-center gap-2">
<span
className="h-2.5 w-2.5 shrink-0 rounded-sm"
- style={{ backgroundColor: project?.color ?? "#64748b" }}
+ style={{ backgroundColor: project?.color ?? "var(--project-none)" }}
/>
<span>{routine.projectId ? (project?.name ?? "Unknown project") : "No project"}</span>
</span>
diff --git a/ui/src/components/RoutineRunVariablesDialog.test.tsx b/ui/src/components/RoutineRunVariablesDialog.test.tsx
index d2704b1a57..299be6c67b 100644
--- a/ui/src/components/RoutineRunVariablesDialog.test.tsx
+++ b/ui/src/components/RoutineRunVariablesDialog.test.tsx
@@ -322,9 +322,9 @@ describe("RoutineRunVariablesDialog", () => {
});
const dialogContent = Array.from(document.body.querySelectorAll("div")).find((element) =>
- typeof element.className === "string" && element.className.includes("max-h-[calc(100dvh-2rem)]"),
+ typeof element.className === "string" && element.className.includes("max-h-(--sz-calc-18)"),
);
- expect(dialogContent?.className).toContain("h-[calc(100dvh-2rem)]");
+ expect(dialogContent?.className).toContain("h-(--sz-calc-18)");
expect(dialogContent?.className).toContain("overflow-hidden");
const notesInput = document.querySelector("textarea");
@@ -337,7 +337,7 @@ describe("RoutineRunVariablesDialog", () => {
expect(formScrollRegion?.contains(notesInput)).toBe(true);
const footer = Array.from(document.body.querySelectorAll("div")).find((element) =>
- typeof element.className === "string" && element.className.includes("pb-[calc(1rem+env(safe-area-inset-bottom))]"),
+ typeof element.className === "string" && element.className.includes("pb-(--sz-calc-19)"),
);
expect(footer?.className).toContain("shrink-0");
expect(footer?.contains(formScrollRegion ?? null)).toBe(false);
diff --git a/ui/src/components/RoutineRunVariablesDialog.tsx b/ui/src/components/RoutineRunVariablesDialog.tsx
index 25449ec732..67f9f18864 100644
--- a/ui/src/components/RoutineRunVariablesDialog.tsx
+++ b/ui/src/components/RoutineRunVariablesDialog.tsx
@@ -339,7 +339,7 @@ export function RoutineRunVariablesDialog({
return (
<Dialog open={open} onOpenChange={(next) => !isPending && onOpenChange(next)}>
- <DialogContent className="flex h-[calc(100dvh-2rem)] max-h-[calc(100dvh-2rem)] max-w-xl flex-col gap-0 overflow-hidden p-0 sm:h-auto sm:max-h-[min(calc(100dvh-2rem),42rem)]">
+ <DialogContent className="flex h-(--sz-calc-18) max-h-(--sz-calc-18) max-w-xl flex-col gap-0 overflow-hidden p-0 sm:h-auto sm:max-h-(--sz-calc-20)">
<DialogHeader className="shrink-0 border-b border-border/60 px-6 pb-4 pr-12 pt-6">
{routineName && (
<p className="text-muted-foreground text-sm">{routineName}</p>
@@ -423,7 +423,7 @@ export function RoutineRunVariablesDialog({
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: selectedProject.color ?? "#64748b" }}
+ style={{ backgroundColor: selectedProject.color ?? "var(--project-none)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -438,7 +438,7 @@ export function RoutineRunVariablesDialog({
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: project?.color ?? "#64748b" }}
+ style={{ backgroundColor: project?.color ?? "var(--project-none)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -532,7 +532,7 @@ export function RoutineRunVariablesDialog({
<DialogFooter
showCloseButton={false}
- className="shrink-0 border-t border-border/60 bg-background px-6 pb-[calc(1rem+env(safe-area-inset-bottom))] pt-4"
+ className="shrink-0 border-t border-border/60 bg-background px-6 pb-(--sz-calc-19) pt-4"
>
{!selection.assigneeAgentId ? (
<p className="mr-auto text-xs text-amber-600">Default agent required for this run.</p>
diff --git a/ui/src/components/RoutineSaveBar.tsx b/ui/src/components/RoutineSaveBar.tsx
index 1a5b35ad76..5c7d2a5a8e 100644
--- a/ui/src/components/RoutineSaveBar.tsx
+++ b/ui/src/components/RoutineSaveBar.tsx
@@ -79,7 +79,7 @@ export function RoutineSaveBar({
)}
>
{saveConflict ? (
- <div className="flex items-center gap-2 text-sm text-amber-200">
+ <div className="flex items-center gap-2 text-sm text-amber-800 dark:text-amber-200">
<AlertTriangle className="h-4 w-4" />
<span>Routine changed elsewhere. Reload to merge.</span>
</div>
@@ -154,7 +154,7 @@ export function RoutineSaveBar({
>
{isSaving ? <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" /> : null}
Save changes
- <kbd className="ml-2 hidden rounded bg-foreground/10 px-1 text-[10px] font-medium sm:inline">
+ <kbd className="ml-2 hidden rounded bg-foreground/10 px-1 text-(length:--text-nano) font-medium sm:inline">
⌘S
</kbd>
</Button>
diff --git a/ui/src/components/RoutineSubSidebar.tsx b/ui/src/components/RoutineSubSidebar.tsx
index 13da728f94..893e5587d5 100644
--- a/ui/src/components/RoutineSubSidebar.tsx
+++ b/ui/src/components/RoutineSubSidebar.tsx
@@ -110,11 +110,11 @@ export function RoutineSubSidebar({
return (
<nav
aria-label="Routine sections"
- className="sticky top-0 hidden max-h-[100dvh] w-52 shrink-0 flex-col gap-4 self-start overflow-y-auto border-r border-border bg-sidebar/30 px-3 py-4 md:flex"
+ className="sticky top-0 hidden max-h-(--sz-100dvh) w-52 shrink-0 flex-col gap-4 self-start overflow-y-auto border-r border-border bg-sidebar/30 px-3 py-4 md:flex"
>
{NAV_GROUPS.map((group) => (
<div key={group.label} className="flex flex-col gap-0.5">
- <p className="px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground/80">
+ <p className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground/80">
{group.label}
</p>
{group.items.map((item) => {
@@ -189,7 +189,7 @@ export function RoutineSectionPicker({
<SelectContent>
{NAV_GROUPS.map((group) => (
<SelectGroup key={group.label}>
- <SelectLabel className="uppercase tracking-[0.12em] text-[11px]">
+ <SelectLabel className="uppercase tracking-(--tracking-eyebrow) text-(length:--text-micro)">
{group.label}
</SelectLabel>
{group.items.map((item) => (
diff --git a/ui/src/components/RoutineVariablesEditor.tsx b/ui/src/components/RoutineVariablesEditor.tsx
index 3965cd296a..f8bd71b797 100644
--- a/ui/src/components/RoutineVariablesEditor.tsx
+++ b/ui/src/components/RoutineVariablesEditor.tsx
@@ -298,7 +298,7 @@ export function RoutineVariablesHint() {
<div className="space-y-5 text-sm">
<section className="space-y-2">
- <h3 className="text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <h3 className="text-xs font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Custom variables
</h3>
<p className="text-muted-foreground">
@@ -319,7 +319,7 @@ export function RoutineVariablesHint() {
</section>
<section className="space-y-2">
- <h3 className="text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <h3 className="text-xs font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Built-in variables
</h3>
<p className="text-muted-foreground">
diff --git a/ui/src/components/ScheduleEditor.tsx b/ui/src/components/ScheduleEditor.tsx
index 12331ae458..bd542d2664 100644
--- a/ui/src/components/ScheduleEditor.tsx
+++ b/ui/src/components/ScheduleEditor.tsx
@@ -300,7 +300,7 @@ export function ScheduleEditor({
emitChange(preset, h, minute, dayOfWeek, dayOfMonth, customCron);
}}
>
- <SelectTrigger className="w-[120px]">
+ <SelectTrigger className="w-(--sz-120px)">
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -319,7 +319,7 @@ export function ScheduleEditor({
emitChange(preset, hour, m, dayOfWeek, dayOfMonth, customCron);
}}
>
- <SelectTrigger className="w-[80px]">
+ <SelectTrigger className="w-(--sz-80px)">
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -343,7 +343,7 @@ export function ScheduleEditor({
emitChange(preset, hour, m, dayOfWeek, dayOfMonth, customCron);
}}
>
- <SelectTrigger className="w-[80px]">
+ <SelectTrigger className="w-(--sz-80px)">
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -391,7 +391,7 @@ export function ScheduleEditor({
emitChange(preset, hour, minute, dayOfWeek, dom, customCron);
}}
>
- <SelectTrigger className="w-[80px]">
+ <SelectTrigger className="w-(--sz-80px)">
<SelectValue />
</SelectTrigger>
<SelectContent>
diff --git a/ui/src/components/ScrollToBottom.tsx b/ui/src/components/ScrollToBottom.tsx
index 793e85a043..5bf928ae56 100644
--- a/ui/src/components/ScrollToBottom.tsx
+++ b/ui/src/components/ScrollToBottom.tsx
@@ -74,8 +74,8 @@ export function ScrollToBottom() {
<button
onClick={scroll}
className={cn(
- "fixed bottom-[calc(1.5rem+5rem+env(safe-area-inset-bottom))] right-6 z-40 flex h-9 w-9 items-center justify-center rounded-full border border-border bg-background shadow-md hover:bg-accent transition-[background-color,right] duration-200 md:bottom-6",
- panelVisible && panelContent && "md:right-[calc(320px+1.5rem)]",
+ "fixed bottom-(--sz-calc-21) right-6 z-40 flex h-9 w-9 items-center justify-center rounded-full border border-border bg-background shadow-md hover:bg-accent transition-(--tp-background-color-right) duration-200 md:bottom-6",
+ panelVisible && panelContent && "md:right-(--sz-calc-22)",
)}
aria-label="Scroll to bottom"
>
diff --git a/ui/src/components/SearchableSelect.tsx b/ui/src/components/SearchableSelect.tsx
index a827f5cbde..cad44cacf9 100644
--- a/ui/src/components/SearchableSelect.tsx
+++ b/ui/src/components/SearchableSelect.tsx
@@ -231,8 +231,8 @@ export function SearchableSelect<
className={cn(
"p-0",
contentWidth === "trigger"
- ? "w-[var(--radix-popover-trigger-width)] min-w-56 max-w-[min(32rem,calc(100vw-2rem))]"
- : "w-72 max-w-[min(32rem,calc(100vw-2rem))]",
+ ? "w-(--radix-popover-trigger-width) min-w-56 max-w-(--sz-calc-23)"
+ : "w-72 max-w-(--sz-calc-23)",
contentClassName,
)}
onKeyDownCapture={(event) => {
diff --git a/ui/src/components/SecretBindingPicker.tsx b/ui/src/components/SecretBindingPicker.tsx
index f3b7863c0b..1bf33d19d3 100644
--- a/ui/src/components/SecretBindingPicker.tsx
+++ b/ui/src/components/SecretBindingPicker.tsx
@@ -131,7 +131,7 @@ export function SecretBindingPicker({
{value ? (
<button
type="button"
- className="text-[11px] text-muted-foreground hover:text-foreground inline-flex items-center gap-1"
+ className="text-(length:--text-micro) text-muted-foreground hover:text-foreground inline-flex items-center gap-1"
onClick={() => onChange(null)}
disabled={disabled}
>
@@ -210,17 +210,17 @@ export function SecretBindingPicker({
</div>
{selectedSecret ? (
- <p className={cn("text-[11px] text-muted-foreground", statusTone(selectedSecret.status))}>
+ <p className={cn("text-(length:--text-micro) text-muted-foreground", statusTone(selectedSecret.status))}>
{selectedSecret.status !== "active" ? `Status: ${selectedSecret.status}. ` : null}
Bound to {versionDisplay(value?.version)} · {selectedSecret.key}
</p>
) : selectedMissing ? (
- <p className="text-[11px] text-destructive flex items-center gap-1">
+ <p className="text-(length:--text-micro) text-destructive flex items-center gap-1">
<AlertCircle className="h-3 w-3" />
The previously selected secret is no longer available. Pick another or remove the binding.
</p>
) : (filteredSecrets.length === 0 && !secretsQuery.isPending) ? (
- <p className="text-[11px] text-muted-foreground">{emptyHint}</p>
+ <p className="text-(length:--text-micro) text-muted-foreground">{emptyHint}</p>
) : null}
<Dialog open={createOpen} onOpenChange={setCreateOpen}>
@@ -249,7 +249,7 @@ export function SecretBindingPicker({
placeholder="Paste the secret value"
className="font-mono text-xs"
/>
- <p className="text-[11px] text-muted-foreground mt-1">
+ <p className="text-(length:--text-micro) text-muted-foreground mt-1">
The value is stored once and never re-displayed. Rotate to replace.
</p>
</div>
diff --git a/ui/src/components/Sidebar.tsx b/ui/src/components/Sidebar.tsx
index 1cb871b51d..46d86fad47 100644
--- a/ui/src/components/Sidebar.tsx
+++ b/ui/src/components/Sidebar.tsx
@@ -145,7 +145,7 @@ export function Sidebar() {
onClick={() => openNewIssue()}
data-slot="icon-button"
aria-label={rail ? "New Task" : undefined}
- className="flex items-center gap-2.5 px-3 py-2 pointer-coarse:py-1.5 text-[13px] font-medium text-foreground/80 hover:bg-accent/50 hover:text-foreground transition-colors"
+ className="flex items-center gap-2.5 px-3 py-2 pointer-coarse:py-1.5 text-(length:--text-compact) font-medium text-foreground/80 hover:bg-accent/50 hover:text-foreground transition-colors"
>
<SquarePen className="h-4 w-4 shrink-0" />
<span className={rail ? SIDEBAR_RAIL_HIDDEN_LABEL : "truncate"}>New Task</span>
@@ -197,14 +197,14 @@ export function Sidebar() {
slotTypes={["sidebar"]}
context={pluginContext}
className="flex flex-col gap-0.5"
- itemClassName="text-[13px] font-medium"
+ itemClassName="text-(length:--text-compact) font-medium"
missingBehavior="placeholder"
/>
<PluginLauncherOutlet
placementZones={["sidebar"]}
context={pluginContext}
className="flex flex-col gap-0.5"
- itemClassName="text-[13px] font-medium"
+ itemClassName="text-(length:--text-compact) font-medium"
/>
</SidebarSection>
diff --git a/ui/src/components/SidebarAccountMenu.test.tsx b/ui/src/components/SidebarAccountMenu.test.tsx
index 6de098f091..12484b5aa3 100644
--- a/ui/src/components/SidebarAccountMenu.test.tsx
+++ b/ui/src/components/SidebarAccountMenu.test.tsx
@@ -130,7 +130,7 @@ describe("SidebarAccountMenu", () => {
expect(document.body.textContent).toContain("Paperclip v1.2.3");
expect(document.body.textContent).toContain("[email protected]");
expect(document.body.querySelector('[data-slot="popover-content"]')?.className)
- .toContain("w-[277px]");
+ .toContain("w-(--sz-277px)");
expect(document.body.querySelector('a[href="/company/settings/instance/profile"]')).not.toBeNull();
await act(async () => {
diff --git a/ui/src/components/SidebarAccountMenu.tsx b/ui/src/components/SidebarAccountMenu.tsx
index c28ca55999..769c749dc4 100644
--- a/ui/src/components/SidebarAccountMenu.tsx
+++ b/ui/src/components/SidebarAccountMenu.tsx
@@ -144,7 +144,7 @@ export function SidebarAccountMenu({
<PopoverTrigger asChild>
<button
type="button"
- className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-[13px] font-medium text-foreground/80 transition-colors hover:bg-accent/50 hover:text-foreground"
+ className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-(length:--text-compact) font-medium text-foreground/80 transition-colors hover:bg-accent/50 hover:text-foreground"
aria-label="Open account menu"
>
<Avatar size="sm">
@@ -158,9 +158,9 @@ export function SidebarAccountMenu({
side="top"
align="start"
sideOffset={10}
- className="w-[277px] max-w-[calc(100vw-1rem)] overflow-hidden rounded-t-2xl rounded-b-none border-border p-0 shadow-2xl"
+ className="w-(--sz-277px) max-w-(--sz-calc-24) overflow-hidden rounded-t-2xl rounded-b-none border-border p-0 shadow-2xl"
>
- <div className="h-24 bg-[linear-gradient(135deg,hsl(var(--primary))_0%,hsl(var(--accent))_55%,hsl(var(--muted))_100%)]" />
+ <div className="h-24 bg-(image:--gradient-extract-25)" />
<div className="-mt-8 px-4 pb-4">
<div className="flex items-start gap-3">
<div className="rounded-2xl border-4 border-popover bg-popover p-0.5 shadow-sm">
@@ -172,7 +172,7 @@ export function SidebarAccountMenu({
<div className="min-w-0 flex-1 pt-1">
<div className="flex items-center gap-2">
<h2 className="truncate text-base font-semibold text-foreground">{displayName}</h2>
- <span className="rounded-full bg-accent px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <span className="rounded-full bg-accent px-2 py-0.5 text-(length:--text-nano) font-semibold uppercase tracking-wide text-muted-foreground">
{accountBadge}
</span>
</div>
diff --git a/ui/src/components/SidebarAgents.tsx b/ui/src/components/SidebarAgents.tsx
index f0b0ac89d0..2b0db3702f 100644
--- a/ui/src/components/SidebarAgents.tsx
+++ b/ui/src/components/SidebarAgents.tsx
@@ -155,7 +155,7 @@ function SidebarAgentItem({
if (isMobile) setSidebarOpen(false);
}}
className={cn(
- "flex min-w-0 flex-1 items-center gap-2.5 px-3 py-1.5 pointer-coarse:py-1 text-[13px] font-medium transition-colors",
+ "flex min-w-0 flex-1 items-center gap-2.5 px-3 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium transition-colors",
// Reserve room for the ⋯ menu, plus the inline unstar star on starred rows.
starred && !isMobile ? "pr-14" : "pr-8",
isActive
@@ -180,7 +180,7 @@ function SidebarAgentItem({
</span>
) : null}
{runCount > 0 ? (
- <span className="text-[11px] font-medium text-blue-600 dark:text-blue-400">
+ <span className="text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400">
{runCount} live
</span>
) : null}
@@ -580,7 +580,7 @@ export function SidebarAgents({ streamlined = false }: { streamlined?: boolean }
onClick={() => {
if (isMobile) setSidebarOpen(false);
}}
- className="flex items-center gap-2.5 px-3 py-1.5 pointer-coarse:py-1 text-[13px] font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"
+ className="flex items-center gap-2.5 px-3 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"
>
<Users className="shrink-0 h-3.5 w-3.5" />
<span className={rail ? SIDEBAR_RAIL_HIDDEN_LABEL : undefined}>See all agents</span>
diff --git a/ui/src/components/SidebarCompanyMenu.tsx b/ui/src/components/SidebarCompanyMenu.tsx
index 3177c62356..75da3d1cd2 100644
--- a/ui/src/components/SidebarCompanyMenu.tsx
+++ b/ui/src/components/SidebarCompanyMenu.tsx
@@ -51,7 +51,7 @@ function WorkspaceIcon({ company }: { company: Company }) {
companyName={company.name}
logoUrl={company.logoUrl}
brandColor={company.brandColor}
- className="size-5 shrink-0 rounded-md text-[11px]"
+ className="size-5 shrink-0 rounded-md text-(length:--text-micro)"
/>
);
}
@@ -106,7 +106,7 @@ function SortableCompanyItem({
type="button"
ref={setActivatorNodeRef}
aria-label={`Reorder ${company.name}`}
- className="inline-flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring"
+ className="inline-flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-(length:--rad-2) focus-visible:ring-ring"
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
@@ -118,7 +118,7 @@ function SortableCompanyItem({
</button>
) : (
<>
- <span className="shrink-0 rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground">
+ <span className="shrink-0 rounded bg-muted px-1.5 py-0.5 font-mono text-(length:--text-nano) text-muted-foreground">
{company.issuePrefix}
</span>
{isSelected ? <Check className="size-4 text-muted-foreground" /> : null}
@@ -244,7 +244,7 @@ export function SidebarCompanyMenu({ open: controlledOpen, onOpenChange }: Sideb
</DropdownMenuTrigger>
<DropdownMenuContent align="start" sideOffset={8} className="w-64 p-1">
<div className="flex items-center justify-between gap-2 px-2 py-1.5">
- <DropdownMenuLabel className="p-0 text-[11px] font-semibold uppercase text-muted-foreground">
+ <DropdownMenuLabel className="p-0 text-(length:--text-micro) font-semibold uppercase text-muted-foreground">
Switch company
</DropdownMenuLabel>
<button
@@ -254,7 +254,7 @@ export function SidebarCompanyMenu({ open: controlledOpen, onOpenChange }: Sideb
event.stopPropagation();
setIsEditingOrder((current) => !current);
}}
- className="rounded px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
+ className="rounded px-1.5 py-0.5 text-(length:--text-micro) font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
{isEditingOrder ? "Done" : "Edit"}
</button>
diff --git a/ui/src/components/SidebarNavItem.tsx b/ui/src/components/SidebarNavItem.tsx
index 5aaf41037e..f3464cebab 100644
--- a/ui/src/components/SidebarNavItem.tsx
+++ b/ui/src/components/SidebarNavItem.tsx
@@ -97,7 +97,7 @@ export function SidebarNavItem({
onClick={() => { if (isMobile) setSidebarOpen(false); }}
className={({ isActive }) =>
cn(
- "flex items-center gap-2.5 px-3 py-2 pointer-coarse:py-1.5 text-[13px] font-medium transition-colors",
+ "flex items-center gap-2.5 px-3 py-2 pointer-coarse:py-1.5 text-(length:--text-compact) font-medium transition-colors",
isActive
? "bg-accent text-foreground"
: "text-foreground/80 hover:bg-accent/50 hover:text-foreground",
@@ -108,20 +108,20 @@ export function SidebarNavItem({
<span className="relative shrink-0">
<Icon className="h-4 w-4" />
{alert && (
- <span className="absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-red-500 shadow-[0_0_0_2px_hsl(var(--background))]" aria-hidden="true" />
+ <span className="absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-red-500 shadow-(--shadow-extract-12)" aria-hidden="true" />
)}
{/* Collapsed rail: numeric badge / live count collapse to a dot on the
icon. The icon markup is untouched so it stays pixel-aligned. */}
{rail && !alert && hasLive && (
<span className="absolute -right-0.5 -top-0.5 flex h-2 w-2" aria-hidden="true">
<span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
- <span className="relative inline-flex h-2 w-2 rounded-full bg-blue-500 shadow-[0_0_0_2px_hsl(var(--background))]" />
+ <span className="relative inline-flex h-2 w-2 rounded-full bg-blue-500 shadow-(--shadow-extract-12)" />
</span>
)}
{rail && !alert && !hasLive && hasBadge && (
<span
className={cn(
- "absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full shadow-[0_0_0_2px_hsl(var(--background))]",
+ "absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full shadow-(--shadow-extract-12)",
badgeTone === "danger" ? "bg-red-600" : "bg-primary",
)}
aria-hidden="true"
@@ -132,7 +132,7 @@ export function SidebarNavItem({
{!rail && textBadge && (
<span
className={cn(
- "ml-auto rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none",
+ "ml-auto rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium leading-none",
textBadgeTone === "amber"
? "bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400"
: "bg-muted text-muted-foreground",
@@ -147,7 +147,7 @@ export function SidebarNavItem({
<span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500" />
</span>
- <span className="text-[11px] font-medium text-blue-600 dark:text-blue-400">{liveCount} live</span>
+ <span className="text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400">{liveCount} live</span>
</span>
)}
{!rail && hasBadge && (
diff --git a/ui/src/components/SidebarProjects.tsx b/ui/src/components/SidebarProjects.tsx
index 8351a13d23..100cc8bed2 100644
--- a/ui/src/components/SidebarProjects.tsx
+++ b/ui/src/components/SidebarProjects.tsx
@@ -138,7 +138,7 @@ function ProjectItem({
if (isMobile) setSidebarOpen(false);
}}
className={cn(
- "flex min-w-0 flex-1 items-center gap-2.5 px-3 py-1.5 pr-8 pointer-coarse:py-1 text-[13px] font-medium transition-colors",
+ "flex min-w-0 flex-1 items-center gap-2.5 px-3 py-1.5 pr-8 pointer-coarse:py-1 text-(length:--text-compact) font-medium transition-colors",
activeProjectRef === routeRef || activeProjectRef === project.id
? "bg-accent text-foreground"
: "text-foreground/80 hover:bg-accent/50 hover:text-foreground",
diff --git a/ui/src/components/SidebarSection.tsx b/ui/src/components/SidebarSection.tsx
index d277755f23..34c7f8d8bc 100644
--- a/ui/src/components/SidebarSection.tsx
+++ b/ui/src/components/SidebarSection.tsx
@@ -74,7 +74,7 @@ function SidebarSectionHeader({
const hasMenu = Boolean(
menu && ((menu.actions?.length ?? 0) > 0 || (menu.radioChoices?.length ?? 0) > 0),
);
- const labelClassName = "text-[10px] font-medium uppercase tracking-widest font-mono text-muted-foreground/60";
+ const labelClassName = "text-(length:--text-nano) font-medium uppercase tracking-widest font-mono text-muted-foreground/60";
const headerControlVisibilityClassName = isMobile
? "opacity-100"
: "opacity-0 group-hover/sidebar-section:opacity-100 group-focus-within/sidebar-section:opacity-100";
diff --git a/ui/src/components/SidebarServerInfo.tsx b/ui/src/components/SidebarServerInfo.tsx
index 88e845adfe..1eade29fc7 100644
--- a/ui/src/components/SidebarServerInfo.tsx
+++ b/ui/src/components/SidebarServerInfo.tsx
@@ -123,7 +123,7 @@ export function SidebarServerInfo() {
return (
<div className="mt-2 border-t border-border pt-2">
- <p className="px-3 pb-1 pt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
+ <p className="px-3 pb-1 pt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">
Server
</p>
<ServerInfoRow
diff --git a/ui/src/components/SidebarShell.test.tsx b/ui/src/components/SidebarShell.test.tsx
index b423f15cf1..f15a1ab596 100644
--- a/ui/src/components/SidebarShell.test.tsx
+++ b/ui/src/components/SidebarShell.test.tsx
@@ -195,7 +195,7 @@ describe("SidebarShell", () => {
// Open/close must be instant: the panel never animates its width, so neither
// the transition nor its reduced-motion fallback should be present.
- expect(panel().className).not.toContain("transition-[width]");
+ expect(panel().className).not.toContain("transition-(--tp-width)");
expect(panel().className).not.toContain("motion-reduce:transition-none");
});
});
diff --git a/ui/src/components/SidebarStarredProjects.tsx b/ui/src/components/SidebarStarredProjects.tsx
index 85e1603d74..1b0925666e 100644
--- a/ui/src/components/SidebarStarredProjects.tsx
+++ b/ui/src/components/SidebarStarredProjects.tsx
@@ -121,7 +121,7 @@ export function SidebarStarredProjects() {
if (isMobile) setSidebarOpen(false);
}}
className={cn(
- "flex min-w-0 flex-1 items-center gap-2.5 px-3 py-1.5 pl-8 pointer-coarse:py-1 pr-8 text-[13px] font-medium transition-colors",
+ "flex min-w-0 flex-1 items-center gap-2.5 px-3 py-1.5 pl-8 pointer-coarse:py-1 pr-8 text-(length:--text-compact) font-medium transition-colors",
isActive
? "bg-accent text-foreground"
: "text-foreground/80 hover:bg-accent/50 hover:text-foreground",
diff --git a/ui/src/components/SourceResolvedFoldBadge.tsx b/ui/src/components/SourceResolvedFoldBadge.tsx
index 177314aed4..b8d24e2687 100644
--- a/ui/src/components/SourceResolvedFoldBadge.tsx
+++ b/ui/src/components/SourceResolvedFoldBadge.tsx
@@ -16,7 +16,7 @@ export function SourceResolvedFoldBadge({
return (
<span
className={cn(
- "inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium",
+ "inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
"border-emerald-300/60 bg-emerald-50/80 text-emerald-900",
"dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-200",
className,
diff --git a/ui/src/components/SourceResolvedFoldCallout.tsx b/ui/src/components/SourceResolvedFoldCallout.tsx
index c25c55a258..94186dcf2f 100644
--- a/ui/src/components/SourceResolvedFoldCallout.tsx
+++ b/ui/src/components/SourceResolvedFoldCallout.tsx
@@ -34,8 +34,8 @@ function MetaRow({
children: React.ReactNode;
}) {
return (
- <div className="grid grid-cols-[10rem_1fr] gap-x-3 gap-y-0 py-1 text-xs sm:grid-cols-[12rem_1fr]">
- <dt className="truncate text-[11px] font-medium uppercase tracking-[0.08em] text-emerald-900/70 dark:text-emerald-200/70">
+ <div className="grid grid-cols-(--gtc-10) gap-x-3 gap-y-0 py-1 text-xs sm:grid-cols-(--gtc-11)">
+ <dt className="truncate text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-emerald-900/70 dark:text-emerald-200/70">
{label}
</dt>
<dd className="min-w-0 break-words text-emerald-950 dark:text-emerald-100">{children}</dd>
@@ -63,7 +63,7 @@ export function SourceResolvedFoldCallout({
aria-label="Source-resolved watchdog fold"
data-source-resolved-fold
className={cn(
- "relative w-full overflow-hidden rounded-lg border text-sm shadow-[0_1px_0_rgba(15,23,42,0.02)]",
+ "relative w-full overflow-hidden rounded-lg border text-sm shadow-(--shadow-extract-8)",
"border-emerald-300/70 bg-emerald-50/80 text-emerald-950",
"dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100",
className,
@@ -80,7 +80,7 @@ export function SourceResolvedFoldCallout({
<Sparkles className="h-4 w-4 text-emerald-700 dark:text-emerald-300" />
</span>
<div className="min-w-0 flex-1">
- <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] font-semibold uppercase tracking-[0.14em]">
+ <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow)">
<span className="text-emerald-900 dark:text-emerald-200">SOURCE-RESOLVED FOLD</span>
<span className="text-muted-foreground/60" aria-hidden>·</span>
<span className="font-medium normal-case tracking-normal text-muted-foreground">
@@ -95,7 +95,7 @@ export function SourceResolvedFoldCallout({
</>
) : null}
</div>
- <p className="mt-1 text-[14px] leading-6">
+ <p className="mt-1 text-sm leading-6">
This run was folded as a source-resolved false positive.
</p>
</div>
@@ -115,24 +115,24 @@ export function SourceResolvedFoldCallout({
>
{sourceLabel}
</Link>
- <span className="rounded-md border border-emerald-300/60 bg-background/60 px-1.5 py-0.5 text-[11px] font-medium text-emerald-900 dark:border-emerald-500/30 dark:text-emerald-200">
+ <span className="rounded-md border border-emerald-300/60 bg-background/60 px-1.5 py-0.5 text-(length:--text-micro) font-medium text-emerald-900 dark:border-emerald-500/30 dark:text-emerald-200">
{fold.sourceIssueStatus}
</span>
</span>
</MetaRow>
<MetaRow label="Same-run evidence">
<span className="inline-flex flex-wrap items-baseline gap-1.5">
- <span className="rounded bg-background/70 px-1.5 py-0.5 font-mono text-[11px] text-emerald-900 dark:bg-background/40 dark:text-emerald-100">
+ <span className="rounded bg-background/70 px-1.5 py-0.5 font-mono text-(length:--text-micro) text-emerald-900 dark:bg-background/40 dark:text-emerald-100">
{fold.sameRunEvidenceKind}
</span>
<code
- className="rounded bg-background/70 px-1.5 py-0.5 font-mono text-[11px] text-emerald-900 dark:bg-background/40 dark:text-emerald-100"
+ className="rounded bg-background/70 px-1.5 py-0.5 font-mono text-(length:--text-micro) text-emerald-900 dark:bg-background/40 dark:text-emerald-100"
title={fold.sameRunEvidenceId}
>
{evidenceShort}
</code>
{evidenceAt ? (
- <span className="text-[11px] text-muted-foreground">at {evidenceAt}</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">at {evidenceAt}</span>
) : null}
</span>
</MetaRow>
diff --git a/ui/src/components/SourceTrustBadge.tsx b/ui/src/components/SourceTrustBadge.tsx
index 4fbaba71cb..18da1b7664 100644
--- a/ui/src/components/SourceTrustBadge.tsx
+++ b/ui/src/components/SourceTrustBadge.tsx
@@ -29,7 +29,7 @@ export function SourceTrustBadge({
variant="outline"
aria-label={label}
className={cn(
- "inline-flex items-center gap-1 whitespace-nowrap px-1.5 py-0 text-[10px] font-medium tracking-normal",
+ "inline-flex items-center gap-1 whitespace-nowrap px-1.5 py-0 text-(length:--text-nano) font-medium tracking-normal",
promoted
? "border-border text-muted-foreground"
: "border-amber-500/40 text-amber-700 dark:text-amber-100",
diff --git a/ui/src/components/StatusBadge.tsx b/ui/src/components/StatusBadge.tsx
index 774f265d99..6b121b6696 100644
--- a/ui/src/components/StatusBadge.tsx
+++ b/ui/src/components/StatusBadge.tsx
@@ -67,7 +67,7 @@ export function AgentStatusCapsule({ status }: { status: string }) {
return (
<span
aria-hidden
- className={cn("status-fill inline-block h-4 w-2 rounded-[4px] shrink-0", motion)}
+ className={cn("status-fill inline-block h-4 w-2 rounded-(--rad-4) shrink-0", motion)}
style={scStyle(cssVar)}
/>
);
diff --git a/ui/src/components/SystemNotice.tsx b/ui/src/components/SystemNotice.tsx
index 093c5667b7..343c397694 100644
--- a/ui/src/components/SystemNotice.tsx
+++ b/ui/src/components/SystemNotice.tsx
@@ -113,8 +113,8 @@ function formatTimestamp(ts: string) {
function MetadataRow({ row, tone }: { row: SystemNoticeMetadataRow; tone: ToneTokens }) {
return (
- <div className="grid grid-cols-[7.5rem_1fr] gap-x-3 gap-y-0.5 px-3 py-1.5 text-xs">
- <div className="truncate text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground">
+ <div className="grid grid-cols-(--gtc-8) gap-x-3 gap-y-0.5 px-3 py-1.5 text-xs">
+ <div className="truncate text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-muted-foreground">
{row.label}
</div>
<div className="min-w-0 break-words text-foreground/90">
@@ -124,7 +124,7 @@ function MetadataRow({ row, tone }: { row: SystemNoticeMetadataRow; tone: ToneTo
return <span>{row.value}</span>;
case "code":
return (
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground/80">
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-(length:--text-micro) text-foreground/80">
{row.value}
</code>
);
@@ -187,14 +187,14 @@ function MetadataRow({ row, tone }: { row: SystemNoticeMetadataRow; tone: ToneTo
return (
<a
href={row.href}
- className="inline-flex items-center gap-2 rounded-sm font-mono text-[11px] underline-offset-2 hover:underline"
+ className="inline-flex items-center gap-2 rounded-sm font-mono text-(length:--text-micro) underline-offset-2 hover:underline"
>
{inner}
</a>
);
}
return (
- <span className="inline-flex items-center gap-2 font-mono text-[11px]">
+ <span className="inline-flex items-center gap-2 font-mono text-(length:--text-micro)">
{inner}
</span>
);
@@ -236,7 +236,7 @@ export function SystemNotice({
role="status"
aria-label={resolvedLabel}
className={cn(
- "relative w-full overflow-hidden rounded-lg border text-sm shadow-[0_1px_0_rgba(15,23,42,0.02)]",
+ "relative w-full overflow-hidden rounded-lg border text-sm shadow-(--shadow-extract-8)",
tokens.container,
className,
)}
@@ -252,7 +252,7 @@ export function SystemNotice({
<ToneIcon className={cn("h-4 w-4", tokens.iconClass)} />
</span>
<div className="min-w-0 flex-1">
- <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] font-semibold uppercase tracking-[0.14em]">
+ <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow)">
<span className={tokens.label}>{resolvedLabel}</span>
{source ? (
<>
@@ -280,7 +280,7 @@ export function SystemNotice({
</>
) : null}
</div>
- <div className="mt-1 break-words text-[14px] leading-6 text-foreground">{body}</div>
+ <div className="mt-1 break-words text-sm leading-6 text-foreground">{body}</div>
</div>
{hasDetails ? (
<button
@@ -289,7 +289,7 @@ export function SystemNotice({
aria-expanded={open}
aria-controls={detailsId}
className={cn(
- "ml-1 inline-flex h-7 shrink-0 items-center gap-1 rounded-md border border-transparent px-2 text-[11px] font-medium uppercase tracking-[0.12em] text-muted-foreground transition-[background-color,border-color,color]",
+ "ml-1 inline-flex h-7 shrink-0 items-center gap-1 rounded-md border border-transparent px-2 text-(length:--text-micro) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground transition-(--tp-background-color-border-color-color)",
"hover:border-border/70 hover:bg-background/70 hover:text-foreground",
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
)}
@@ -316,7 +316,7 @@ export function SystemNotice({
{metadata!.map((section, sectionIdx) => (
<div key={sectionIdx} className="py-1.5 first:pt-2 last:pb-2">
{section.title ? (
- <div className="px-3 pb-1 pt-0.5 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="px-3 pb-1 pt-0.5 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{section.title}
</div>
) : null}
diff --git a/ui/src/components/ToastViewport.tsx b/ui/src/components/ToastViewport.tsx
index c79a3b4b12..3abdc20b13 100644
--- a/ui/src/components/ToastViewport.tsx
+++ b/ui/src/components/ToastViewport.tsx
@@ -40,7 +40,7 @@ function AnimatedToast({
return (
<li
className={cn(
- "pointer-events-auto rounded-sm border shadow-lg backdrop-blur-xl transition-[transform,opacity] duration-200 ease-out",
+ "pointer-events-auto rounded-sm border shadow-lg backdrop-blur-xl transition-(--tp-transform-opacity) duration-200 ease-out",
visible
? "translate-y-0 opacity-100"
: "translate-y-3 opacity-0",
@@ -89,7 +89,7 @@ export function ToastViewport() {
<aside
aria-live="polite"
aria-atomic="false"
- className="pointer-events-none fixed bottom-3 left-3 z-[120] w-full max-w-sm px-1"
+ className="pointer-events-none fixed bottom-3 left-3 z-(--z-120) w-full max-w-sm px-1"
>
<ol className="flex w-full flex-col-reverse gap-2">
{toasts.map((toast) => (
diff --git a/ui/src/components/TrustPresetSection.tsx b/ui/src/components/TrustPresetSection.tsx
index e9ee0cb4ea..e7c60b679d 100644
--- a/ui/src/components/TrustPresetSection.tsx
+++ b/ui/src/components/TrustPresetSection.tsx
@@ -148,7 +148,7 @@ export function TrustPresetSection({
</div>
{boundaryEditable ? (
<div className="rounded-md border border-border/70 bg-background/70 p-3 text-foreground space-y-3">
- <div className="grid gap-3 sm:grid-cols-[minmax(0,0.75fr)_minmax(0,1fr)]">
+ <div className="grid gap-3 sm:grid-cols-(--gtc-12)">
<Field label="Boundary type">
<select
className={inputClass}
diff --git a/ui/src/components/WorkspaceFileBrowser.tsx b/ui/src/components/WorkspaceFileBrowser.tsx
index 97dcb9782a..f04e0d9516 100644
--- a/ui/src/components/WorkspaceFileBrowser.tsx
+++ b/ui/src/components/WorkspaceFileBrowser.tsx
@@ -128,7 +128,7 @@ function WorkspaceFileBreadcrumbs({
if (!rootLabel && segments.length === 0) return null;
return (
- <nav aria-label="Current folder" className="min-w-0 overflow-hidden text-[11px] text-muted-foreground">
+ <nav aria-label="Current folder" className="min-w-0 overflow-hidden text-(length:--text-micro) text-muted-foreground">
<ol className="flex min-w-0 items-center gap-1 overflow-hidden">
{rootLabel ? (
<li className="min-w-0 shrink">
@@ -185,7 +185,7 @@ function WorkspaceFileRow({ item, treeItemId, selected, highlighted, depth, onOp
onMouseEnter={onHover}
title={item.displayPath}
className={cn(
- "flex min-h-[36px] cursor-pointer items-center gap-2 rounded-md py-1.5 pr-2 sm:min-h-0",
+ "flex min-h-(--sz-36px) cursor-pointer items-center gap-2 rounded-md py-1.5 pr-2 sm:min-h-0",
selected ? "bg-accent text-foreground" : highlighted ? "bg-accent/50" : "hover:bg-accent/60",
)}
style={{ paddingLeft: `${0.5 + depth * 0.875}rem` }}
@@ -384,7 +384,7 @@ function WorkspaceFileTree({
aria-expanded={expanded}
title={node.key}
onClick={() => onToggleFolder(node.key)}
- className="flex min-h-[32px] w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-accent/60"
+ className="flex min-h-(--sz-32px) w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-accent/60"
style={{ paddingLeft: `${0.25 + node.depth * 0.875}rem` }}
>
{expanded ? (
@@ -400,7 +400,7 @@ function WorkspaceFileTree({
{children.map(renderNode)}
{loading ? (
<div
- className="flex min-h-[30px] items-center gap-2 py-1 pr-2 text-xs text-muted-foreground"
+ className="flex min-h-(--sz-30px) items-center gap-2 py-1 pr-2 text-xs text-muted-foreground"
style={{ paddingLeft: `${1 + (node.depth + 1) * 0.875}rem` }}
>
<Loader2 aria-hidden="true" className="h-3.5 w-3.5 animate-spin" />
@@ -411,7 +411,7 @@ function WorkspaceFileTree({
<button
type="button"
onClick={() => onLoadMoreFolder?.(node.key)}
- className="flex min-h-[30px] w-full items-center gap-2 rounded-md py-1 pr-2 text-left text-xs text-muted-foreground hover:bg-accent/60 hover:text-foreground"
+ className="flex min-h-(--sz-30px) w-full items-center gap-2 rounded-md py-1 pr-2 text-left text-xs text-muted-foreground hover:bg-accent/60 hover:text-foreground"
style={{ paddingLeft: `${1 + (node.depth + 1) * 0.875}rem` }}
>
<span className="h-3.5 w-3.5 shrink-0" />
@@ -1072,7 +1072,7 @@ export function WorkspaceFileBrowser({
<div ref={scrollContainerRef} className="min-h-0 flex-1 overflow-y-auto">{body}</div>
{lazyTruncatedFolders.has(currentFolderKey) || (data?.truncated && !isLazyBrowse) ? (
- <div className="border-t border-border pt-2 text-[11px] text-muted-foreground">
+ <div className="border-t border-border pt-2 text-(length:--text-micro) text-muted-foreground">
{isLazyBrowse ? (
<button
type="button"
diff --git a/ui/src/components/WorkspaceRuntimeControls.tsx b/ui/src/components/WorkspaceRuntimeControls.tsx
index 46ae26013a..2ef657cfbd 100644
--- a/ui/src/components/WorkspaceRuntimeControls.tsx
+++ b/ui/src/components/WorkspaceRuntimeControls.tsx
@@ -354,7 +354,7 @@ function CommandSection({
{item.healthStatus && item.statusLabel !== "stopped" ? (
<div className="flex items-center gap-2">
<span className={cn(
- "inline-flex items-center rounded-full border px-2.5 py-1 text-[11px]",
+ "inline-flex items-center rounded-full border px-2.5 py-1 text-(length:--text-micro)",
item.healthStatus === "healthy"
? "border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"
: item.healthStatus === "unhealthy"
@@ -405,7 +405,7 @@ export function WorkspaceRuntimeControls({
<div className={cn("space-y-4", className)}>
<div className={cn("border border-border/70 bg-background p-3", square ? "rounded-none" : "rounded-xl")}>
<div className="space-y-1">
- <div className="text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground">Workspace commands</div>
+ <div className="text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Workspace commands</div>
<div className="flex flex-wrap items-center gap-2">
<span
className={cn(
diff --git a/ui/src/components/WorktreeBanner.tsx b/ui/src/components/WorktreeBanner.tsx
index e256c406cd..614a34e2a8 100644
--- a/ui/src/components/WorktreeBanner.tsx
+++ b/ui/src/components/WorktreeBanner.tsx
@@ -17,7 +17,7 @@ export function WorktreeBanner() {
return (
<div
- className="relative overflow-hidden border-b px-3 py-1.5 text-[11px] font-medium tracking-[0.2em] uppercase"
+ className="relative overflow-hidden border-b px-3 py-1.5 text-(length:--text-micro) font-medium tracking-(--tracking-caps) uppercase"
style={{
backgroundColor: branding.color,
color: branding.textColor,
@@ -33,7 +33,7 @@ export function WorktreeBanner() {
type="button"
onClick={handleCopyName}
title="Click to copy worktree name"
- className="truncate font-semibold tracking-[0.12em] cursor-pointer hover:opacity-80 transition-opacity bg-transparent border-none p-0 text-current uppercase text-[11px]"
+ className="truncate font-semibold tracking-(--tracking-eyebrow) cursor-pointer hover:opacity-80 transition-opacity bg-transparent border-none p-0 text-current uppercase text-(length:--text-micro)"
>
{copied ? "Copied!" : branding.name}
</button>
diff --git a/ui/src/components/agent-config-primitives.tsx b/ui/src/components/agent-config-primitives.tsx
index 6cfa9985d6..0ffabc35b9 100644
--- a/ui/src/components/agent-config-primitives.tsx
+++ b/ui/src/components/agent-config-primitives.tsx
@@ -116,23 +116,14 @@ export function ToggleField({
<span className="text-xs text-muted-foreground">{label}</span>
{hint && <HintIcon text={hint} />}
</div>
- <button
- data-slot="toggle"
+ {/* Gallery feedback r3: was a hand-rolled h-5 w-9 pill with a bg-green-600
+ track — the app's second switch implementation. Converged on the one
+ canonical ToggleSwitch (status-green on-state), DESIGN.md principle 1. */}
+ <ToggleSwitch
data-testid={toggleTestId}
- type="button"
- className={cn(
- "relative inline-flex h-5 w-9 items-center rounded-full transition-colors",
- checked ? "bg-green-600" : "bg-muted"
- )}
- onClick={() => onChange(!checked)}
- >
- <span
- className={cn(
- "inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",
- checked ? "translate-x-4.5" : "translate-x-0.5"
- )}
- />
- </button>
+ checked={checked}
+ onCheckedChange={onChange}
+ />
</div>
);
}
diff --git a/ui/src/components/artifacts/ArtifactCard.test.tsx b/ui/src/components/artifacts/ArtifactCard.test.tsx
index 6033692dbd..be2728603a 100644
--- a/ui/src/components/artifacts/ArtifactCard.test.tsx
+++ b/ui/src/components/artifacts/ArtifactCard.test.tsx
@@ -52,7 +52,7 @@ describe("ArtifactCard", () => {
expect(markup).toContain('href="/issues/PAP-10306#attachment-art-1"');
expect(markup).toContain('data-disable-issue-quicklook="true"');
expect(markup).toContain('data-media-kind="image"');
- expect(markup).toContain("rounded-[8px]");
+ expect(markup).toContain("rounded-(--rad-8)");
expect(markup).toContain('src="/files/art-1.png"');
expect(markup).toContain("object-cover");
expect(markup).toContain("Hero shot");
diff --git a/ui/src/components/artifacts/ArtifactCard.tsx b/ui/src/components/artifacts/ArtifactCard.tsx
index bc4a481909..5a23575293 100644
--- a/ui/src/components/artifacts/ArtifactCard.tsx
+++ b/ui/src/components/artifacts/ArtifactCard.tsx
@@ -26,7 +26,7 @@ function PlaceholderPreview({ label }: { label?: string }) {
<PreviewFrame className="flex items-center justify-center">
<div className="flex flex-col items-center gap-1.5 text-muted-foreground/50">
<Paperclip className="h-7 w-7" aria-hidden="true" />
- {label ? <span className="text-[11px] font-medium uppercase tracking-wide">{label}</span> : null}
+ {label ? <span className="text-(length:--text-micro) font-medium uppercase tracking-wide">{label}</span> : null}
</div>
</PreviewFrame>
);
@@ -197,7 +197,7 @@ export function ArtifactCard({ artifact }: ArtifactCardProps) {
disableIssueQuicklook
data-testid="artifact-card"
data-media-kind={artifact.mediaKind}
- className="group flex flex-col overflow-hidden rounded-[8px] border border-border bg-card transition-colors hover:border-foreground/20"
+ className="group flex flex-col overflow-hidden rounded-(--rad-8) border border-border bg-card transition-colors hover:border-foreground/20"
>
<ArtifactPreview artifact={artifact} />
@@ -223,7 +223,7 @@ export function ArtifactCard({ artifact }: ArtifactCardProps) {
</div>
</div>
- <div className="mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground/65">
+ <div className="mt-0.5 flex items-center gap-1.5 text-(length:--text-micro) text-muted-foreground/65">
<span>Last edited {formatDate(artifact.updatedAt)}</span>
{artifact.createdByAgent ? (
<>
diff --git a/ui/src/components/artifacts/ArtifactGroupCard.tsx b/ui/src/components/artifacts/ArtifactGroupCard.tsx
index 68544f402c..7d1059b20d 100644
--- a/ui/src/components/artifacts/ArtifactGroupCard.tsx
+++ b/ui/src/components/artifacts/ArtifactGroupCard.tsx
@@ -29,12 +29,12 @@ export function ArtifactGroupCard({ group, to }: ArtifactGroupCardProps) {
<div
aria-hidden="true"
data-testid="artifact-stack-layer"
- className="pointer-events-none absolute inset-0 translate-x-[8px] translate-y-[8px] rounded-[8px] border border-border bg-muted/40 shadow-sm"
+ className="pointer-events-none absolute inset-0 translate-x-(--sz-8px) translate-y-(--sz-8px) rounded-(--rad-8) border border-border bg-muted/40 shadow-sm"
/>
<div
aria-hidden="true"
data-testid="artifact-stack-layer"
- className="pointer-events-none absolute inset-0 translate-x-[4px] translate-y-[4px] rounded-[8px] border border-border bg-muted/70 shadow-sm"
+ className="pointer-events-none absolute inset-0 translate-x-(--sz-4px) translate-y-(--sz-4px) rounded-(--rad-8) border border-border bg-muted/70 shadow-sm"
/>
</>
) : null}
@@ -46,7 +46,7 @@ export function ArtifactGroupCard({ group, to }: ArtifactGroupCardProps) {
data-group-id={group.id}
data-count={group.count}
data-stacked={stacked ? "true" : "false"}
- className="group relative flex flex-col overflow-hidden rounded-[8px] border border-border bg-card transition-colors hover:border-foreground/20"
+ className="group relative flex flex-col overflow-hidden rounded-(--rad-8) border border-border bg-card transition-colors hover:border-foreground/20"
>
<div className="relative">
{preview ? (
@@ -56,7 +56,7 @@ export function ArtifactGroupCard({ group, to }: ArtifactGroupCardProps) {
<Layers className="h-7 w-7" aria-hidden="true" />
</div>
)}
- <span className="absolute right-2 top-2 inline-flex items-center gap-1 rounded-full bg-background/85 px-2 py-0.5 text-[11px] font-medium text-foreground/90 shadow-sm backdrop-blur">
+ <span className="absolute right-2 top-2 inline-flex items-center gap-1 rounded-full bg-background/85 px-2 py-0.5 text-(length:--text-micro) font-medium text-foreground/90 shadow-sm backdrop-blur">
<Layers className="h-3 w-3" aria-hidden="true" />
{group.count}
</span>
@@ -64,7 +64,7 @@ export function ArtifactGroupCard({ group, to }: ArtifactGroupCardProps) {
<div className="flex flex-1 flex-col gap-1 p-3">
<div className="flex h-7 items-center gap-2">
- <span className="shrink-0 font-mono text-[11px] text-muted-foreground">
+ <span className="shrink-0 font-mono text-(length:--text-micro) text-muted-foreground">
{group.issue.identifier}
</span>
<h3
@@ -75,7 +75,7 @@ export function ArtifactGroupCard({ group, to }: ArtifactGroupCardProps) {
</h3>
</div>
- <div className="mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground/65">
+ <div className="mt-0.5 flex items-center gap-1.5 text-(length:--text-micro) text-muted-foreground/65">
<span>{countLabel}</span>
<span className="text-muted-foreground/50">·</span>
<span>Updated {formatDate(group.updatedAt)}</span>
diff --git a/ui/src/components/environment-variables-editor/CreateSecretPopover.tsx b/ui/src/components/environment-variables-editor/CreateSecretPopover.tsx
index 021362ee16..9d829bda0c 100644
--- a/ui/src/components/environment-variables-editor/CreateSecretPopover.tsx
+++ b/ui/src/components/environment-variables-editor/CreateSecretPopover.tsx
@@ -75,7 +75,7 @@ export function SecretPopoverForm({
<div className="space-y-1">
<PopoverTitle className="text-sm font-medium">{heading}</PopoverTitle>
{mode === "store" ? (
- <PopoverDescription className="text-[11px] text-muted-foreground">
+ <PopoverDescription className="text-(length:--text-micro) text-muted-foreground">
Moves the typed value into an encrypted company secret and binds{" "}
<span className="font-mono">{initialName || "this variable"}</span> to it.
</PopoverDescription>
@@ -83,7 +83,7 @@ export function SecretPopoverForm({
</div>
<label className="block space-y-1">
- <span className="text-[11px] font-medium text-muted-foreground">Name</span>
+ <span className="text-(length:--text-micro) font-medium text-muted-foreground">Name</span>
<input
className={cn(fieldClass, nameError && "border-destructive focus-visible:ring-destructive/40")}
value={name}
@@ -101,11 +101,11 @@ export function SecretPopoverForm({
}
}}
/>
- {nameError ? <span className="block text-[11px] text-destructive">{nameError}</span> : null}
+ {nameError ? <span className="block text-(length:--text-micro) text-destructive">{nameError}</span> : null}
</label>
<label className="block space-y-1">
- <span className="text-[11px] font-medium text-muted-foreground">Value</span>
+ <span className="text-(length:--text-micro) font-medium text-muted-foreground">Value</span>
<div className="relative">
<input
className={cn(fieldClass, "pr-8", valueError && "border-destructive focus-visible:ring-destructive/40")}
@@ -127,10 +127,10 @@ export function SecretPopoverForm({
{reveal ? <EyeOff className="h-3.5 w-3.5" /> : <Eye className="h-3.5 w-3.5" />}
</button>
</div>
- {valueError ? <span className="block text-[11px] text-destructive">{valueError}</span> : null}
+ {valueError ? <span className="block text-(length:--text-micro) text-destructive">{valueError}</span> : null}
</label>
- {error ? <p className="text-[11px] text-destructive">{error}</p> : null}
+ {error ? <p className="text-(length:--text-micro) text-destructive">{error}</p> : null}
<div className="flex items-center justify-end gap-2 pt-0.5">
<Button type="button" variant="ghost" size="sm" onClick={onCancel} disabled={submitting}>
diff --git a/ui/src/components/environment-variables-editor/Row.tsx b/ui/src/components/environment-variables-editor/Row.tsx
index f151e297ba..f2f9f317a3 100644
--- a/ui/src/components/environment-variables-editor/Row.tsx
+++ b/ui/src/components/environment-variables-editor/Row.tsx
@@ -199,8 +199,8 @@ export function EnvironmentVariableRow({
return (
<div
className={cn(
- "group/row grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1.5 gap-y-1 rounded-md px-1 py-1",
- "@[40rem]/env:grid-cols-[minmax(160px,2fr)_minmax(240px,3fr)_32px] @[40rem]/env:items-center",
+ "group/row grid grid-cols-(--gtc-13) items-start gap-x-1.5 gap-y-1 rounded-md px-1 py-1",
+ "@[40rem]/env:grid-cols-(--gtc-14) @[40rem]/env:items-center",
isDirty && "bg-amber-500/[0.06] ring-1 ring-amber-500/20",
)}
>
@@ -281,15 +281,15 @@ export function EnvironmentVariableRow({
<DropdownMenuContent align="start" className="w-56">
<DropdownMenuItem className="flex-col items-start gap-0.5" onSelect={() => switchSource("text")}>
<span className="text-sm">Text value</span>
- <span className="text-[11px] text-muted-foreground">Store the value inline as plain text.</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">Store the value inline as plain text.</span>
</DropdownMenuItem>
<DropdownMenuItem className="flex-col items-start gap-0.5" onSelect={() => switchSource("secret")}>
<span className="text-sm">Company secret</span>
- <span className="text-[11px] text-muted-foreground">Resolve a stored company secret at run start.</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">Resolve a stored company secret at run start.</span>
</DropdownMenuItem>
<DropdownMenuItem className="flex-col items-start gap-0.5" onSelect={() => switchSource("user_secret")}>
<span className="text-sm">User secret</span>
- <span className="text-[11px] text-muted-foreground">
+ <span className="text-(length:--text-micro) text-muted-foreground">
Resolve the responsible user&apos;s own value at run start.
</span>
</DropdownMenuItem>
@@ -321,7 +321,7 @@ export function EnvironmentVariableRow({
type="button"
onClick={openStoreAsSecret}
disabled={disabled}
- className="flex items-center gap-1 px-2 text-[11px] text-amber-700 hover:bg-amber-500/10 dark:text-amber-400"
+ className="flex items-center gap-1 px-2 text-(length:--text-micro) text-amber-700 hover:bg-amber-500/10 dark:text-amber-400"
title="This value looks sensitive — store it as a secret"
>
<ShieldAlert className="size-3.5" />
@@ -369,7 +369,7 @@ export function EnvironmentVariableRow({
}}
aria-label="Version"
className={cn(
- "absolute right-8 top-1/2 z-10 -translate-y-1/2 rounded px-1.5 py-0.5 text-[10px] font-medium",
+ "absolute right-8 top-1/2 z-10 -translate-y-1/2 rounded px-1.5 py-0.5 text-(length:--text-nano) font-medium",
versionPinned
? "bg-amber-500/15 text-amber-700 dark:text-amber-400"
: "text-muted-foreground hover:bg-accent",
@@ -392,7 +392,7 @@ export function EnvironmentVariableRow({
row.version === "latest" && "font-medium",
)}
>
- latest <span className="text-[11px] text-muted-foreground">(recommended)</span>
+ latest <span className="text-(length:--text-micro) text-muted-foreground">(recommended)</span>
</button>
{Array.from({ length: versions }, (_, idx) => versions - idx)
.filter((v) => v > 0)
@@ -419,7 +419,7 @@ export function EnvironmentVariableRow({
) : null}
</div>
) : (
- <div className="grid min-w-0 flex-1 grid-cols-[minmax(0,1fr)_auto]">
+ <div className="grid min-w-0 flex-1 grid-cols-(--gtc-13)">
{userSecretsEnabled ? (
<select
aria-label="User secret"
@@ -522,7 +522,7 @@ export function EnvironmentVariableRow({
id={healthId}
role="status"
className={cn(
- "mt-0.5 text-[11px]",
+ "mt-0.5 text-(length:--text-micro)",
health.level === "error" ? "text-destructive" : "text-amber-600 dark:text-amber-400",
)}
>
@@ -532,7 +532,7 @@ export function EnvironmentVariableRow({
{/* 5s undo after Secret→Text */}
{undoPrev ? (
- <p className="mt-0.5 inline-flex items-center gap-2 text-[11px] text-muted-foreground">
+ <p className="mt-0.5 inline-flex items-center gap-2 text-(length:--text-micro) text-muted-foreground">
Reverted to text —{" "}
<button
type="button"
@@ -552,7 +552,7 @@ export function EnvironmentVariableRow({
<p
id={nameErrorId}
className={cn(
- "col-span-2 col-start-1 row-start-3 min-w-0 text-[11px] @[40rem]/env:col-span-2 @[40rem]/env:row-start-2",
+ "col-span-2 col-start-1 row-start-3 min-w-0 text-(length:--text-micro) @[40rem]/env:col-span-2 @[40rem]/env:row-start-2",
nameIssue.level === "error" ? "text-destructive" : "text-amber-600 dark:text-amber-400",
)}
>
diff --git a/ui/src/components/environment-variables-editor/SecretPicker.tsx b/ui/src/components/environment-variables-editor/SecretPicker.tsx
index 0458a10635..dd42e7800f 100644
--- a/ui/src/components/environment-variables-editor/SecretPicker.tsx
+++ b/ui/src/components/environment-variables-editor/SecretPicker.tsx
@@ -24,7 +24,7 @@ const FOLDER_VALUE_PREFIX = "__secret_folder__:";
function statusBadge(status: SecretStatus | undefined) {
if (!status || status === "active") return null;
return (
- <Badge variant="outline" className="ml-auto text-[10px] font-normal text-muted-foreground">
+ <Badge variant="outline" className="ml-auto text-(length:--text-nano) font-normal text-muted-foreground">
{status}
</Badge>
);
@@ -257,7 +257,7 @@ export function SecretPicker({
searchPlaceholder="Search secrets…"
emptyMessage="No matching secrets"
triggerClassName={cn(
- "h-[34px] min-h-[34px] font-mono text-sm",
+ "h-(--sz-34px) min-h-(--sz-34px) font-mono text-sm",
boundMissing && "border-destructive text-destructive",
boundSecret && boundSecret.status !== "active" && "border-amber-500/60",
triggerClassName,
@@ -292,7 +292,7 @@ export function SecretPicker({
<span className="flex min-w-0 flex-col">
<span className={cn("truncate text-sm", selected && "font-medium")}>{option.label}</span>
{option.pathHint ? (
- <span className="truncate font-mono text-[11px] text-muted-foreground">{option.pathHint}</span>
+ <span className="truncate font-mono text-(length:--text-micro) text-muted-foreground">{option.pathHint}</span>
) : null}
</span>
</span>
@@ -310,7 +310,7 @@ export function SecretPicker({
{option.label}
</span>
{option.pathHint && option.pathHint !== option.label ? (
- <span className="truncate font-mono text-[11px] text-muted-foreground">{option.pathHint}</span>
+ <span className="truncate font-mono text-(length:--text-micro) text-muted-foreground">{option.pathHint}</span>
) : null}
</span>
{statusBadge(option.status)}
diff --git a/ui/src/components/environment-variables-editor/index.tsx b/ui/src/components/environment-variables-editor/index.tsx
index d34054ddba..539f4ba46a 100644
--- a/ui/src/components/environment-variables-editor/index.tsx
+++ b/ui/src/components/environment-variables-editor/index.tsx
@@ -377,7 +377,7 @@ export const EnvironmentVariablesEditor = forwardRef<EnvironmentVariablesEditorH
<TooltipProvider>
<div ref={editorRootRef} className="@container/env space-y-2">
{attentionCount > 1 ? (
- <p className="inline-flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-400">
+ <p className="inline-flex items-center gap-1.5 text-(length:--text-micro) font-medium text-amber-700 dark:text-amber-400">
<AlertCircle className="size-3.5" />
{attentionCount} bindings need attention
</p>
@@ -386,9 +386,9 @@ export const EnvironmentVariablesEditor = forwardRef<EnvironmentVariablesEditorH
{hasRows ? (
<>
{/* Header (desktop only) */}
- <div className="hidden gap-x-1.5 @[40rem]/env:grid @[40rem]/env:grid-cols-[minmax(160px,2fr)_minmax(240px,3fr)_32px]">
- <span className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">Name</span>
- <span className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">Value</span>
+ <div className="hidden gap-x-1.5 @[40rem]/env:grid @[40rem]/env:grid-cols-(--gtc-14)">
+ <span className="text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">Name</span>
+ <span className="text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">Value</span>
<span />
</div>
@@ -438,7 +438,7 @@ export const EnvironmentVariablesEditor = forwardRef<EnvironmentVariablesEditorH
{quickBind.length > 0 && !disabled ? (
<div className="flex flex-wrap items-center gap-1.5">
- <span className="inline-flex items-center gap-1 text-[11px] text-muted-foreground/70">
+ <span className="inline-flex items-center gap-1 text-(length:--text-micro) text-muted-foreground/70">
<KeyRound className="size-3" />
Recently used:
</span>
@@ -447,7 +447,7 @@ export const EnvironmentVariablesEditor = forwardRef<EnvironmentVariablesEditorH
key={secret.id}
type="button"
onClick={() => bindRecentSecret(secret)}
- className="inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 font-mono text-[11px] text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"
+ className="inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 font-mono text-(length:--text-micro) text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"
title={`Bind ${secret.name}`}
>
+ {secret.name}
@@ -464,7 +464,7 @@ export const EnvironmentVariablesEditor = forwardRef<EnvironmentVariablesEditorH
className="mt-3 flex w-full flex-col gap-3 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-3 text-amber-950 shadow-sm dark:bg-amber-500/15 dark:text-amber-100 @[34rem]/env:flex-row @[34rem]/env:items-center @[34rem]/env:justify-between"
>
<div className="flex min-w-0 items-center gap-2 text-sm font-medium">
- <span className="size-2 rounded-full bg-amber-500 shadow-[0_0_0_3px_rgba(245,158,11,0.18)]" />
+ <span className="size-2 rounded-full bg-amber-500 shadow-(--shadow-extract-13)" />
<span>Unsaved changes</span>
</div>
<div className="flex items-center gap-2">
@@ -488,9 +488,9 @@ export const EnvironmentVariablesEditor = forwardRef<EnvironmentVariablesEditorH
</div>
) : null}
- {hint ? <p className="text-[11px] text-muted-foreground/70">{hint}</p> : null}
+ {hint ? <p className="text-(length:--text-micro) text-muted-foreground/70">{hint}</p> : null}
{rows.some((row) => row.source === "user_secret" && row.userSecretKey) ? (
- <p className="inline-flex items-start gap-1 text-[11px] text-muted-foreground/70">
+ <p className="inline-flex items-start gap-1 text-(length:--text-micro) text-muted-foreground/70">
<UserRound className="mt-0.5 size-3 shrink-0" />
<span>
User secrets resolve from the user responsible for the run. Required bindings fail until that user
diff --git a/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx b/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx
index 54c0b6e2f9..bd66a32000 100644
--- a/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx
+++ b/ui/src/components/interrupt-handoff/InterruptHandoffViews.tsx
@@ -61,7 +61,7 @@ export function AssigneeChip({
<span className={cn(CHIP_CLASS, className)} data-testid="handoff-assignee-chip" data-kind="agent">
<span className="sr-only">Agent </span>
<AgentIcon icon={agentIcon(assignee.agentId, resolvers)} className="h-3 w-3 shrink-0 text-muted-foreground" />
- <span className="max-w-[12rem] truncate">{agentName(assignee.agentId, resolvers)}</span>
+ <span className="max-w-(--sz-12rem) truncate">{agentName(assignee.agentId, resolvers)}</span>
</span>
);
}
@@ -70,7 +70,7 @@ export function AssigneeChip({
<span className={cn(CHIP_CLASS, className)} data-testid="handoff-assignee-chip" data-kind="user">
<span className="sr-only">User </span>
<User className="h-3 w-3 shrink-0 text-muted-foreground" />
- <span className="max-w-[12rem] truncate">{userLabel(assignee.userId, resolvers)}</span>
+ <span className="max-w-(--sz-12rem) truncate">{userLabel(assignee.userId, resolvers)}</span>
</span>
);
}
diff --git a/ui/src/components/issue-output/IssueOutputSection.tsx b/ui/src/components/issue-output/IssueOutputSection.tsx
index 3ed6d751fe..db57d791d1 100644
--- a/ui/src/components/issue-output/IssueOutputSection.tsx
+++ b/ui/src/components/issue-output/IssueOutputSection.tsx
@@ -65,7 +65,7 @@ function OutputMediaPreview({
)}
<div className="absolute inset-x-0 bottom-0 bg-black/65 px-2 py-1.5 text-left">
<p className="truncate text-xs font-medium text-white" title={filename}>{filename}</p>
- <p className="truncate text-[10px] text-white/65">{metaBits.join(" · ")}</p>
+ <p className="truncate text-(length:--text-nano) text-white/65">{metaBits.join(" · ")}</p>
</div>
</>
);
@@ -135,7 +135,7 @@ export function IssueOutputSection({ workProducts, resolveCreatorName, onMediaCl
{rest.length > 0 ? (
<div className="space-y-2">
- <p className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">Also produced</p>
+ <p className="text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">Also produced</p>
{mediaRest.length > 0 ? (
<div className="grid grid-cols-4 gap-2">
{mediaRest.map((item) => (
diff --git a/ui/src/components/issue-output/OutputFileTile.tsx b/ui/src/components/issue-output/OutputFileTile.tsx
index 13ad442f4e..6622796167 100644
--- a/ui/src/components/issue-output/OutputFileTile.tsx
+++ b/ui/src/components/issue-output/OutputFileTile.tsx
@@ -3,9 +3,9 @@ import { getOutputFileGlyph, type OutputFileTone } from "@/lib/issue-output";
const TONE_CLASSES: Record<OutputFileTone, string> = {
video: "bg-indigo-500/15 text-indigo-300",
- pdf: "bg-red-500/15 text-red-300",
- zip: "bg-amber-500/15 text-amber-300",
- image: "bg-emerald-500/15 text-emerald-300",
+ pdf: "bg-red-500/15 text-red-700 dark:text-red-300",
+ zip: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
+ image: "bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",
bin: "bg-muted text-muted-foreground",
};
@@ -22,7 +22,7 @@ export function OutputFileTile({ contentType, className, sizeClassName = "h-8 w-
return (
<span
className={cn(
- "flex shrink-0 items-center justify-center rounded-md text-[10px] font-semibold tabular-nums",
+ "flex shrink-0 items-center justify-center rounded-md text-(length:--text-nano) font-semibold tabular-nums",
sizeClassName,
TONE_CLASSES[glyph.tone],
className,
diff --git a/ui/src/components/issue-output/OutputPrimaryCard.tsx b/ui/src/components/issue-output/OutputPrimaryCard.tsx
index a4f935a3a1..31547b1124 100644
--- a/ui/src/components/issue-output/OutputPrimaryCard.tsx
+++ b/ui/src/components/issue-output/OutputPrimaryCard.tsx
@@ -70,13 +70,13 @@ export function OutputPrimaryCard({ item, creatorName, onMediaClick }: OutputPri
<div className="min-w-0 flex-1">
<p className="break-words text-sm font-semibold text-foreground">{filename}</p>
{item.degraded ? (
- <p className="mt-0.5 text-[11px] text-destructive">
+ <p className="mt-0.5 text-(length:--text-micro) text-destructive">
Output metadata is unavailable — this file can’t be played or downloaded here.
</p>
) : (
- <div className="mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[11px] text-muted-foreground">
+ <div className="mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-(length:--text-micro) text-muted-foreground">
{item.isPrimary && (
- <Badge variant="secondary" className="px-1.5 py-0 text-[10px]">
+ <Badge variant="secondary" className="px-1.5 py-0 text-(length:--text-nano)">
Primary
</Badge>
)}
diff --git a/ui/src/components/issue-output/OutputRow.tsx b/ui/src/components/issue-output/OutputRow.tsx
index dc4687eb16..66e688bfc4 100644
--- a/ui/src/components/issue-output/OutputRow.tsx
+++ b/ui/src/components/issue-output/OutputRow.tsx
@@ -31,7 +31,7 @@ export function OutputRow({ item, creatorName }: OutputRowProps) {
</p>
<p
className={cn(
- "truncate text-[11px]",
+ "truncate text-(length:--text-micro)",
item.degraded ? "text-destructive" : "text-muted-foreground",
)}
>
diff --git a/ui/src/components/issue-properties/IssueProperties.tsx b/ui/src/components/issue-properties/IssueProperties.tsx
index 135e1932e7..90067a5f53 100644
--- a/ui/src/components/issue-properties/IssueProperties.tsx
+++ b/ui/src/components/issue-properties/IssueProperties.tsx
@@ -178,6 +178,7 @@ export function IssueProperties({
const [assigneeOptionsOpen, setAssigneeOptionsOpen] = useState(false);
const [labelSearch, setLabelSearch] = useState("");
const [newLabelName, setNewLabelName] = useState("");
+ // token-extraction: allowlisted — color-picker seed state, persisted into label-create payload; a var() string would break that payload.
const [newLabelColor, setNewLabelColor] = useState("#6366f1");
const [monitorAtInput, setMonitorAtInput] = useState(() => toDateTimeLocalValue(issue.executionPolicy?.monitor?.nextCheckAt));
const [monitorNotesInput, setMonitorNotesInput] = useState(issue.executionPolicy?.monitor?.notes ?? "");
@@ -1059,7 +1060,7 @@ export function IssueProperties({
</span>
) : null}
</div>
- <dl className="grid grid-cols-[6rem_1fr] gap-y-1">
+ <dl className="grid grid-cols-(--gtc-15) gap-y-1">
{scheduledRetryReasonLabel ? (
<>
<dt className="text-muted-foreground">Reason</dt>
@@ -1573,7 +1574,7 @@ export function IssueProperties({
<>
<span
className="shrink-0 h-3 w-3 rounded-sm"
- style={{ backgroundColor: orderedProjects.find((p) => p.id === issue.projectId)?.color ?? "#6366f1" }}
+ style={{ backgroundColor: orderedProjects.find((p) => p.id === issue.projectId)?.color ?? "var(--project-seed)" }}
/>
<span className="text-sm truncate min-w-0" title={projectName(issue.projectId)}>{projectName(issue.projectId)}</span>
</>
@@ -1646,7 +1647,7 @@ export function IssueProperties({
{option.kind === "project" ? (
<span
className="shrink-0 h-3 w-3 rounded-sm"
- style={{ backgroundColor: option.color ?? "#6366f1" }}
+ style={{ backgroundColor: option.color ?? "var(--project-seed)" }}
/>
) : null}
{option.name}
@@ -1946,7 +1947,7 @@ export function IssueProperties({
onOpenChange={(open) => { setProjectOpen(open); if (!open) setProjectSearch(""); }}
triggerContent={projectTrigger}
triggerClassName="min-w-0 max-w-full"
- popoverClassName="w-fit min-w-[11rem]"
+ popoverClassName="w-fit min-w-(--sz-11rem)"
extra={issue.projectId ? (
<Link
to={projectLink(issue.projectId)!}
@@ -2142,7 +2143,7 @@ export function IssueProperties({
onOpenChange={setScheduledRetryOpen}
triggerContent={scheduledRetryTrigger}
triggerClassName="min-w-0 max-w-full"
- popoverClassName={cn("max-w-full", inline ? "w-full" : "w-80 sm:w-[32rem]")}
+ popoverClassName={cn("max-w-full", inline ? "w-full" : "w-80 sm:w-(--sz-32rem)")}
extra={scheduledRetryAttemptBadge}
>
{scheduledRetryContent}
@@ -2156,7 +2157,7 @@ export function IssueProperties({
onOpenChange={setMonitorOpen}
triggerContent={monitorTrigger}
triggerClassName="min-w-0 max-w-full"
- popoverClassName={cn("max-w-full", inline ? "w-full" : "w-80 sm:w-[32rem]")}
+ popoverClassName={cn("max-w-full", inline ? "w-full" : "w-80 sm:w-(--sz-32rem)")}
extra={monitorAttemptBadge}
>
{monitorContent}
diff --git a/ui/src/components/issue-properties/external-object-rows.tsx b/ui/src/components/issue-properties/external-object-rows.tsx
index c716a34365..e449fda289 100644
--- a/ui/src/components/issue-properties/external-object-rows.tsx
+++ b/ui/src/components/issue-properties/external-object-rows.tsx
@@ -124,7 +124,7 @@ function ExternalObjectPropertyValue({ group }: { group: IssueExternalObjectGrou
const className = cn(
"inline-flex min-w-0 max-w-full items-center gap-1.5 text-sm no-underline",
externalObjectPropertyTone(group),
- pill.url ? "hover:underline focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring" : "",
+ pill.url ? "hover:underline focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring" : "",
);
if (pill.url) {
diff --git a/ui/src/components/issue-properties/relation-controls.tsx b/ui/src/components/issue-properties/relation-controls.tsx
index da235365ba..75dcdeda2a 100644
--- a/ui/src/components/issue-properties/relation-controls.tsx
+++ b/ui/src/components/issue-properties/relation-controls.tsx
@@ -28,7 +28,7 @@ export function RemovableIssueReferencePill({
const chipClassName = cn(
"paperclip-mention-chip paperclip-mention-chip--issue",
"inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-xs no-underline",
- issue.identifier && "hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
+ issue.identifier && "hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-ring",
);
const content = (
<>
@@ -52,7 +52,7 @@ export function RemovableIssueReferencePill({
<span className="group relative inline-flex">
<button
type="button"
- className="absolute -right-1 -top-1 z-10 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 shadow-sm transition-colors transition-opacity hover:bg-destructive/10 hover:text-destructive focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring group-hover:opacity-100"
+ className="absolute -right-1 -top-1 z-10 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 shadow-sm transition-colors transition-opacity hover:bg-destructive/10 hover:text-destructive focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-(length:--rad-2) focus-visible:ring-ring group-hover:opacity-100"
aria-label={removeLabel}
title={removeLabel}
onClick={handleRemove}
diff --git a/ui/src/components/routine-sections/editable-sections.tsx b/ui/src/components/routine-sections/editable-sections.tsx
index 36fedc6688..12f6220d74 100644
--- a/ui/src/components/routine-sections/editable-sections.tsx
+++ b/ui/src/components/routine-sections/editable-sections.tsx
@@ -190,7 +190,7 @@ export function OverviewSection({
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: currentProject.color ?? "#64748b" }}
+ style={{ backgroundColor: currentProject.color ?? "var(--project-none)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -205,7 +205,7 @@ export function OverviewSection({
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: project?.color ?? "#64748b" }}
+ style={{ backgroundColor: project?.color ?? "var(--project-none)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -254,7 +254,7 @@ export function OverviewSection({
onChange={(description) => setEditDraft((current) => ({ ...current, description }))}
placeholder="Add instructions..."
bordered={false}
- contentClassName="min-h-[120px] text-[15px] leading-7"
+ contentClassName="min-h-(--sz-120px) text-sm leading-7"
mentions={mentionOptions}
onSubmit={() => {
if (!saveRoutine.isPending && editDraft.title.trim()) {
@@ -270,7 +270,7 @@ export function OverviewSection({
onChange={(description) => setEditDraft((current) => ({ ...current, description }))}
placeholder="Add instructions..."
bordered={false}
- contentClassName="min-h-[120px] text-[15px] leading-7"
+ contentClassName="min-h-(--sz-120px) text-sm leading-7"
mentions={mentionOptions}
onSubmit={() => {
if (!saveRoutine.isPending && editDraft.title.trim()) {
@@ -667,7 +667,7 @@ export function DeliverySection() {
return (
<div className="space-y-6">
<div className="space-y-3">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Concurrency
</p>
<RadioCardGroup
@@ -680,7 +680,7 @@ export function DeliverySection() {
/>
</div>
<div className="space-y-3">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Catch-up
</p>
<RadioCardGroup
@@ -739,7 +739,7 @@ function NextFiresPreview({
return (
<div className="space-y-3">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">
Next 5 fires
</p>
{preview ? (
@@ -759,7 +759,7 @@ function NextFiresPreview({
</div>
))}
</div>
- <p className="text-[11px] text-muted-foreground/60">
+ <p className="text-(length:--text-micro) text-muted-foreground/60">
Preview assumes the previous run is still in flight when the next fires. Times shown in{" "}
{preview.timeZone}.
</p>
diff --git a/ui/src/components/search/MatchSourceChip.tsx b/ui/src/components/search/MatchSourceChip.tsx
index 798ed7ac78..d370bdd533 100644
--- a/ui/src/components/search/MatchSourceChip.tsx
+++ b/ui/src/components/search/MatchSourceChip.tsx
@@ -4,13 +4,13 @@ export type MatchSourceChipKind = "title" | "identifier" | "comment" | "document
const chipStyles: Record<MatchSourceChipKind, string> = {
title:
- "bg-[var(--chip-match-title-bg)] text-[var(--chip-match-title-fg)] border-[var(--chip-match-title-border)]",
+ "bg-(--chip-match-title-bg) text-(--chip-match-title-fg) border-(--chip-match-title-border)",
identifier:
- "bg-[var(--chip-match-identifier-bg)] text-[var(--chip-match-identifier-fg)] border-[var(--chip-match-identifier-border)]",
+ "bg-(--chip-match-identifier-bg) text-(--chip-match-identifier-fg) border-(--chip-match-identifier-border)",
comment:
- "bg-[var(--chip-match-comment-bg)] text-[var(--chip-match-comment-fg)] border-[var(--chip-match-comment-border)]",
+ "bg-(--chip-match-comment-bg) text-(--chip-match-comment-fg) border-(--chip-match-comment-border)",
document:
- "bg-[var(--chip-match-document-bg)] text-[var(--chip-match-document-fg)] border-[var(--chip-match-document-border)]",
+ "bg-(--chip-match-document-bg) text-(--chip-match-document-fg) border-(--chip-match-document-border)",
};
const chipLabels: Record<MatchSourceChipKind, string> = {
@@ -33,7 +33,7 @@ export function MatchSourceChip({ kind, count, label, className }: MatchSourceCh
return (
<span
className={cn(
- "inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium leading-none whitespace-nowrap",
+ "inline-flex items-center gap-1 rounded-full border px-2 py-px text-(length:--text-micro) font-medium leading-none whitespace-nowrap",
chipStyles[kind],
className,
)}
diff --git a/ui/src/components/search/SearchResultRow.tsx b/ui/src/components/search/SearchResultRow.tsx
index 408427e5b3..7e60e4699e 100644
--- a/ui/src/components/search/SearchResultRow.tsx
+++ b/ui/src/components/search/SearchResultRow.tsx
@@ -151,7 +151,7 @@ function SearchResultRowImpl({
alt=""
loading="lazy"
decoding="async"
- className="h-[88px] w-[88px] shrink-0 rounded-md border border-border bg-muted object-cover"
+ className="h-(--sz-88px) w-(--sz-88px) shrink-0 rounded-md border border-border bg-muted object-cover"
/>
) : null}
</div>
@@ -224,7 +224,7 @@ function SearchResultRowImpl({
alt=""
loading="lazy"
decoding="async"
- className="h-[88px] w-[88px] shrink-0 rounded-md border border-border bg-muted object-cover"
+ className="h-(--sz-88px) w-(--sz-88px) shrink-0 rounded-md border border-border bg-muted object-cover"
/>
) : null}
</div>
diff --git a/ui/src/components/timeline/WorkTimelineChart.tsx b/ui/src/components/timeline/WorkTimelineChart.tsx
index 932a488611..cd1f6f2403 100644
--- a/ui/src/components/timeline/WorkTimelineChart.tsx
+++ b/ui/src/components/timeline/WorkTimelineChart.tsx
@@ -434,7 +434,7 @@ export function WorkTimelineChart({
<div className="relative">
<div
ref={scrollRef}
- className="max-h-[70vh] overflow-auto"
+ className="max-h-(--sz-70vh) overflow-auto"
data-testid="work-timeline-scroll"
onScroll={(e) => {
setScrollLeft(e.currentTarget.scrollLeft);
@@ -485,7 +485,7 @@ export function WorkTimelineChart({
);
})}
- {/* now line — teal "Signal" present marker */}
+ {/* now line — status-blue "Signal" present marker (gallery r2; was teal) */}
{now >= layout.fromMs && now <= layout.toMs && (
<line
x1={layout.gutter + ((now - layout.fromMs) / 60000) * layout.pxPerMinute}
@@ -769,10 +769,10 @@ function Tooltip({ tooltip, now }: { tooltip: TooltipState; now: number }) {
const left = Math.min(tooltip.x + 14, (typeof window !== "undefined" ? window.innerWidth : 1200) - 300);
return (
<div
- className="pointer-events-none fixed z-50 max-w-[280px] rounded-md border border-foreground bg-card px-2.5 py-2 text-xs shadow-md"
+ className="pointer-events-none fixed z-50 max-w-(--sz-280px) rounded-md border border-foreground bg-card px-2.5 py-2 text-xs shadow-md"
style={{ left, top: tooltip.y + 14 }}
>
- <div className="text-[13px] font-medium text-foreground">{truncate(title)}</div>
+ <div className="text-(length:--text-compact) font-medium text-foreground">{truncate(title)}</div>
<div className="mt-0.5 text-muted-foreground">
{fmtClock(startMs)}–{bar.span.end ? fmtClock(endMs) : "now"} · {formatDuration(startMs, endMs)} ·{" "}
<span className="font-medium text-foreground">{bar.span.status}</span>
diff --git a/ui/src/components/transcript/RunTranscriptView.tsx b/ui/src/components/transcript/RunTranscriptView.tsx
index 7b7ac350f1..737dfaa641 100644
--- a/ui/src/components/transcript/RunTranscriptView.tsx
+++ b/ui/src/components/transcript/RunTranscriptView.tsx
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
import type { TranscriptEntry } from "../../adapters";
import { MarkdownBody, type MarkdownExternalReferenceMap } from "../MarkdownBody";
import { cn, formatTokens } from "../../lib/utils";
+import { runningLabelText } from "../../lib/status-colors";
import {
Check,
ChevronDown,
@@ -673,7 +674,7 @@ function TranscriptMessageBlock({
return (
<div>
{!isAssistant && (
- <div className="mb-1.5 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-1.5 flex items-center gap-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
<User className={compact ? "h-3.5 w-3.5" : "h-4 w-4"} />
<span>User</span>
</div>
@@ -688,7 +689,7 @@ function TranscriptMessageBlock({
{block.text}
</MarkdownBody>
{block.streaming && (
- <div className="mt-2 inline-flex items-center gap-1 text-[10px] font-medium italic text-muted-foreground">
+ <div className="mt-2 inline-flex items-center gap-1 text-(length:--text-nano) font-medium italic text-muted-foreground">
<span className="relative flex h-1.5 w-1.5">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-70" />
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-current" />
@@ -715,7 +716,7 @@ function TranscriptThinkingBlock({
<MarkdownBody
className={cn(
"italic text-foreground/70 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
- density === "compact" ? "text-[11px] leading-5" : "text-sm leading-6",
+ density === "compact" ? "text-(length:--text-micro) leading-5" : "text-sm leading-6",
className,
)}
externalReferences={externalReferences}
@@ -743,7 +744,7 @@ function TranscriptToolCard({
: "Completed";
const statusTone =
block.status === "running"
- ? "text-cyan-700 dark:text-cyan-300"
+ ? "text-blue-700 dark:text-blue-300"
: block.status === "error"
? "text-red-700 dark:text-red-300"
: "text-emerald-700 dark:text-emerald-300";
@@ -757,7 +758,7 @@ function TranscriptToolCard({
? "text-red-600 dark:text-red-300"
: block.status === "completed"
? "text-emerald-600 dark:text-emerald-300"
- : "text-cyan-600 dark:text-cyan-300",
+ : "text-blue-600 dark:text-blue-300",
);
const summary = block.status === "running"
? summarizeToolInput(block.name, block.input, density)
@@ -777,10 +778,10 @@ function TranscriptToolCard({
)}
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-x-2 gap-y-1">
- <span className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <span className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{block.name}
</span>
- <span className={cn("text-[10px] font-semibold uppercase tracking-[0.14em]", statusTone)}>
+ <span className={cn("text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow)", statusTone)}>
{statusLabel}
</span>
</div>
@@ -802,19 +803,19 @@ function TranscriptToolCard({
<div className={detailsClass}>
<div className={cn("grid gap-3", compact ? "grid-cols-1" : "lg:grid-cols-2")}>
<div>
- <div className="mb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Input
</div>
- <pre className="overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px] text-foreground/80">
+ <pre className="overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro) text-foreground/80">
{formatToolPayload(block.input) || "<empty>"}
</pre>
</div>
<div>
- <div className="mb-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Result
</div>
<pre className={cn(
- "overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",
+ "overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro)",
block.status === "error" ? "text-red-700 dark:text-red-300" : "text-foreground/80",
)}>
{block.result ? formatToolPayload(block.result) : "Waiting for result..."}
@@ -856,7 +857,7 @@ function TranscriptCommandGroup({
? summarizeToolInput("command_execution", runningItem.input, density)
: null;
const statusTone = isRunning
- ? "text-cyan-700 dark:text-cyan-300"
+ ? "text-blue-700 dark:text-blue-300"
: "text-foreground/70";
return (
@@ -884,7 +885,7 @@ function TranscriptCommandGroup({
"inline-flex h-6 w-6 items-center justify-center rounded-full border shadow-sm",
index > 0 && "-ml-1.5",
isRunning
- ? "border-cyan-500/25 bg-cyan-500/[0.08] text-cyan-600 dark:text-cyan-300"
+ ? "border-blue-500/25 bg-blue-500/[0.08] text-blue-600 dark:text-blue-300"
: "border-border/70 bg-background text-foreground/55",
isRunning && "animate-pulse",
)}
@@ -894,7 +895,7 @@ function TranscriptCommandGroup({
))}
</div>
<div className="min-w-0 flex-1">
- <div className="text-[11px] font-semibold uppercase leading-none tracking-[0.1em] text-muted-foreground/70">
+ <div className="text-(length:--text-micro) font-semibold uppercase leading-none tracking-(--tracking-label) text-muted-foreground/70">
{title}
</div>
{subtitle && (
@@ -933,18 +934,18 @@ function TranscriptCommandGroup({
item.status === "error"
? "border-red-500/25 bg-red-500/[0.08] text-red-600 dark:text-red-300"
: item.status === "running"
- ? "border-cyan-500/25 bg-cyan-500/[0.08] text-cyan-600 dark:text-cyan-300"
+ ? "border-blue-500/25 bg-blue-500/[0.08] text-blue-600 dark:text-blue-300"
: "border-border/70 bg-background text-foreground/55",
)}>
<TerminalSquare className="h-3 w-3" />
</span>
- <span className={cn("font-mono break-all", compact ? "text-[11px]" : "text-xs")}>
+ <span className={cn("font-mono break-all", compact ? "text-(length:--text-micro)" : "text-xs")}>
{summarizeToolInput("command_execution", item.input, density)}
</span>
</div>
{item.result && (
<pre className={cn(
- "overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",
+ "overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro)",
item.status === "error" ? "text-red-700 dark:text-red-300" : "text-foreground/80",
)}>
{formatToolPayload(item.result)}
@@ -984,7 +985,7 @@ function TranscriptToolGroup({
? summarizeToolInput(runningItem.name, runningItem.input, density)
: null;
const statusTone = isRunning
- ? "text-cyan-700 dark:text-cyan-300"
+ ? "text-blue-700 dark:text-blue-300"
: "text-foreground/70";
return (
@@ -1007,7 +1008,7 @@ function TranscriptToolGroup({
"inline-flex h-6 w-6 items-center justify-center rounded-full border shadow-sm",
index > 0 && "-ml-1.5",
isItemRunning
- ? "border-cyan-500/25 bg-cyan-500/[0.08] text-cyan-600 dark:text-cyan-300"
+ ? "border-blue-500/25 bg-blue-500/[0.08] text-blue-600 dark:text-blue-300"
: isItemError
? "border-red-500/25 bg-red-500/[0.08] text-red-600 dark:text-red-300"
: "border-border/70 bg-background text-foreground/55",
@@ -1020,7 +1021,7 @@ function TranscriptToolGroup({
})}
</div>
<div className="min-w-0 flex-1">
- <div className={cn("font-semibold uppercase leading-none tracking-[0.1em]", compact ? "text-[10px]" : "text-[11px]", "text-muted-foreground/70")}>
+ <div className={cn("font-semibold uppercase leading-none tracking-(--tracking-label)", compact ? "text-(length:--text-nano)" : "text-(length:--text-micro)", "text-muted-foreground/70")}>
{title}
</div>
{subtitle && (
@@ -1048,16 +1049,17 @@ function TranscriptToolGroup({
item.status === "error"
? "border-red-500/25 bg-red-500/[0.08] text-red-600 dark:text-red-300"
: item.status === "running"
- ? "border-cyan-500/25 bg-cyan-500/[0.08] text-cyan-600 dark:text-cyan-300"
+ ? "border-blue-500/25 bg-blue-500/[0.08] text-blue-600 dark:text-blue-300"
: "border-border/70 bg-background text-foreground/55",
)}>
<Wrench className="h-3 w-3" />
</span>
- <span className={cn("text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground")}>
+ <span className={cn("text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground")}>
{humanizeLabel(item.name)}
</span>
- <span className={cn("text-[10px] font-semibold uppercase tracking-[0.14em]",
- item.status === "running" ? "text-cyan-700 dark:text-cyan-300"
+ <span className={cn("text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow)",
+ // Gallery feedback r1: running label uses brand blue, not cyan.
+ item.status === "running" ? runningLabelText
: item.status === "error" ? "text-red-700 dark:text-red-300"
: "text-emerald-700 dark:text-emerald-300"
)}>
@@ -1066,16 +1068,16 @@ function TranscriptToolGroup({
</div>
<div className={cn("grid gap-2 pl-7", compact ? "grid-cols-1" : "lg:grid-cols-2")}>
<div>
- <div className="mb-0.5 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">Input</div>
- <pre className="overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px] text-foreground/80">
+ <div className="mb-0.5 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">Input</div>
+ <pre className="overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro) text-foreground/80">
{formatToolPayload(item.input) || "<empty>"}
</pre>
</div>
{item.result && (
<div>
- <div className="mb-0.5 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">Result</div>
+ <div className="mb-0.5 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">Result</div>
<pre className={cn(
- "overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",
+ "overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro)",
item.status === "error" ? "text-red-700 dark:text-red-300" : "text-foreground/80",
)}>
{formatToolPayload(item.result)}
@@ -1104,8 +1106,8 @@ function TranscriptActivityRow({
<Check className="mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-300" />
) : (
<span className="relative mt-1 flex h-2.5 w-2.5 shrink-0">
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-cyan-400 opacity-70" />
- <span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-cyan-500" />
+ <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-400 opacity-70" />
+ <span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-blue-500" />
</span>
)}
<div className={cn(
@@ -1145,29 +1147,29 @@ function TranscriptEventRow({
) : block.tone === "warn" ? (
<TerminalSquare className="mt-0.5 h-3.5 w-3.5 shrink-0" />
) : (
- <span className="mt-[7px] h-1.5 w-1.5 shrink-0 rounded-full bg-current/50" />
+ <span className="mt-(--sz-7px) h-1.5 w-1.5 shrink-0 rounded-full bg-current/50" />
)}
<div className="min-w-0 flex-1">
{block.label === "result" && block.tone !== "error" ? (
<MarkdownBody
className={cn(
"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0 text-sky-700 dark:text-sky-300",
- compact ? "text-[11px] leading-5" : "text-xs leading-5",
+ compact ? "text-(length:--text-micro) leading-5" : "text-xs leading-5",
)}
externalReferences={externalReferences}
>
{block.text}
</MarkdownBody>
) : (
- <div className={cn("whitespace-pre-wrap break-words", compact ? "text-[11px]" : "text-xs")}>
- <span className="text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground/70">
+ <div className={cn("whitespace-pre-wrap break-words", compact ? "text-(length:--text-micro)" : "text-xs")}>
+ <span className="text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-label) text-muted-foreground/70">
{block.label}
</span>
{block.text ? <span className="ml-2">{block.text}</span> : null}
</div>
)}
{block.detail && (
- <pre className="mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px] text-foreground/75">
+ <pre className="mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro) text-foreground/75">
{block.detail}
</pre>
)}
@@ -1207,11 +1209,11 @@ function TranscriptDiffGroup({
onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); setOpen((v) => !v); } }}
>
<GitCompare className={compact ? "h-3.5 w-3.5" : "h-4 w-4"} />
- <span className={cn("text-[11px] font-semibold uppercase tracking-[0.14em] text-blue-700 dark:text-blue-300")}>
+ <span className={cn("text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-blue-700 dark:text-blue-300")}>
{shortFile}
</span>
{hasChanges && (
- <span className="text-[10px] tabular-nums">
+ <span className="text-(length:--text-nano) tabular-nums">
<span className="text-emerald-600 dark:text-emerald-400">+{addCount}</span>
{" "}
<span className="text-red-600 dark:text-red-400">-{removeCount}</span>
@@ -1222,7 +1224,7 @@ function TranscriptDiffGroup({
{open && (
<pre className={cn(
"mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono pl-5",
- compact ? "text-[11px]" : "text-xs",
+ compact ? "text-(length:--text-micro)" : "text-xs",
)}>
{block.hunks.map((hunk, i) => {
const key = `${i}-${hunk.changeType}`;
@@ -1292,13 +1294,13 @@ function TranscriptStderrGroup({
onClick={() => setOpen((v) => !v)}
onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); setOpen((v) => !v); } }}
>
- <span className={cn("text-[10px] font-semibold uppercase tracking-[0.14em]")}>
+ <span className={cn("text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow)")}>
{block.lines.length} log {block.lines.length === 1 ? "line" : "lines"}
</span>
{open ? <ChevronDown className="h-3.5 w-3.5" /> : <ChevronRight className="h-3.5 w-3.5" />}
</div>
{open && (
- <pre className="mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px] text-amber-700/80 dark:text-amber-300/80 pl-5">
+ <pre className="mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro) text-amber-700/80 dark:text-amber-300/80 pl-5">
{block.lines.map((line, i) => (
<span key={`${line.ts}-${i}`}>
<span className="select-none text-amber-500/50 dark:text-amber-400/40">{i > 0 ? "\n" : ""}</span>
@@ -1329,13 +1331,13 @@ function TranscriptSystemGroup({
onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); setOpen((v) => !v); } }}
>
<TerminalSquare className="h-3.5 w-3.5 shrink-0" />
- <span className="text-[10px] font-semibold uppercase tracking-[0.14em]">
+ <span className="text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-eyebrow)">
{block.lines.length} system {block.lines.length === 1 ? "message" : "messages"}
</span>
{open ? <ChevronDown className="h-3.5 w-3.5" /> : <ChevronRight className="h-3.5 w-3.5" />}
</div>
{open && (
- <pre className="mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px] text-blue-700/80 dark:text-blue-300/80 pl-5">
+ <pre className="mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro) text-blue-700/80 dark:text-blue-300/80 pl-5">
{block.lines.map((line, i) => (
<span key={`${line.ts}-${i}`}>
<span className="select-none text-blue-500/40 dark:text-blue-400/30">{i > 0 ? "\n" : ""}</span>
@@ -1362,7 +1364,7 @@ function TranscriptStdoutRow({
return (
<div>
<div className="flex items-center gap-2">
- <span className="text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <span className="text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
stdout
</span>
<button
@@ -1377,7 +1379,7 @@ function TranscriptStdoutRow({
{open && (
<pre className={cn(
"mt-2 overflow-x-auto whitespace-pre-wrap break-words font-mono text-foreground/80",
- density === "compact" ? "text-[11px]" : "text-xs",
+ density === "compact" ? "text-(length:--text-micro)" : "text-xs",
)}>
{block.text}
</pre>
@@ -1474,17 +1476,17 @@ function RawTranscriptView({
const bottomSpacer = shouldVirtualize ? Math.max(0, entries.length - range.end) * RAW_ESTIMATED_ROW_HEIGHT : 0;
return (
- <div ref={listRef} className={cn("font-mono", compact ? "space-y-1 text-[11px]" : "space-y-1.5 text-xs")}>
+ <div ref={listRef} className={cn("font-mono", compact ? "space-y-1 text-(length:--text-micro)" : "space-y-1.5 text-xs")}>
{topSpacer > 0 && <div aria-hidden="true" style={{ height: topSpacer }} />}
{visibleEntries.map((entry, idx) => (
<div
key={`${entry.kind}-${entry.ts}-${range.start + idx}`}
className={cn(
"grid gap-x-3",
- "grid-cols-[auto_1fr]",
+ "grid-cols-(--gtc-16)",
)}
>
- <span className="text-[10px] uppercase tracking-[0.18em] text-muted-foreground">
+ <span className="text-(length:--text-nano) uppercase tracking-(--tracking-caps) text-muted-foreground">
{entry.kind}
</span>
<pre className="min-w-0 whitespace-pre-wrap break-words text-foreground/80">
diff --git a/ui/src/components/ui/alert-dialog.tsx b/ui/src/components/ui/alert-dialog.tsx
index a27cf1f9b6..37e62c49b5 100644
--- a/ui/src/components/ui/alert-dialog.tsx
+++ b/ui/src/components/ui/alert-dialog.tsx
@@ -48,7 +48,7 @@ function AlertDialogContent({
<AlertDialogPrimitive.Content
data-slot="alert-dialog-content"
className={cn(
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.97] data-[state=open]:zoom-in-[0.97] fixed top-[max(1rem,env(safe-area-inset-top))] md:top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-0 md:translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-150 ease-[cubic-bezier(0.16,1,0.3,1)] outline-none sm:max-w-lg [&>*]:min-w-0",
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.97] data-[state=open]:zoom-in-[0.97] fixed top-(--sz-calc-26) md:top-(--pct-50) left-(--pct-50) z-50 grid w-full max-w-(--sz-calc-25) translate-x-(--pct-neg-50) translate-y-0 md:translate-y-(--pct-neg-50) gap-4 rounded-lg border p-6 shadow-lg duration-150 ease-(--e-cubic-bezier-0_16-1-0_3-1) outline-none sm:max-w-lg [&>*]:min-w-0",
className
)}
{...props}
diff --git a/ui/src/components/ui/avatar.tsx b/ui/src/components/ui/avatar.tsx
index 3241a31af7..d99ec418ae 100644
--- a/ui/src/components/ui/avatar.tsx
+++ b/ui/src/components/ui/avatar.tsx
@@ -48,7 +48,7 @@ function AvatarFallback({
<AvatarPrimitive.Fallback
data-slot="avatar-fallback"
className={cn(
- "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[shape=square]/avatar:rounded-md group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-[10px]",
+ "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[shape=square]/avatar:rounded-md group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-(length:--text-nano)",
className
)}
{...props}
diff --git a/ui/src/components/ui/badge.tsx b/ui/src/components/ui/badge.tsx
index beb56ed1cb..95dd74bd9a 100644
--- a/ui/src/components/ui/badge.tsx
+++ b/ui/src/components/ui/badge.tsx
@@ -5,7 +5,7 @@ import { Slot } from "radix-ui"
import { cn } from "@/lib/utils"
const badgeVariants = cva(
- "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
+ "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-(length:--rad-3) aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-(--tp-color-box-shadow) overflow-hidden",
{
variants: {
variant: {
diff --git a/ui/src/components/ui/button.tsx b/ui/src/components/ui/button.tsx
index 970a7bd71a..dac25928f6 100644
--- a/ui/src/components/ui/button.tsx
+++ b/ui/src/components/ui/button.tsx
@@ -5,7 +5,7 @@ import { Slot } from "radix-ui"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,background-color,border-color,box-shadow,opacity] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-(--tp-color-background-color-border-color-box-shadow-opacity) disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-(length:--rad-3) aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
{
variants: {
variant: {
diff --git a/ui/src/components/ui/card.tsx b/ui/src/components/ui/card.tsx
index 669de59b6f..3a67a4b7b6 100644
--- a/ui/src/components/ui/card.tsx
+++ b/ui/src/components/ui/card.tsx
@@ -20,7 +20,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="card-header"
className={cn(
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
+ "@container/card-header grid auto-rows-min grid-rows-(--gtr-1) items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-(--gtc-17) [.border-b]:pb-6",
className
)}
{...props}
diff --git a/ui/src/components/ui/checkbox.tsx b/ui/src/components/ui/checkbox.tsx
index a3ec184106..1c57b85642 100644
--- a/ui/src/components/ui/checkbox.tsx
+++ b/ui/src/components/ui/checkbox.tsx
@@ -14,7 +14,7 @@ function Checkbox({
<CheckboxPrimitive.Root
data-slot="checkbox"
className={cn(
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-(--rad-4) border shadow-xs transition-shadow outline-none focus-visible:ring-(length:--rad-3) disabled:cursor-not-allowed disabled:opacity-50",
className
)}
{...props}
diff --git a/ui/src/components/ui/command.tsx b/ui/src/components/ui/command.tsx
index d5623d19ef..4311e37a23 100644
--- a/ui/src/components/ui/command.tsx
+++ b/ui/src/components/ui/command.tsx
@@ -100,7 +100,7 @@ function CommandList({
<CommandPrimitive.List
data-slot="command-list"
className={cn(
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
+ "max-h-(--sz-300px) scroll-py-1 overflow-x-hidden overflow-y-auto",
className
)}
{...props}
diff --git a/ui/src/components/ui/dialog.tsx b/ui/src/components/ui/dialog.tsx
index 7c7e47215c..6fa11aa28d 100644
--- a/ui/src/components/ui/dialog.tsx
+++ b/ui/src/components/ui/dialog.tsx
@@ -59,7 +59,7 @@ function DialogContent({
<DialogPrimitive.Content
data-slot="dialog-content"
className={cn(
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.97] data-[state=open]:zoom-in-[0.97] data-[state=closed]:slide-out-to-top-[1%] data-[state=open]:slide-in-from-top-[1%] fixed top-[max(1rem,env(safe-area-inset-top))] md:top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-0 md:translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-150 ease-[cubic-bezier(0.16,1,0.3,1)] outline-none sm:max-w-lg [&>*]:min-w-0",
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.97] data-[state=open]:zoom-in-[0.97] data-[state=closed]:slide-out-to-top-[1%] data-[state=open]:slide-in-from-top-[1%] fixed top-(--sz-calc-26) md:top-(--pct-50) left-(--pct-50) z-50 grid w-full max-w-(--sz-calc-25) translate-x-(--pct-neg-50) translate-y-0 md:translate-y-(--pct-neg-50) gap-4 rounded-lg border p-6 shadow-lg duration-150 ease-(--e-cubic-bezier-0_16-1-0_3-1) outline-none sm:max-w-lg [&>*]:min-w-0",
className
)}
{...props}
diff --git a/ui/src/components/ui/dropdown-menu.tsx b/ui/src/components/ui/dropdown-menu.tsx
index bffc327629..2c4eed01d8 100644
--- a/ui/src/components/ui/dropdown-menu.tsx
+++ b/ui/src/components/ui/dropdown-menu.tsx
@@ -42,7 +42,7 @@ function DropdownMenuContent({
data-slot="dropdown-menu-content"
sideOffset={sideOffset}
className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-(--sz-8rem) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
className
)}
{...props}
@@ -230,7 +230,7 @@ function DropdownMenuSubContent({
<DropdownMenuPrimitive.SubContent
data-slot="dropdown-menu-sub-content"
className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-(--sz-8rem) origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
className
)}
{...props}
diff --git a/ui/src/components/ui/input.tsx b/ui/src/components/ui/input.tsx
index 89169058d0..b7833b096d 100644
--- a/ui/src/components/ui/input.tsx
+++ b/ui/src/components/ui/input.tsx
@@ -8,8 +8,8 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
type={type}
data-slot="input"
className={cn(
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-(--tp-color-box-shadow) outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-(length:--rad-3)",
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
className
)}
diff --git a/ui/src/components/ui/radio-card.tsx b/ui/src/components/ui/radio-card.tsx
index 8e3295de6b..dc465bc85c 100644
--- a/ui/src/components/ui/radio-card.tsx
+++ b/ui/src/components/ui/radio-card.tsx
@@ -33,7 +33,7 @@ export function RadioCard({
data-state={selected ? "checked" : "unchecked"}
className={cn(
"group relative flex w-full flex-col items-start gap-1 rounded-md border px-4 py-3 text-left transition-colors",
- "motion-safe:transition-[border-color,background-color] motion-safe:duration-150",
+ "motion-safe:transition-(--tp-border-color-background-color) motion-safe:duration-150",
selected
? "border-primary bg-primary/5 ring-1 ring-primary"
: "border-border hover:border-border hover:bg-accent/40",
diff --git a/ui/src/components/ui/scroll-area.tsx b/ui/src/components/ui/scroll-area.tsx
index fd6bd43792..3c7fdcf509 100644
--- a/ui/src/components/ui/scroll-area.tsx
+++ b/ui/src/components/ui/scroll-area.tsx
@@ -16,7 +16,7 @@ function ScrollArea({
>
<ScrollAreaPrimitive.Viewport
data-slot="scroll-area-viewport"
- className="flex-1 min-h-0 w-full focus-visible:ring-ring/50 rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:!block"
+ className="flex-1 min-h-0 w-full focus-visible:ring-ring/50 rounded-[inherit] transition-(--tp-color-box-shadow) outline-none focus-visible:ring-(length:--rad-3) focus-visible:outline-1 [&>div]:!block"
>
{children}
</ScrollAreaPrimitive.Viewport>
diff --git a/ui/src/components/ui/select.tsx b/ui/src/components/ui/select.tsx
index 8d712df9fa..fa2a98a1eb 100644
--- a/ui/src/components/ui/select.tsx
+++ b/ui/src/components/ui/select.tsx
@@ -35,7 +35,7 @@ function SelectTrigger({
data-slot="select-trigger"
data-size={size}
className={cn(
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-base md:text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-base md:text-sm whitespace-nowrap shadow-xs transition-(--tp-color-box-shadow) outline-none focus-visible:ring-(length:--rad-3) disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
@@ -60,7 +60,7 @@ function SelectContent({
<SelectPrimitive.Content
data-slot="select-content"
className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-(--sz-8rem) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
@@ -74,7 +74,7 @@ function SelectContent({
className={cn(
"p-1",
position === "popper" &&
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
+ "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"
)}
>
{children}
diff --git a/ui/src/components/ui/tabs.tsx b/ui/src/components/ui/tabs.tsx
index 2c5f700866..03067ae166 100644
--- a/ui/src/components/ui/tabs.tsx
+++ b/ui/src/components/ui/tabs.tsx
@@ -24,7 +24,7 @@ function Tabs({
}
const tabsListVariants = cva(
- "p-[3px] group-data-[orientation=horizontal]/tabs:h-9 group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
+ "p-(--sz-3px) group-data-[orientation=horizontal]/tabs:h-9 group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
{
variants: {
variant: {
@@ -62,10 +62,10 @@ function TabsTrigger({
<TabsPrimitive.Trigger
data-slot="tabs-trigger"
className={cn(
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow] group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-(--sz-calc-27) flex-1 items-center justify-center gap-1.5 border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-(--tp-color-background-color-border-color-box-shadow) group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-(length:--rad-3) focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground",
- "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
+ "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-(--sz-neg-5px) group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
className
)}
{...props}
diff --git a/ui/src/components/ui/textarea.tsx b/ui/src/components/ui/textarea.tsx
index 33f75628e5..cd2bda615d 100644
--- a/ui/src/components/ui/textarea.tsx
+++ b/ui/src/components/ui/textarea.tsx
@@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
<textarea
data-slot="textarea"
className={cn(
- "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 min-w-0 w-full max-w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 min-w-0 w-full max-w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-(--tp-color-box-shadow) outline-none focus-visible:ring-(length:--rad-3) disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className
)}
{...props}
diff --git a/ui/src/components/ui/toggle-switch.tsx b/ui/src/components/ui/toggle-switch.tsx
index d4995f2556..de471adf32 100644
--- a/ui/src/components/ui/toggle-switch.tsx
+++ b/ui/src/components/ui/toggle-switch.tsx
@@ -8,6 +8,14 @@ export interface ToggleSwitchProps
size?: "default" | "lg";
}
+/*
+ * Custom API (checked/onCheckedChange button, no Radix dep) with the shadcn
+ * radix-luma Switch's capsule form: border-2 track, oval thumb, bg-input
+ * off-state. Deliberate deviation from the registry: the on-state is the
+ * status-system green (var(--status-task-done)), not bg-primary — user
+ * ruling, DECISION-SHEET "toggle form" note. Do not swap for the registry
+ * Switch without revisiting that ruling (C7).
+ */
export const ToggleSwitch = React.forwardRef<
HTMLButtonElement,
ToggleSwitchProps
@@ -27,12 +35,13 @@ export const ToggleSwitch = React.forwardRef<
data-slot="toggle"
disabled={disabled}
className={cn(
- "relative inline-flex shrink-0 items-center rounded-full transition-colors",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
+ "relative inline-flex shrink-0 items-center rounded-full border-2 transition-all outline-none",
+ "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30",
"disabled:cursor-not-allowed disabled:opacity-50",
- // Track: larger on mobile (<640px), standard on desktop
- isLg ? "h-7 w-12 sm:h-6 sm:w-11" : "h-6 w-10 sm:h-5 sm:w-9",
- checked ? "bg-green-600" : "bg-muted",
+ isLg ? "h-6 w-12" : "h-5 w-11",
+ checked
+ ? "border-(--status-task-done) bg-(--status-task-done)"
+ : "border-transparent bg-input/90",
className,
)}
onClick={() => onCheckedChange(!checked)}
@@ -40,15 +49,9 @@ export const ToggleSwitch = React.forwardRef<
>
<span
className={cn(
- "pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform",
- // Thumb
- isLg ? "size-5.5 sm:size-5" : "size-4.5 sm:size-3.5",
- // Slide position
- checked
- ? isLg
- ? "translate-x-5 sm:translate-x-5"
- : "translate-x-5 sm:translate-x-4.5"
- : "translate-x-0.5",
+ "pointer-events-none inline-block rounded-full bg-background shadow-sm transition-transform not-dark:bg-clip-padding dark:bg-foreground",
+ isLg ? "h-5 w-7" : "h-4 w-6",
+ checked ? "translate-x-4" : "translate-x-0",
)}
/>
</button>
diff --git a/ui/src/components/ui/tooltip.tsx b/ui/src/components/ui/tooltip.tsx
index d80a14468c..ae0ea03d21 100644
--- a/ui/src/components/ui/tooltip.tsx
+++ b/ui/src/components/ui/tooltip.tsx
@@ -48,7 +48,7 @@ function TooltipContent({
{...props}
>
{children}
- <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
+ <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-(--sz-calc-28) rotate-45 rounded-(--rad-2)" />
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>
)
diff --git a/ui/src/index.css b/ui/src/index.css
index 0e5e2cf6ff..d836dd7b2b 100644
--- a/ui/src/index.css
+++ b/ui/src/index.css
@@ -54,15 +54,22 @@
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
- --radius-sm: 0.375rem;
- --radius-md: 0.5rem;
- --radius-lg: 0px;
- --radius-xl: 0px;
+ /* Monotonic radius ladder, all derived from the single --radius knob
+ (DECISION-SHEET B4): retune the whole app's corner language by editing
+ --radius alone. Replaces the legacy square-brand lg/xl = 0px. */
+ --radius-sm: calc(var(--radius) - 4px);
+ --radius-md: calc(var(--radius) - 2px);
+ --radius-lg: var(--radius);
+ --radius-xl: calc(var(--radius) + 4px);
+ --font-heading: var(--font-sans);
+ --radius-2xl: calc(var(--radius) * 1.8);
+ --radius-3xl: calc(var(--radius) * 2.2);
+ --radius-4xl: calc(var(--radius) * 2.6);
}
:root {
color-scheme: light;
- --radius: 0;
+ --radius: 0.45rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
@@ -82,11 +89,11 @@
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
- --chart-1: oklch(0.646 0.222 41.116);
- --chart-2: oklch(0.6 0.118 184.704);
- --chart-3: oklch(0.398 0.07 227.392);
- --chart-4: oklch(0.828 0.189 84.429);
- --chart-5: oklch(0.769 0.188 70.08);
+ --chart-1: oklch(0.87 0 0);
+ --chart-2: oklch(0.556 0 0);
+ --chart-3: oklch(0.439 0 0);
+ --chart-4: oklch(0.371 0 0);
+ --chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
@@ -182,7 +189,7 @@
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
- --primary: oklch(0.985 0 0);
+ --primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
@@ -190,24 +197,24 @@
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
- --destructive: oklch(0.637 0.237 25.331);
+ --destructive: oklch(0.637 0.237 25.331); /* Gallery feedback round 1: user preferred master's original dark destructive red over the preset's softer 0.704 0.191 22.216. */
--destructive-foreground: oklch(0.985 0 0);
- --border: oklch(0.269 0 0);
- --input: oklch(0.269 0 0);
- --ring: oklch(0.439 0 0);
- --chart-1: oklch(0.488 0.243 264.376);
- --chart-2: oklch(0.696 0.17 162.48);
- --chart-3: oklch(0.769 0.188 70.08);
- --chart-4: oklch(0.627 0.265 303.9);
- --chart-5: oklch(0.645 0.246 16.439);
- --sidebar: oklch(0.145 0 0);
+ --border: oklch(1 0 0 / 10%);
+ --input: oklch(1 0 0 / 15%);
+ --ring: oklch(0.556 0 0);
+ --chart-1: oklch(0.87 0 0);
+ --chart-2: oklch(0.556 0 0);
+ --chart-3: oklch(0.439 0 0);
+ --chart-4: oklch(0.371 0 0);
+ --chart-5: oklch(0.269 0 0);
+ --sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
- --sidebar-border: oklch(0.269 0 0);
- --sidebar-ring: oklch(0.439 0 0);
+ --sidebar-border: oklch(1 0 0 / 10%);
+ --sidebar-ring: oklch(0.556 0 0);
--chip-match-title-bg: oklch(0.27 0.04 265 / 0.5);
--chip-match-title-fg: oklch(0.78 0.10 265);
--chip-match-title-border: oklch(0.4 0.06 265);
@@ -257,14 +264,15 @@
@layer base {
* {
- @apply border-border;
+ @apply border-border outline-ring/50;
}
html {
height: 100%;
-webkit-tap-highlight-color: color-mix(in oklab, var(--foreground) 20%, transparent);
+ @apply font-sans;
}
body {
- @apply bg-background text-foreground antialiased;
+ @apply antialiased bg-background text-foreground;
font-family: var(--font-sans);
height: 100%;
overflow: hidden;
@@ -1429,3 +1437,477 @@ span.paperclip-mention-chip[data-mention-kind="external-object"] {
.status-fill {
background-color: var(--sc);
}
+
+/* ── Extracted verbatim tokens (Phase 2, design/token-extraction) ── */
+/* Batch 1/4: color literals only. Reused-from-existing-token sites (see
+ TOKEN-AUDIT.md section 1.1) are NOT duplicated here — they reference
+ --status-task-in_progress / --status-task-done directly at the call site.
+
+ Allowlist (sites intentionally left as hardcoded / functional literals,
+ NOT converted to tokens — each also carries an inline
+ `token-extraction: allowlisted` comment at the site):
+ - pages/CompanyEnvironments.tsx — xterm.js terminal theme config; functional JS values, third-party.
+ - pages/CompanySettings.tsx — <input type="color"> value; functional form control, not a rendered value.
+ - components/issue-properties/IssueProperties.tsx (newLabelColor) — color-picker seed persisted into label-create payload.
+ - pages/CompanySkills.tsx (DISCOVERY_ACCENTS) — persisted/compared skill.color JS data, not just rendered.
+ - components/IssueColumns.tsx (accentColor fallback) — also feeds pickTextColorForPillBg() contrast math.
+ - components/CompanyPatternIcon.tsx — canvas fillStyle computed at runtime from numeric props, not a static literal.
+ - components/FileViewerSheet.tsx — half-migrated var(--paperclip-code-highlight-*, fallback) pattern at the time of Batch 1; RESOLVED in Batch 4 via *-resolved wrapper tokens (see the Batch 4 MISC token block below) — no longer allowlisted.
+ - pages/InviteUxLab.tsx (brandColor prop, x2) — demo/showcase-only prop feeding CompanyPatternIcon's hexToHue() color math, not a rendered CSS value.
+*/
+:root {
+ --hex-959596: #959596; /* Muted feed actor/verb/title text (ActivityFeed.tsx, FeedCard.tsx) — PRIOR-ART-flagged gap cluster, no existing token match. */
+ --hex-1d1d1d: #1d1d1d; /* OnboardingWizard.tsx dark decorative panel background, singleton. */
+ --hex-22d3ee: #22d3ee; /* OrgChart.tsx agent status dot — 'running' (independent palette from --status-agent-*, see TOKEN-AUDIT.md 1.2). */
+ --hex-4ade80: #4ade80; /* OrgChart.tsx agent status dot — 'active'. */
+ --hex-facc15: #facc15; /* OrgChart.tsx agent status dot — 'paused' / 'idle' (shared value). */
+ --hex-f87171: #f87171; /* OrgChart.tsx agent status dot — 'error'. */
+ --hex-a3a3a3: #a3a3a3; /* OrgChart.tsx agent status dot — 'terminated' + defaultDotColor fallback. */
+ --hex-ef4444: #ef4444; /* ActivityCharts.tsx — priority 'critical'; also the <0.5 success-rate bar tint. (Chart STATUS hues re-pointed at --status-task-* in DECISION-SHEET.md B5; priority/success series stay independent.) */
+ --hex-f97316: #f97316; /* ActivityCharts.tsx — priority 'high'. */
+ --hex-eab308: #eab308; /* ActivityCharts.tsx — priority 'medium'; also the 0.5-0.8 success-rate bar tint. */
+ --hex-6b7280: #6b7280; /* ActivityCharts.tsx — priority 'low' + unknown-status statusColors fallback. */
+ --hex-10b981: #10b981; /* ActivityCharts.tsx — >=0.8 success-rate bar tint. */
+ --project-none: #64748b; /* Semantic rename of --hex-64748b (DECISION-SHEET.md A3, value unchanged). 'No project assigned' muted-slate fallback (TOKEN-AUDIT.md 1.3) across Routines/MarkdownEditor/RoutineRunVariablesDialog/RoutineList/IssueColumns/editable-sections; also ActivityCharts.tsx status 'backlog'. */
+ --project-seed: #6366f1; /* Semantic rename of --hex-6366f1 (DECISION-SHEET.md A3, value unchanged). Project-color-fallback indigo seed default (ProjectDetail/PipelineSettings/IssueProperties/NewIssueDialog) — new-project-color-picker-seed family per TOKEN-AUDIT.md 1.3. */
+ --liveness-blue: #2563eb; /* DECISION-SHEET.md A6: IssueChatThread.tsx human-message 'liveness blue' bubble (PAP-95 rev 5). Same value as --status-task-in_progress by coincidence, decoupled on purpose so a future status-hue change doesn't drag the chat bubble along. */
+ --gradient-extract-1: linear-gradient(180deg,rgba(255,80,80,0.12),rgba(255,255,255,0.02)); /* Dashboard.tsx budget-alert card gradient. */
+ --gradient-extract-2: linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02)); /* Costs.tsx subtle white card gradient. */
+ --gradient-extract-3: radial-gradient(circle at top left,rgba(244,114,182,0.08),transparent 35%),radial-gradient(circle at bottom right,rgba(56,189,248,0.1),transparent 32%); /* AccountingModelCard.tsx decorative overlay. */
+ --gradient-extract-4: linear-gradient(180deg,rgba(255,70,70,0.10),rgba(255,255,255,0.02)); /* BudgetIncidentCard.tsx incident-card gradient. */
+ --gradient-extract-7: radial-gradient(circle at top right,rgba(255,255,255,0.22),transparent 34%),radial-gradient(circle at bottom left,rgba(255,255,255,0.08),transparent 36%); /* ProfileSettings.tsx:162 decorative overlay. */
+}
+
+/* ── Extracted verbatim TYPE tokens (Phase 2 Batch 2, design/token-extraction) ── */
+/* Batch 2/4: font-size + letter-spacing + line-height literals, verbatim
+ (no normalizing — 9/10/11/12/13/14/15px and 0.08-0.24em all stay distinct;
+ the human scale-collapse decision comes later per DESIGN.md/TOKEN-AUDIT.md).
+
+ Allowlist (sites intentionally left as hardcoded / functional literals,
+ NOT converted to tokens — each also carries an inline
+ `token-extraction: allowlisted` comment at the site):
+ - pages/CompanyEnvironments.tsx (fontSize: 12) — xterm.js terminal theme
+ config; functional third-party numeric option, not a rendered CSS value.
+ Same allowlisted object as Batch 1's color entry for this file.
+ - pages/CompanySkills.tsx (fontSize: Math.round(size * 0.42)) — computed at
+ runtime from a prop; not a static literal, nothing to extract.
+*/
+:root {
+ /* ── Named type ladder (DECISION-SHEET.md B3, preset-tune session) ──
+ Collapses the 8 verbatim --fs-* font-size tokens and 9 --ls-*
+ letter-spacing tokens (extracted in Batch 2 above) into named steps.
+ Codemod: scripts/codemod-type-ladder.mjs. Mapping:
+ 9px + 10px -> --text-nano (9 -> 10 bump per locked ladder)
+ 11px + 0.7rem -> --text-micro (0.7rem = 11.2px -> 11px)
+ 12px -> Tailwind `text-xs` class (12px exact match; scale
+ class preferred over a redundant token per DESIGN.md)
+ 13px -> --text-compact (PRIOR-ART named this tier "sm 13",
+ but that collides with Tailwind text-sm = 14px,
+ hence "compact")
+ 14px + 15px -> Tailwind `text-sm` class (14px; 15 -> 14)
+ Letter-spacing, nearest-step mapping:
+ 0.08em, 0.1em -> --tracking-label
+ 0.12em, 0.14em, 0.16em -> --tracking-eyebrow
+ 0.18em, 0.2em, 0.22em, 0.24em -> --tracking-caps
+ NOTE: sites moved to text-xs/text-sm also pick up the Tailwind scale
+ line-height (text-(length:--x) set font-size only) — intentional,
+ reviewed on the post-preset contact sheet. */
+ --text-nano: 10px;
+ --text-micro: 11px;
+ --text-compact: 13px;
+ --tracking-label: 0.08em;
+ --tracking-eyebrow: 0.14em;
+ --tracking-caps: 0.2em;
+}
+
+/* ── Extracted verbatim SIZE/SPACING/RADIUS/SHADOW tokens (Phase 2 Batch 3, design/token-extraction) ── */
+/* Batch 3/4: width/height/min/max, padding/margin/gap/inset/translate,
+ radius, ring/outline-width, and shadow literals, verbatim (no
+ normalizing — the human scale-collapse decision comes later per
+ DESIGN.md/TOKEN-AUDIT.md). --sz-* is ONE shared family across
+ w/h/p/m/gap/inset/translate so identical values dedupe regardless of
+ which property used them. --rad-* is likewise shared across
+ rounded, ring, and outline widths.
+
+ Allowlist (sites intentionally left as hardcoded / functional literals
+ or var()-only passthrough with no new token minted):
+ - components/ui/scroll-area.tsx (rounded-[inherit]) — CSS keyword, not a
+ literal value; nothing to extract.
+ - Bracket values that only wrap var(--radix-*-trigger-width/height) or
+ var(--new-issue-dialog-height) etc. are rewritten to the bare paren
+ form directly (e.g. w-(--radix-popover-trigger-width)) — these are
+ runtime library/component variables, not design values, so no new
+ --sz-* token is minted for them (see TOKEN-AUDIT.md extraction log
+ for the full site list).
+*/
+:root {
+ --sz-320px: 320px; /* Extracted from ui/src/components/ActiveAgentsPanel.tsx (h-[320px]). */
+ --sz-3px: 3px; /* Extracted from ui/src/components/ActivityCharts.tsx (gap-[3px]). */
+ --sz-calc-1: calc(100% - 1.5rem); /* Extracted from ui/src/components/ActivityFeed.tsx (w-[calc(100%-1.5rem)]). */
+ --sz-calc-2: calc(100% - 0.75rem); /* Extracted from ui/src/components/ActivityFeed.tsx (w-[calc(100%-0.75rem)]). */
+ --sz-16rem: 16rem; /* Extracted from ui/src/components/ActivityFeed.tsx (max-w-[16rem]). */
+ --sz-18px: 18px; /* Extracted from ui/src/components/ActivityFeed.tsx (p-[18px]). */
+ --sz-44px: 44px; /* Extracted from ui/src/components/AgentConfigForm.tsx (min-h-[44px]). */
+ --sz-88px: 88px; /* Extracted from ui/src/components/AgentConfigForm.tsx (min-h-[88px]). */
+ --sz-240px: 240px; /* Extracted from ui/src/components/AgentConfigForm.tsx (max-h-[240px]). */
+ --sz-10_5rem: 10.5rem; /* Extracted from ui/src/components/BlockedInboxView.tsx (w-[10.5rem]). */
+ --sz-150px: 150px; /* Extracted from ui/src/components/BlockedInboxView.tsx (w-[150px]). */
+ --sz-5_75rem: 5.75rem; /* Extracted from ui/src/components/BlockedInboxView.tsx (w-[5.75rem]). */
+ --sz-12rem: 12rem; /* Extracted from ui/src/components/BlockedInboxView.tsx (max-w-[12rem]). */
+ --sz-200px: 200px; /* Extracted from ui/src/components/ChatComposer.test.tsx (max-h-[200px]). */
+ --sz-22px: 22px; /* Extracted from ui/src/components/ChatComposer.test.tsx (max-h-[22px]). */
+ --sz-60px: 60px; /* Extracted from ui/src/components/CommentThread.tsx (min-h-[60px]). */
+ --sz-220px: 220px; /* Extracted from ui/src/components/CompanySwitcher.tsx (w-[220px]). */
+ --sz-88vh: 88vh; /* Extracted from ui/src/components/DocumentAnnotationPanel.tsx (max-h-[88vh]). */
+ --sz-80vh: 80vh; /* Extracted from ui/src/components/DocumentAnnotationPanel.tsx (max-h-[80vh]). */
+ --sz-360px: 360px; /* Extracted from ui/src/components/DocumentAnnotationPanel.tsx (w-[360px]). */
+ --sz-85vh: 85vh; /* Extracted from ui/src/components/DocumentDiffModal.tsx (max-h-[85vh]). */
+ --sz-1px: 1px; /* Extracted from ui/src/components/EntityRow.tsx (top-[1px]). */
+ --sz-100px: 100px; /* Extracted from ui/src/components/ExecutionParticipantPicker.tsx (max-w-[100px]). */
+ --sz-calc-3: min(840px,calc(100dvh - 2rem)); /* Extracted from ui/src/components/FileViewerSheet.tsx (h-[min(840px,calc(100dvh-2rem))]). */
+ --sz-calc-4: calc(100vw - 2rem); /* Extracted from ui/src/components/FileViewerSheet.tsx (w-[calc(100vw-2rem)]). */
+ --sz-calc-5: min(1280px,calc(100vw - 2rem)); /* Extracted from ui/src/components/FileViewerSheet.tsx (max-w-[min(1280px,calc(100vw-2rem))]). */
+ --sz-94vw: 94vw; /* Extracted from ui/src/components/FileViewerSheet.tsx (w-[94vw]). */
+ --sz-1280px: 1280px; /* Extracted from ui/src/components/FileViewerSheet.tsx (max-w-[1280px]). */
+ --sz-60vh: 60vh; /* Extracted from ui/src/components/FrontDoor.tsx (min-h-[60vh]). */
+ --sz-calc-6: min(20rem,calc(100vw - 2rem)); /* Extracted from ui/src/components/InlineEntitySelector.tsx (w-[min(20rem,calc(100vw-2rem))]). */
+ --sz-18rem: 18rem; /* Extracted from ui/src/components/IssueBlockedNotice.tsx (max-w-[18rem]). */
+ --sz-70vh: 70vh; /* Extracted from ui/src/components/IssueChatThread.test.tsx (max-h-[70vh]). */
+ --sz-calc-7: calc(100% - 0.5rem); /* Extracted from ui/src/components/IssueChatThread.test.tsx (max-w-[calc(100%-0.5rem)]). */
+ --sz-28dvh: 28dvh; /* Extracted from ui/src/components/IssueChatThread.test.tsx (max-h-[28dvh]). */
+ --sz-72px: 72px; /* Extracted from ui/src/components/IssueChatThread.test.tsx (min-h-[72px]). */
+ --sz-15px: 15px; /* Extracted from ui/src/components/IssueChatThread.test.tsx (p-[15px]). */
+ --sz-calc-8: calc(env(safe-area-inset-bottom) + 20px); /* Extracted from ui/src/components/IssueChatThread.test.tsx (bottom-[calc(env(safe-area-inset-bottom)+20px)]). */
+ --sz-300px: 300px; /* Extracted from ui/src/components/IssueColumns.tsx (w-[300px]). */
+ --sz-calc-9: min(80vh,42rem); /* Extracted from ui/src/components/IssueFiltersPopover.test.tsx (max-h-[min(80vh,42rem)]). */
+ --sz-calc-10: min(780px,calc(100vw - 2rem)); /* Extracted from ui/src/components/IssueFiltersPopover.tsx (w-[min(780px,calc(100vw-2rem))]). */
+ --sz-24ch: 24ch; /* Extracted from ui/src/components/IssuePlanDecompositionsSection.tsx (max-w-[24ch]). */
+ --sz-calc-11: calc(0.5rem - 2px); /* Extracted from ui/src/components/IssueRow.tsx (pl-[calc(theme(spacing.2)-2px)]). */
+ --sz-calc-12: calc(0.25rem - 2px); /* Extracted from ui/src/components/IssueRow.tsx (pl-[calc(theme(spacing.1)-2px)]). */
+ --sz-calc-13: calc(0.75rem + 0.5rem); /* Extracted from ui/src/components/IssueRow.tsx (ml-[calc(theme(spacing.3)+theme(spacing.2))]). */
+ --sz-140px: 140px; /* Extracted from ui/src/components/JsonSchemaForm.tsx (min-h-[140px]). */
+ --sz-52px: 52px; /* Extracted from ui/src/components/KanbanBoard.tsx (w-[52px]). */
+ --sz-48px: 48px; /* Extracted from ui/src/components/KanbanBoard.tsx (min-w-[48px]). */
+ --sz-260px: 260px; /* Extracted from ui/src/components/KanbanBoard.tsx (min-w-[260px]). */
+ --sz-120px: 120px; /* Extracted from ui/src/components/KanbanBoard.tsx (min-h-[120px]). */
+ --sz-safe-top: env(safe-area-inset-top); /* Extracted from ui/src/components/Layout.tsx (pt-[env(safe-area-inset-top)]). */
+ --sz-calc-14: calc(5rem + env(safe-area-inset-bottom)); /* Extracted from ui/src/components/Layout.tsx (pb-[calc(5rem+env(safe-area-inset-bottom))]). */
+ --sz-38ch: 38ch; /* Extracted from ui/src/components/MarkdownBody.test.tsx (max-w-[38ch]). */
+ --sz-208px: 208px; /* Extracted from ui/src/components/MarkdownEditor.test.tsx (max-h-[208px]). */
+ --sz-180px: 180px; /* Extracted from ui/src/components/MarkdownEditor.tsx (min-w-[180px]). */
+ --sz-calc-15: calc(100vw - 16px); /* Extracted from ui/src/components/MarkdownEditor.tsx (max-w-[calc(100vw-16px)]). */
+ --sz-66px: 66px; /* Extracted from ui/src/components/MembershipAction.tsx (w-[66px]). */
+ --sz-safe-bottom: env(safe-area-inset-bottom); /* Extracted from ui/src/components/MobileBottomNav.tsx (pb-[env(safe-area-inset-bottom)]). */
+ --sz-calc-16: min(calc(100dvh - 2rem),46rem); /* Extracted from ui/src/components/NewAgentDialog.tsx (max-h-[min(calc(100dvh-2rem),46rem)]). */
+ --sz-24rem: 24rem; /* Extracted from ui/src/components/NewAgentDialog.tsx (h-[24rem]). */
+ --sz-50vh: 50vh; /* Extracted from ui/src/components/NewGoalDialog.tsx (max-h-[50vh]). */
+ --sz-8_5rem: 8.5rem; /* Extracted from ui/src/components/NewIssueDialog.tsx (min-w-[8.5rem]). */
+ --sz-160px: 160px; /* Extracted from ui/src/components/NewProjectDialog.tsx (max-w-[160px]). */
+ --sz-80px: 80px; /* Extracted from ui/src/components/OnboardingWizard.tsx (min-h-[80px]). */
+ --sz-calc-17: calc(100vh - 4rem); /* Extracted from ui/src/components/PageSkeleton.tsx (h-[calc(100vh-4rem)]). */
+ --sz-2px: 2px; /* Extracted from ui/src/components/QuotaBar.tsx (w-[2px]). */
+ --sz-calc-18: calc(100dvh - 2rem); /* Extracted from ui/src/components/RoutineRunVariablesDialog.test.tsx (max-h-[calc(100dvh-2rem)]). */
+ --sz-calc-19: calc(1rem + env(safe-area-inset-bottom)); /* Extracted from ui/src/components/RoutineRunVariablesDialog.test.tsx (pb-[calc(1rem+env(safe-area-inset-bottom))]). */
+ --sz-calc-20: min(calc(100dvh - 2rem),42rem); /* Extracted from ui/src/components/RoutineRunVariablesDialog.tsx (max-h-[min(calc(100dvh-2rem),42rem)]). */
+ --sz-100dvh: 100dvh; /* Extracted from ui/src/components/RoutineSubSidebar.tsx (max-h-[100dvh]). */
+ --sz-calc-21: calc(1.5rem + 5rem + env(safe-area-inset-bottom)); /* Extracted from ui/src/components/ScrollToBottom.tsx (bottom-[calc(1.5rem+5rem+env(safe-area-inset-bottom))]). */
+ --sz-calc-22: calc(320px + 1.5rem); /* Extracted from ui/src/components/ScrollToBottom.tsx (right-[calc(320px+1.5rem)]). */
+ --sz-calc-23: min(32rem,calc(100vw - 2rem)); /* Extracted from ui/src/components/SearchableSelect.tsx (max-w-[min(32rem,calc(100vw-2rem))]). */
+ --sz-277px: 277px; /* Extracted from ui/src/components/SidebarAccountMenu.test.tsx (w-[277px]). */
+ --sz-calc-24: calc(100vw - 1rem); /* Extracted from ui/src/components/SidebarAccountMenu.tsx (max-w-[calc(100vw-1rem)]). */
+ --sz-36px: 36px; /* Extracted from ui/src/components/WorkspaceFileBrowser.tsx (min-h-[36px]). */
+ --sz-32px: 32px; /* Extracted from ui/src/components/WorkspaceFileBrowser.tsx (min-h-[32px]). */
+ --sz-30px: 30px; /* Extracted from ui/src/components/WorkspaceFileBrowser.tsx (min-h-[30px]). */
+ --sz-8px: 8px; /* Extracted from ui/src/components/artifacts/ArtifactGroupCard.tsx (translate-x-[8px]). */
+ --sz-4px: 4px; /* Extracted from ui/src/components/artifacts/ArtifactGroupCard.tsx (translate-x-[4px]). */
+ --sz-34px: 34px; /* Extracted from ui/src/components/environment-variables-editor/SecretPicker.tsx (h-[34px]). */
+ --sz-11rem: 11rem; /* Extracted from ui/src/components/issue-properties/IssueProperties.tsx (min-w-[11rem]). */
+ --sz-32rem: 32rem; /* Extracted from ui/src/components/issue-properties/IssueProperties.tsx (w-[32rem]). */
+ --sz-280px: 280px; /* Extracted from ui/src/components/timeline/WorkTimelineChart.tsx (max-w-[280px]). */
+ --sz-7px: 7px; /* Extracted from ui/src/components/transcript/RunTranscriptView.tsx (mt-[7px]). */
+ --sz-calc-25: calc(100% - 2rem); /* Extracted from ui/src/components/ui/alert-dialog.tsx (max-w-[calc(100%-2rem)]). */
+ --sz-calc-26: max(1rem,env(safe-area-inset-top)); /* Extracted from ui/src/components/ui/alert-dialog.tsx (top-[max(1rem,env(safe-area-inset-top))]). */
+ --sz-8rem: 8rem; /* Extracted from ui/src/components/ui/dropdown-menu.tsx (min-w-[8rem]). */
+ --sz-calc-27: calc(100% - 1px); /* Extracted from ui/src/components/ui/tabs.tsx (h-[calc(100%-1px)]). */
+ --sz-neg-5px: -5px; /* Extracted from ui/src/components/ui/tabs.tsx (bottom-[-5px]). */
+ --sz-calc-28: calc(-50% - 2px); /* Extracted from ui/src/components/ui/tooltip.tsx (translate-y-[calc(-50%_-_2px)]). */
+ --sz-420px: 420px; /* Extracted from ui/src/pages/AgentDetail.tsx (min-h-[420px]). */
+ --sz-30rem: 30rem; /* Extracted from ui/src/pages/AgentDetail.tsx (w-[30rem]). */
+ --sz-38rem: 38rem; /* Extracted from ui/src/pages/AgentDetail.tsx (max-h-[38rem]). */
+ --sz-7rem: 7rem; /* Extracted from ui/src/pages/Agents.test.tsx (min-w-[7rem]). */
+ --sz-calc-29: calc(100% + 3rem); /* Extracted from ui/src/pages/BoardChat.tsx (h-[calc(100%+3rem)]). */
+ --sz-22rem: 22rem; /* Extracted from ui/src/pages/CompanyEnvironments.tsx (h-[22rem]). */
+ --sz-560px: 560px; /* Extracted from ui/src/pages/CompanyExport.tsx (min-h-[560px]). */
+ --sz-520px: 520px; /* Extracted from ui/src/pages/CompanyExport.tsx (min-h-[520px]). */
+ --sz-480px: 480px; /* Extracted from ui/src/pages/CompanyExport.tsx (max-h-[480px]). */
+ --sz-calc-30: calc(100vh - 12rem); /* Extracted from ui/src/pages/CompanyExport.tsx (h-[calc(100vh-12rem)]). */
+ --sz-calc-31: calc(100vh - 16rem); /* Extracted from ui/src/pages/CompanyImport.tsx (h-[calc(100vh-16rem)]). */
+ --sz-calc-32: min(28rem,70vh); /* Extracted from ui/src/pages/CompanySkills.tsx (max-h-[min(28rem,70vh)]). */
+ --sz-11_5rem: 11.5rem; /* Extracted from ui/src/pages/CompanySkills.tsx (min-h-[11.5rem]). */
+ --sz-calc-33: calc(100dvh - 6rem); /* Extracted from ui/src/pages/CompanySkills.tsx (h-[calc(100dvh-6rem)]). */
+ --sz-calc-34: clamp(14rem,45vh,28rem); /* Extracted from ui/src/pages/CompanySkills.tsx (h-[clamp(14rem,45vh,28rem)]). */
+ --sz-400px: 400px; /* Extracted from ui/src/pages/CompanySkills.tsx (min-h-[400px]). */
+ --sz-calc-35: min(34rem,55vw); /* Extracted from ui/src/pages/CompanySkills.tsx (max-w-[min(34rem,55vw)]). */
+ --sz-640px: 640px; /* Extracted from ui/src/pages/DesignGuide.tsx (max-w-[640px]). */
+ --sz-28rem: 28rem; /* Extracted from ui/src/pages/DesignGuide.tsx (w-[28rem]). */
+ --sz-170px: 170px; /* Extracted from ui/src/pages/Inbox.tsx (w-[170px]). */
+ --sz-calc-36: min(28rem,65vh); /* Extracted from ui/src/pages/InstanceExperimentalSettings.tsx (max-h-[min(28rem,65vh)]). */
+ --sz-calc-37: min(100%,22rem); /* Extracted from ui/src/pages/IssueDetail.tsx (w-[min(100%,22rem)]). */
+ --sz-85dvh: 85dvh; /* Extracted from ui/src/pages/IssueDetail.tsx (max-h-[85dvh]). */
+ --sz-calc-38: calc(100dvh - 9rem); /* Extracted from ui/src/pages/OrgChart.tsx (h-[calc(100dvh-9rem)]). */
+ --sz-calc-39: calc(100dvh - 3.5rem); /* Extracted from ui/src/pages/PipelineSettings.tsx (max-h-[calc(100dvh-3.5rem)]). */
+ --sz-calc-40: min(24rem,calc(100vw - 2rem)); /* Extracted from ui/src/pages/PipelineSettings.tsx (w-[min(24rem,calc(100vw-2rem))]). */
+ --sz-780px: 780px; /* Extracted from ui/src/pages/Pipelines.tsx (min-w-[780px]). */
+ --sz-148px: 148px; /* Extracted from ui/src/pages/Pipelines.tsx (w-[148px]). */
+ --sz-11px: 11px; /* Extracted from ui/src/pages/Pipelines.tsx (h-[11px]). */
+ --sz-9px: 9px; /* Extracted from ui/src/pages/Pipelines.tsx (h-[9px]). */
+ --sz-720px: 720px; /* Extracted from ui/src/pages/RunTranscriptUxLab.tsx (max-h-[720px]). */
+ --sz-460px: 460px; /* Extracted from ui/src/pages/RunTranscriptUxLab.tsx (max-h-[460px]). */
+ --sz-960px: 960px; /* Extracted from ui/src/pages/Search.tsx (max-w-[960px]). */
+ --sz-70px: 70px; /* Extracted from ui/src/pages/Secrets.tsx (min-h-[70px]). */
+ --sz-calc-41: min(520px,calc(100vw - 2rem)); /* Extracted from ui/src/pages/Secrets.tsx (w-[min(520px,calc(100vw-2rem))]). */
+ --sz-calc-42: min(80vh,34rem); /* Extracted from ui/src/pages/Secrets.tsx (max-h-[min(80vh,34rem)]). */
+ --sz-14rem: 14rem; /* Extracted from ui/src/pages/TeamCatalog.tsx (max-w-[14rem]). */
+ --rad-3: 3px; /* Extracted from ui/src/components/ExternalObjectPill.tsx (ring-[3px]). */
+ --rad-4: 4px; /* Extracted from ui/src/components/IssueChatThread.tsx (rounded-br-[4px]). */
+ --rad-2: 2px; /* Extracted from ui/src/components/SidebarCompanyMenu.tsx (ring-[2px]). */
+ --rad-8: 8px; /* Extracted from ui/src/components/artifacts/ArtifactCard.test.tsx (rounded-[8px]). */
+ --rad-14: 14px; /* Extracted from ui/src/pages/CompanySettings.tsx (rounded-[14px]). */
+ --rad-28: 28px; /* Extracted from ui/src/pages/InviteUxLab.tsx (rounded-[28px]). */
+ --rad-24: 24px; /* Extracted from ui/src/pages/InviteUxLab.tsx (rounded-[24px]). */
+ --rad-32: 32px; /* Extracted from ui/src/pages/InviteUxLab.tsx (rounded-[32px]). */
+ --pct-90: 90%; /* Extracted from ui/src/components/DocumentDiffModal.tsx (max-w-[90%]). */
+ --pct-50: 50%; /* Extracted from ui/src/components/ImageGalleryModal.tsx (max-w-[50%]). */
+ --pct-85: 85%; /* Extracted from ui/src/components/IssueChatThread.test.tsx (max-w-[85%]). */
+ --pct-neg-50: -50%; /* Extracted from ui/src/components/ui/alert-dialog.tsx (translate-x-[-50%]). */
+ --pct-72: 72%; /* Extracted from ui/src/pages/IssueDetail.tsx (w-[72%]). */
+ --shadow-extract-1: 0 16px 40px rgba(37,99,235,0.08); /* ActiveAgentsPanel.tsx live-box glow. Gallery feedback r2: liveness glow recolored cyan->status blue (value edit, site unchanged; originally extracted as rgba(6,182,212,0.08)). */
+ --shadow-extract-2: 0 20px 80px -40px rgba(0,0,0,0.55); /* Extracted from ui/src/components/BudgetPolicyCard.tsx (shadow-[0_20px_80px_-40px_rgba(0,0,0,0.55)]). */
+ --shadow-extract-3: 0 0 0 1px rgba(255,255,255,0.08); /* Extracted from ui/src/components/BudgetSidebarMarker.tsx (shadow-[0_0_0_1px_rgba(255,255,255,0.08)]). */
+ --shadow-extract-4: 0 -12px 28px rgba(15,23,42,0.08); /* Extracted from ui/src/components/ChatComposer.test.tsx (shadow-[0_-12px_28px_rgba(15,23,42,0.08)]). */
+ --shadow-extract-5: 0 -12px 28px rgba(0,0,0,0.28); /* Extracted from ui/src/components/ChatComposer.test.tsx (shadow-[0_-12px_28px_rgba(0,0,0,0.28)]). */
+ --shadow-extract-6: 0 0 0 1px var(--color-background); /* Extracted from ui/src/components/DocumentAnnotationLayer.tsx (shadow-[0_0_0_1px_var(--color-background)]). */
+ --shadow-extract-7: 0 -12px 28px rgba(15,23,42,0.08),0 0 0 1px hsl(var(--primary)/0.16); /* Extracted from ui/src/components/IssueChatThread.tsx (shadow-[0_-12px_28px_rgba(15,23,42,0.08),0_0_0_1px_hsl(var(--primary)/0.16)]). */
+ --shadow-extract-8: 0 1px 0 rgba(15,23,42,0.02); /* Extracted from ui/src/components/IssueRecoveryActionCard.tsx (shadow-[0_1px_0_rgba(15,23,42,0.02)]). */
+ --shadow-extract-9: 0 18px 42px rgba(15,23,42,0.06); /* Extracted from ui/src/components/IssueThreadInteractionCard.tsx (shadow-[0_18px_42px_rgba(15,23,42,0.06)]). */
+ --shadow-extract-10: 0 1px 0 1px hsl(var(--border)); /* Extracted from ui/src/components/KeyboardShortcutsCheatsheet.tsx (shadow-[0_1px_0_1px_hsl(var(--border))]). */
+ --shadow-extract-11: 0 18px 50px rgba(37,99,235,0.08); /* LiveRunWidget.tsx glow. Gallery feedback r2: liveness glow recolored cyan->status blue (value edit, site unchanged; originally extracted as rgba(6,182,212,0.08)). */
+ --shadow-extract-12: 0 0 0 2px hsl(var(--background)); /* Extracted from ui/src/components/SidebarNavItem.tsx (shadow-[0_0_0_2px_hsl(var(--background))]). */
+ --shadow-extract-13: 0 0 0 3px rgba(245,158,11,0.18); /* Extracted from ui/src/components/environment-variables-editor/index.tsx (shadow-[0_0_0_3px_rgba(245,158,11,0.18)]). */
+ --shadow-extract-14: 0 0 12px rgba(37,99,235,0.08); /* AgentDetail.tsx live-card glow. Gallery feedback r2: liveness glow recolored cyan->status blue (value edit, site unchanged; originally extracted as rgba(6,182,212,0.08)). */
+ --shadow-extract-18: 0 18px 44px -28px rgba(0,0,0,0.45); /* Extracted from ui/src/pages/ProfileSettings.tsx (shadow-[0_18px_44px_-28px_rgba(0,0,0,0.45)]). */
+}
+
+/* ── Extracted verbatim MISC tokens (Phase 2 Batch 4, design/token-extraction) ── */
+/* Batch 4/4 (final sweep): grid track lists, transition-property
+ lists, z-index, scale, easing, vertical-align, stroke-width, blur,
+ drop-shadow, and half-migrated var(x, fallback) color forms,
+ verbatim (no normalizing - the human scale-collapse decision comes
+ later per DESIGN.md/TOKEN-AUDIT.md). --gtc-* and --gtr-* and --tp-* are
+ sequentially numbered / slugged since their content (track lists,
+ property lists) is not safely nameable by value alone.
+
+ drop-shadow (a CSS filter function) gets its own
+ --drop-shadow-extract-* family, kept separate from Batch 3's
+ --shadow-extract-* box-shadow family per that batch's logged
+ human-decision note.
+
+ *-resolved wrapper tokens hold a verbatim var(--x, fallback)
+ expression for sites where Tailwind v4's paren-with-fallback-comma
+ shorthand does not parse (confirmed unsupported in this batch's
+ Step 0 syntax spike). theme(colors.a.b) fallbacks were resolved to
+ the equivalent var(--token) form the Tailwind build already
+ compiles them to today (inspected byte-for-byte from the built
+ storybook-static CSS before this codemod ran: theme(colors.muted.DEFAULT)
+ -> var(--muted), theme(colors.muted.foreground) -> var(--muted-foreground)).
+
+ --gradient-extract-* here CONTINUES Batch 1's counter (Batch 1 minted
+ 1 through 24) rather than restarting it - these 2 sites use
+ hsl(var(...))/color-mix(...) CSS-native color functions rather than raw
+ hex/rgb literals, which is why Batch 1's hand-audited color-literal
+ table did not catch them, but they are still value-bearing gradient
+ brackets in scope for this batch's final sweep.
+
+ Allowlist (sites intentionally left as-is - see ALLOWLIST doc-comment
+ at the end of this file for the machine-readable list consumed by
+ scripts/check-token-gates.mjs):
+ allow ui/src/components/ui/dialog.tsx — tw-animate-css plugin utilities (zoom-in-[0.97] etc.) are dead/no-op classes today (plugin not installed, verified via built-CSS grep); nothing to tokenize without visually changing a currently-inert class
+ allow ui/src/components/ui/alert-dialog.tsx — same tw-animate-css dead-class situation as dialog.tsx
+*/
+:root {
+ --gtc-1: 56px 56px 24px minmax(0,1fr); /* Extracted from ui/src/components/DocumentDiffModal.tsx (grid-cols-[56px_56px_24px_minmax(0,1fr)]). */
+ --gtc-2: auto minmax(0,1fr) 2.25rem; /* Extracted from ui/src/components/FileTree.tsx (grid-cols-[auto_minmax(0,1fr)_2.25rem]). */
+ --gtc-3: minmax(0,1fr) 2.25rem; /* Extracted from ui/src/components/FileTree.tsx (grid-cols-[minmax(0,1fr)_2.25rem]). */
+ --gtc-4: minmax(0,1fr); /* Extracted from ui/src/components/FileTree.tsx (grid-cols-[minmax(0,1fr)]). */
+ --gtc-5: auto minmax(0,1fr); /* Extracted from ui/src/components/FileViewerSheet.tsx (grid-cols-[auto_minmax(0,1fr)]). */
+ --gtc-6: auto minmax(0,1fr) auto; /* Extracted from ui/src/components/FileViewerSheet.tsx (grid-cols-[auto_minmax(0,1fr)_auto]). */
+ --gtc-7: 7.5rem minmax(0,1fr); /* Extracted from ui/src/components/IssueChatThread.tsx (grid-cols-[7.5rem_minmax(0,1fr)]). */
+ --gtc-8: 7.5rem 1fr; /* Extracted from ui/src/components/IssueRecoveryActionCard.tsx (grid-cols-[7.5rem_1fr]). */
+ --gtc-9: 300px minmax(0,1fr); /* Extracted from ui/src/components/RoutineHistoryTab.tsx (grid-cols-[300px_minmax(0,1fr)]). */
+ --gtc-10: 10rem 1fr; /* Extracted from ui/src/components/SourceResolvedFoldCallout.tsx (grid-cols-[10rem_1fr]). */
+ --gtc-11: 12rem 1fr; /* Extracted from ui/src/components/SourceResolvedFoldCallout.tsx (grid-cols-[12rem_1fr]). */
+ --gtc-12: minmax(0,0.75fr) minmax(0,1fr); /* Extracted from ui/src/components/TrustPresetSection.tsx (grid-cols-[minmax(0,0.75fr)_minmax(0,1fr)]). */
+ --gtc-13: minmax(0,1fr) auto; /* Extracted from ui/src/components/environment-variables-editor/Row.tsx (grid-cols-[minmax(0,1fr)_auto]). */
+ --gtc-14: minmax(160px,2fr) minmax(240px,3fr) 32px; /* Extracted from ui/src/components/environment-variables-editor/Row.tsx (grid-cols-[minmax(160px,2fr)_minmax(240px,3fr)_32px]). */
+ --gtc-15: 6rem 1fr; /* Extracted from ui/src/components/issue-properties/IssueProperties.tsx (grid-cols-[6rem_1fr]). */
+ --gtc-16: auto 1fr; /* Extracted from ui/src/components/transcript/RunTranscriptView.tsx (grid-cols-[auto_1fr]). */
+ --gtc-17: 1fr auto; /* Extracted from ui/src/components/ui/card.tsx (grid-cols-[1fr_auto]). */
+ --gtc-18: auto minmax(0,1fr) minmax(12rem,0.65fr); /* Extracted from ui/src/pages/AgentDetail.tsx (grid-cols-[auto_minmax(0,1fr)_minmax(12rem,0.65fr)]). */
+ --gtc-19: 260px minmax(0,1fr); /* Extracted from ui/src/pages/AgentDetail.tsx (grid-cols-[260px_minmax(0,1fr)]). */
+ --gtc-20: 7rem 8rem 1fr; /* Extracted from ui/src/pages/CloudUpstream.tsx (grid-cols-[7rem_8rem_1fr]). */
+ --gtc-21: 1.25rem 12rem 1fr; /* Extracted from ui/src/pages/CloudUpstream.tsx (grid-cols-[1.25rem_12rem_1fr]). */
+ --gtc-22: 8rem 1fr 1fr 8rem; /* Extracted from ui/src/pages/CloudUpstream.tsx (grid-cols-[8rem_1fr_1fr_8rem]). */
+ --gtc-23: 8rem 1fr auto; /* Extracted from ui/src/pages/CloudUpstream.tsx (grid-cols-[8rem_1fr_auto]). */
+ --gtc-24: minmax(0,1.5fr) 120px 120px 180px; /* Extracted from ui/src/pages/CompanyAccess.tsx (grid-cols-[minmax(0,1.5fr)_120px_120px_180px]). */
+ --gtc-25: 19rem minmax(0,1fr); /* Extracted from ui/src/pages/CompanyExport.tsx (grid-cols-[19rem_minmax(0,1fr)]). */
+ --gtc-26: 7rem minmax(0,1fr); /* Extracted from ui/src/pages/CompanySkills.tsx (grid-cols-[7rem_minmax(0,1fr)]). */
+ --gtc-27: minmax(0,1fr) auto auto; /* Extracted from ui/src/pages/CompanySkills.tsx (grid-cols-[minmax(0,1fr)_auto_auto]). */
+ --gtc-28: 13rem minmax(0,1fr); /* Extracted from ui/src/pages/CompanySkills.tsx (grid-cols-[13rem_minmax(0,1fr)]). */
+ --gtc-29: minmax(0,1fr) 18rem; /* Extracted from ui/src/pages/CompanySkills.tsx (grid-cols-[minmax(0,1fr)_18rem]). */
+ --gtc-30: 14rem minmax(0,1fr); /* Extracted from ui/src/pages/CompanySkills.tsx (grid-cols-[14rem_minmax(0,1fr)]). */
+ --gtc-31: 1.3fr,1fr; /* Extracted from ui/src/pages/Costs.tsx (grid-cols-[1.3fr,1fr]). */
+ --gtc-32: 1.25fr,0.95fr; /* Extracted from ui/src/pages/Costs.tsx (grid-cols-[1.25fr,0.95fr]). */
+ --gtc-33: 1.2fr,0.95fr; /* Extracted from ui/src/pages/Costs.tsx (grid-cols-[1.2fr,0.95fr]). */
+ --gtc-34: 320px minmax(0,1fr); /* Extracted from ui/src/pages/InstanceAccess.tsx (grid-cols-[320px_minmax(0,1fr)]). */
+ --gtc-35: minmax(10rem,14rem) 1fr; /* Extracted from ui/src/pages/InstanceExperimentalSettings.tsx (grid-cols-[minmax(10rem,14rem)_1fr]). */
+ --gtc-36: minmax(0,1.15fr) minmax(360px,0.85fr); /* Extracted from ui/src/pages/InviteLanding.tsx (grid-cols-[minmax(0,1.15fr)_minmax(360px,0.85fr)]). */
+ --gtc-37: minmax(0,1.15fr) minmax(320px,0.85fr); /* Extracted from ui/src/pages/InviteUxLab.tsx (grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]). */
+ --gtc-38: minmax(0,0.92fr) minmax(0,1.08fr); /* Extracted from ui/src/pages/InviteUxLab.tsx (grid-cols-[minmax(0,0.92fr)_minmax(0,1.08fr)]). */
+ --gtc-39: minmax(0,1.2fr) 320px; /* Extracted from ui/src/pages/InviteUxLab.tsx (grid-cols-[minmax(0,1.2fr)_320px]). */
+ --gtc-40: minmax(0,1fr) 320px; /* Extracted from ui/src/pages/IssueChatLongThreadPerf.tsx (grid-cols-[minmax(0,1fr)_320px]). */
+ --gtc-41: 10rem minmax(0,1fr); /* Extracted from ui/src/pages/PipelineSettings.tsx (grid-cols-[10rem_minmax(0,1fr)]). */
+ --gtc-42: minmax(0,1fr) 240px; /* Extracted from ui/src/pages/PipelineSettings.tsx (grid-cols-[minmax(0,1fr)_240px]). */
+ --gtc-43: minmax(0,1fr) minmax(0,1fr); /* Extracted from ui/src/pages/PipelineSettings.tsx (grid-cols-[minmax(0,1fr)_minmax(0,1fr)]). */
+ --gtc-44: 5rem 240px; /* Extracted from ui/src/pages/PipelineSettings.tsx (grid-cols-[5rem_240px]). */
+ --gtc-45: minmax(0,1fr) 340px; /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[minmax(0,1fr)_340px]). */
+ --gtc-46: 18px minmax(0,1fr); /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[18px_minmax(0,1fr)]). */
+ --gtc-47: 120px 1fr; /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[120px_1fr]). */
+ --gtc-48: 18px minmax(0,1fr) auto; /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[18px_minmax(0,1fr)_auto]). */
+ --gtc-49: 18px 1fr auto; /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[18px_1fr_auto]). */
+ --gtc-50: 1fr 280px; /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[1fr_280px]). */
+ --gtc-51: 160px 1fr; /* Extracted from ui/src/pages/Pipelines.tsx (grid-cols-[160px_1fr]). */
+ --gtc-52: minmax(0,1.4fr) minmax(220px,0.8fr); /* Extracted from ui/src/pages/PluginSettings.tsx (grid-cols-[minmax(0,1.4fr)_minmax(220px,0.8fr)]). */
+ --gtc-53: minmax(0,1.4fr) minmax(18rem,0.9fr); /* Extracted from ui/src/pages/ProjectWorkspaceDetail.tsx (grid-cols-[minmax(0,1.4fr)_minmax(18rem,0.9fr)]). */
+ --gtc-54: minmax(12rem,2.4fr) minmax(5.25rem,0.75fr) minmax(7rem,1fr) minmax(5rem,0.7fr) 2.75rem; /* Extracted from ui/src/pages/Secrets.tsx (grid-cols-[minmax(12rem,2.4fr)_minmax(5.25rem,0.75fr)_minmax(7rem,1fr)_minmax(5rem,0.7fr)_2.75rem]). */
+ --gtc-55: 8rem minmax(0,1fr); /* Extracted from ui/src/pages/Secrets.tsx (grid-cols-[8rem_minmax(0,1fr)]). */
+ --gtc-56: minmax(0,1fr) minmax(14rem,18rem); /* Extracted from ui/src/pages/TeamCatalog.tsx (grid-cols-[minmax(0,1fr)_minmax(14rem,18rem)]). */
+ --gtc-57: repeat(14,minmax(0,1fr)); /* Extracted from ui/src/pages/UserProfile.tsx (grid-cols-[repeat(14,minmax(0,1fr))]). */
+ --gtc-58: auto 1fr auto; /* Extracted from ui/src/pages/UserProfile.tsx (grid-cols-[auto_1fr_auto]). */
+ --gtr-1: auto auto; /* Extracted from ui/src/components/ui/card.tsx (grid-rows-[auto_auto]). */
+ --gtr-2: 1fr; /* Extracted from ui/src/pages/CompanySkills.tsx (grid-rows-[1fr]). */
+ --gtr-3: 0fr; /* Extracted from ui/src/pages/CompanySkills.tsx (grid-rows-[0fr]). */
+ --tp-background-color-border-color: background-color,border-color; /* Extracted from ui/src/components/ActivityFeed.tsx (transition-[background-color,border-color]). */
+ --tp-width-background-color: width,background-color; /* Extracted from ui/src/components/BudgetPolicyCard.tsx (transition-[width,background-color]). */
+ --tp-width: width; /* Extracted from ui/src/components/ClaudeSubscriptionPanel.tsx (transition-[width]). */
+ --tp-background-color-color-opacity: background-color,color,opacity; /* Extracted from ui/src/components/FileTree.tsx (transition-[background-color,color,opacity]). */
+ --tp-max-height: max-height; /* Extracted from ui/src/components/FoldCurtain.tsx (transition-[max-height]). */
+ --tp-border-color-background-color-box-shadow: border-color,background-color,box-shadow; /* Extracted from ui/src/components/IssueChatThread.tsx (transition-[border-color,background-color,box-shadow]). */
+ --tp-width-min-width: width,min-width; /* Extracted from ui/src/components/KanbanBoard.tsx (transition-[width,min-width]). */
+ --tp-width-opacity: width,opacity; /* Extracted from ui/src/components/OnboardingWizard.tsx (transition-[width,opacity]). */
+ --tp-background-color-right: background-color,right; /* Extracted from ui/src/components/ScrollToBottom.tsx (transition-[background-color,right]). */
+ --tp-background-color-border-color-color: background-color,border-color,color; /* Extracted from ui/src/components/SystemNotice.tsx (transition-[background-color,border-color,color]). */
+ --tp-transform-opacity: transform,opacity; /* Extracted from ui/src/components/ToastViewport.tsx (transition-[transform,opacity]). */
+ --tp-color-box-shadow: color,box-shadow; /* Extracted from ui/src/components/ui/badge.tsx (transition-[color,box-shadow]). */
+ --tp-color-background-color-border-color-box-shadow-opacity: color,background-color,border-color,box-shadow,opacity; /* Extracted from ui/src/components/ui/button.tsx (transition-[color,background-color,border-color,box-shadow,opacity]). */
+ --tp-border-color-background-color: border-color,background-color; /* Extracted from ui/src/components/ui/radio-card.tsx (transition-[border-color,background-color]). */
+ --tp-color-background-color-border-color-box-shadow: color,background-color,border-color,box-shadow; /* Extracted from ui/src/components/ui/tabs.tsx (transition-[color,background-color,border-color,box-shadow]). */
+ --tp-grid-template-rows-opacity: grid-template-rows,opacity; /* Extracted from ui/src/pages/CompanySkills.tsx (transition-[grid-template-rows,opacity]). */
+ --tp-box-shadow-border-color: box-shadow,border-color; /* Extracted from ui/src/pages/OrgChart.tsx (transition-[box-shadow,border-color]). */
+ --tp-box-shadow: box-shadow; /* Extracted from ui/src/pages/ProjectDetail.tsx (transition-[box-shadow]). */
+ --tp-transform-box-shadow: transform,box-shadow; /* Extracted from ui/src/pages/ProjectDetail.tsx (transition-[transform,box-shadow]). */
+ --z-2: 2; /* Extracted from ui/src/components/DocumentAnnotationLayer.tsx (z-[2]). */
+ --z-60: 60; /* Extracted from ui/src/components/DocumentAnnotationPanel.tsx (z-[60]). */
+ --z-1: 1; /* Extracted from ui/src/components/IssueDocumentAnnotations.tsx (z-[1]). */
+ --z-200: 200; /* Extracted from ui/src/components/Layout.tsx (z-[200]). */
+ --z-9999: 9999; /* Extracted from ui/src/components/MarkdownEditor.tsx (z-[9999]). */
+ --z-120: 120; /* Extracted from ui/src/components/ToastViewport.tsx (z-[120]). */
+ --s-0_98: 0.98; /* Extracted from ui/src/pages/Inbox.tsx (scale-[0.98]). */
+ --e-cubic-bezier-0_16-1-0_3-1: cubic-bezier(0.16,1,0.3,1); /* Extracted from ui/src/components/ui/alert-dialog.tsx (ease-[cubic-bezier(0.16,1,0.3,1)]). */
+ --va-0_125em: -0.125em; /* Extracted from ui/src/components/ExternalObjectStatusIcon.tsx (align-[-0.125em]). */
+ --sw-2_3: 2.3; /* Extracted from ui/src/components/MobileBottomNav.tsx (stroke-[2.3]). */
+ --blur-1px: 1px; /* Extracted from ui/src/components/ChatComposer.tsx (backdrop-blur-[1px]). */
+ --blur-2px: 2px; /* Extracted from ui/src/components/IssueChatThread.tsx (backdrop-blur-[2px]). */
+ --drop-shadow-extract-1: 0 1px 2px rgba(0,0,0,0.65); /* Extracted from ui/src/components/CompanyPatternIcon.tsx (drop-shadow-[0_1px_2px_rgba(0,0,0,0.65)]). */
+ --code-bg-resolved: var(--paperclip-code-bg, var(--muted)); /* Extracted from ui/src/components/FileViewerSheet.tsx (bg-[var(--paperclip-code-bg,theme(colors.muted.DEFAULT))]). */
+ --paperclip-code-highlight-bg: rgba(250,204,21,0.12); /* DECISION-SHEET.md A5: FileViewerSheet.tsx referenced this var without it ever being defined, relying on the var() fallback; minted here at exactly the former fallback value (zero pixels). */
+ --paperclip-code-highlight-border: rgb(234,179,8); /* DECISION-SHEET.md A5: same as --paperclip-code-highlight-bg — minted at the former fallback value. */
+ --code-highlight-bg-resolved: var(--paperclip-code-highlight-bg); /* Extracted from ui/src/components/FileViewerSheet.tsx; fallback dropped in A5 now that --paperclip-code-highlight-bg is a real token (was var(--paperclip-code-highlight-bg, rgba(250,204,21,0.12))). */
+ --code-gutter-fg-resolved: var(--paperclip-code-gutter-fg, var(--muted-foreground)); /* Extracted from ui/src/components/FileViewerSheet.tsx (text-[var(--paperclip-code-gutter-fg,theme(colors.muted.foreground))]). */
+ --code-highlight-border-resolved: var(--paperclip-code-highlight-border); /* Extracted from ui/src/components/FileViewerSheet.tsx; fallback dropped in A5 now that --paperclip-code-highlight-border is a real token (was var(--paperclip-code-highlight-border, rgb(234,179,8))). */
+ --gradient-extract-25: linear-gradient(135deg,hsl(var(--primary)) 0%,hsl(var(--accent)) 55%,hsl(var(--muted)) 100%); /* Extracted from ui/src/components/SidebarAccountMenu.tsx (bg-[linear-gradient(135deg,hsl(var(--primary))_0%,hsl(var(--accent))_55%,hsl(var(--muted))_100%)]). */
+ --gradient-extract-26: linear-gradient(135deg,hsl(var(--primary)) 0%,hsl(var(--accent)) 58%,color-mix(in oklab,hsl(var(--background)) 76%,white 24%) 100%); /* Extracted from ui/src/pages/ProfileSettings.tsx (bg-[linear-gradient(135deg,hsl(var(--primary))_0%,hsl(var(--accent))_58%,color-mix(in_oklab,hsl(var(--background))_76%,white_24%)_100%)]). */
+}
+
+/* ── ALLOWLIST (Phase 2, design/token-extraction) ──────────────────────────
+ Canonical, MACHINE-READABLE allowlist consumed by
+ scripts/check-token-gates.mjs. This block consolidates every site the
+ Batch 1-4 codemods intentionally left un-tokenized (functional/third-party
+ values, CSS keywords, and currently-inert dead classes) into one list the
+ gate script parses directly, rather than re-deriving it from each batch's
+ prose log above. The per-batch prose blocks above are kept as historical
+ narrative (why each decision was made); this block is the source of truth
+ for WHICH sites are exempt.
+
+ CRITERIA UPDATE (Run 2 review, DECISION-SHEET.md B1 user ruling): the
+ allowlist criteria now also include FIRST-PARTY INTENTIONAL ONE-OFF
+ DECORATION — deliberate, never-reused decorative gradients/shadows on
+ demo/UX-lab surfaces stay inline (spirit over letter of DESIGN.md
+ principle 2) rather than being minted as singleton --gradient-extract-*
+ and --shadow-extract-* tokens. Production-surface decoration tokens were
+ KEPT; only tokens whose sole consumers were *UxLab.tsx demo pages were
+ reverted to their original literal form under this rule.
+
+ Format (one line per entry, do not reflow):
+ * allow <repo-relative-path> — <reason>
+
+ A path may appear more than once if it has more than one distinct
+ allowlisted concern. Paths are matched by the gate script as a substring
+ of the file being checked (repo-relative, POSIX-style).
+ * allow ui/src/pages/CompanyEnvironments.tsx — xterm.js terminal theme config (background/foreground/cursor/cursorAccent/selectionBackground hex, fontSize: 12); functional third-party option object, not a rendered CSS value
+ * allow ui/src/pages/CompanySettings.tsx — <input type="color"> value; the DOM color-picker control requires a real hex string
+ * allow ui/src/components/issue-properties/IssueProperties.tsx — newLabelColor color-picker seed state persisted into the label-create payload sent to the backend; a var() string would corrupt that payload
+ * allow ui/src/pages/CompanySkills.tsx — DISCOVERY_ACCENTS palette array feeds skill.color, persisted/compared JS data (SkillCreateDraft), not just a rendered value; also fontSize: Math.round(size * 0.42), computed at runtime from a prop, not a static literal
+ * allow ui/src/components/IssueColumns.tsx — accentColor fallback also feeds pickTextColorForPillBg() contrast math (lib/color-contrast.ts), which needs a real hex string to compute luminance
+ * allow ui/src/components/CompanyPatternIcon.tsx — canvas 2D fillStyle built from a runtime-computed template literal, not a static literal at all
+ * allow ui/src/pages/InviteUxLab.tsx — brandColor prop (x2) feeds CompanyPatternIcon's hexToHue() color math via the same canvas-fill code path; demo/showcase-only prop, not a rendered CSS value
+ * allow ui/src/components/ui/scroll-area.tsx — rounded-[inherit] is a CSS keyword, not a literal value; nothing to extract
+ * allow ui/src/components/ui/dialog.tsx — tw-animate-css plugin utilities (zoom-in-[0.97], zoom-out-[0.97], slide-in-from-top-[1%], slide-out-to-top-[1%], animate-in, animate-out, fade-in-0, fade-out-0) are dead/no-op classes today (the tw-animate-css plugin is not installed and no matching @utility exists in this file; confirmed via grep of the built storybook-static CSS — none of these class names emit any rule); nothing to tokenize without visually changing a currently-inert class
+ * allow ui/src/components/ui/alert-dialog.tsx — same tw-animate-css dead-class situation as dialog.tsx (zoom-out-[0.97], zoom-in-[0.97])
+ * allow ui/src/components/ProjectWorkspaceSummaryCard.tsx — min-[420px]: is a Tailwind arbitrary BREAKPOINT variant (responsive container-query-style prefix), not a value applied to a property; the variant position cannot reference a CSS custom property, so it cannot be tokenized without changing Tailwind's own variant syntax
+ * allow ui/src/components/FileTree.tsx — max-[480px]: arbitrary breakpoint variant (x2), same reasoning as min-[420px] above
+ * allow ui/src/pages/RunTranscriptUxLab.tsx — first-party intentional one-off decoration (demo/UX-lab page): hero/card gradients + shadows reverted from singleton tokens per DECISION-SHEET.md B1 user ruling
+ * allow ui/src/pages/InviteUxLab.tsx — first-party intentional one-off decoration (demo/UX-lab page): hero/card gradients + shadows reverted from singleton tokens per DECISION-SHEET.md B1 user ruling
+ * allow ui/src/pages/IssueChatUxLab.tsx — first-party intentional one-off decoration (demo/UX-lab page): hero/card gradients + shadows reverted from singleton tokens per DECISION-SHEET.md B1 user ruling
+ * allow ui/src/pages/SystemNoticeUxLab.tsx — first-party intentional one-off decoration (demo/UX-lab page): hero/card gradients + shadows reverted from singleton tokens per DECISION-SHEET.md B1 user ruling
+
+ Test-fixture hex-literal policy (Batch 4, resolving TOKEN-AUDIT.md section
+ 8 item 10 "Needs human decision" for these specific sites): the following
+ *.test.tsx files pass hex-literal strings as MOCK PROP / MOCK API-RESPONSE
+ DATA (label/project/company/brand `color` fields, xterm.js theme-mock
+ assertions) — not as Tailwind class strings or CSS-in-JS style
+ declarations. These are the test-file counterpart of the same
+ "functional/persisted data, not a rendered CSS value" category Batch 1
+ already allowlisted in production source (see CompanySkills.tsx,
+ IssueProperties.tsx, IssueColumns.tsx above); tokenizing them would
+ replace realistic-looking mock data with `var()` strings that no longer
+ resemble what a real API response contains, without touching any
+ rendered pixel. Each file is listed individually for reviewability.
+ * allow ui/src/components/IssueFiltersPopover.test.tsx — mock label color prop
+ * allow ui/src/components/IssueProperties.test.tsx — mock label/project color fixtures
+ * allow ui/src/components/MarkdownBody.test.tsx — mock project color fed through a mention-href builder
+ * allow ui/src/components/MarkdownEditor.test.tsx — mock projectColor mention fixture
+ * allow ui/src/components/NewIssueDialog.test.tsx — mock brandColor/label color fixtures
+ * allow ui/src/components/ProjectTile.test.tsx — mock project color prop
+ * allow ui/src/components/RoutineRunVariablesDialog.test.tsx — mock label color fixture
+ * allow ui/src/components/SidebarCompanyMenu.test.tsx — mock brandColor company fixtures
+ * allow ui/src/components/SidebarProjects.test.tsx — mock project color fixture
+ * allow ui/src/components/SidebarStarredProjects.test.tsx — mock project color fixture
+ * allow ui/src/pages/CompanyEnvironments.test.tsx — xterm.js theme-mock assertion values (mirrors the allowlisted xterm.js config in the CompanyEnvironments.tsx source above)
+ * allow ui/src/pages/ExecutionWorkspaceDetail.test.tsx — mock project color fixture
+ * allow ui/src/pages/InviteLanding.test.tsx — mock companyBrandColor fixtures
+ * allow ui/src/pages/IssueDetail.test.tsx — mock project color fixture
+ * allow ui/src/pages/ProjectDetail.test.tsx — mock project color fixture
+ * allow ui/src/pages/ProjectWorkspaceDetail.test.tsx — mock project color fixture
+ * allow ui/src/pages/Projects.test.tsx — mock project color fixture
+ * allow ui/src/pages/Routines.test.tsx — mock routine/label color fixtures
+ ── end allowlist ── */
diff --git a/ui/src/lib/color-contrast.ts b/ui/src/lib/color-contrast.ts
index 70b2296a31..a7eb692a2c 100644
--- a/ui/src/lib/color-contrast.ts
+++ b/ui/src/lib/color-contrast.ts
@@ -68,8 +68,18 @@ function composite(
};
}
-const TEXT_LIGHT = "#f8fafc";
-const TEXT_DARK = "#111827";
+/**
+ * Shared readable-text pair (slate-50 / gray-900) for "pick light or dark
+ * text over an arbitrary background" logic. Byte-identical values were
+ * previously duplicated in lib/worktree-branding.ts (DECISION-SHEET.md A2);
+ * this is the single source. NOT the same thing as ThemeContext.tsx's
+ * <meta theme-color> pair (#18181b/#ffffff), which stays separate.
+ */
+export const READABLE_TEXT_LIGHT = "#f8fafc";
+export const READABLE_TEXT_DARK = "#111827";
+
+const TEXT_LIGHT = READABLE_TEXT_LIGHT;
+const TEXT_DARK = READABLE_TEXT_DARK;
/**
* Pick a readable text color for a solid background.
diff --git a/ui/src/lib/interrupt-handoff.ts b/ui/src/lib/interrupt-handoff.ts
index e2f1388b4d..f5c3d401b5 100644
--- a/ui/src/lib/interrupt-handoff.ts
+++ b/ui/src/lib/interrupt-handoff.ts
@@ -42,7 +42,7 @@ export function runStatusClassName(status: string): string {
case "timed_out":
return "text-orange-700 dark:text-orange-300";
case "running":
- return "text-cyan-700 dark:text-cyan-300";
+ return "text-blue-700 dark:text-blue-300";
case "queued":
case "pending":
return "text-amber-700 dark:text-amber-300";
diff --git a/ui/src/lib/runRetryState.ts b/ui/src/lib/runRetryState.ts
index a8f71c3a3c..1cc33db189 100644
--- a/ui/src/lib/runRetryState.ts
+++ b/ui/src/lib/runRetryState.ts
@@ -66,7 +66,7 @@ export function describeRunRetryState(run: RetryAwareRun): RunRetryStateSummary
return {
kind: "scheduled",
badgeLabel: isMaxTurnContinuation ? "Continuation scheduled" : "Retry scheduled",
- tone: "border-cyan-500/30 bg-cyan-500/10 text-cyan-700 dark:text-cyan-300",
+ tone: "border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",
detail: joinFragments([attemptLabel, reasonLabel]),
secondary: dueAt
? `${isMaxTurnContinuation ? "Next continuation" : "Next retry"} ${dueAt}`
diff --git a/ui/src/lib/status-colors.ts b/ui/src/lib/status-colors.ts
index 9b92a20490..42a7de40c8 100644
--- a/ui/src/lib/status-colors.ts
+++ b/ui/src/lib/status-colors.ts
@@ -42,17 +42,42 @@ export const issueStatusText: Record<string, string> = {
export const issueStatusTextDefault = "text-muted-foreground";
+// ---------------------------------------------------------------------------
+// Brand `.task-chip` status palette (PAP-75 / status-reference.html)
+//
+// Colour-named, 1px border, light + dark — values straight from paperclip.ing
+// `brand.css`. Shared by the agents section (PAP-80) and the All Projects page
+// (PAP-91); PAP-99 brings it to issue/task status chips, adding `violet` for
+// `in_review`.
+// ---------------------------------------------------------------------------
+
+export type BrandChipColor = "gray" | "blue" | "amber" | "green" | "violet" | "red";
+
+export const brandChipBadge: Record<BrandChipColor, string> = {
+ gray: "bg-[#F5F3F0] text-[#52585D] border-[#A8AEB2] dark:bg-[#6e696024] dark:text-[#9A958A] dark:border-[#9e958a73]",
+ blue: "bg-[#DBEAFE] text-[#1D4ED8] border-[#2563EB] dark:bg-[#2563eb2e] dark:text-[#2563EB] dark:border-[#2563eb73]",
+ amber: "bg-[#FEF3C7] text-[#B45309] border-[#F59E0B] dark:bg-[#f59e0b24] dark:text-[#F59E0B] dark:border-[#f59e0b73]",
+ green: "bg-[#DCFCE7] text-[#188A3C] border-[#22C55E] dark:bg-[#22c55e1f] dark:text-[#22C55E] dark:border-[#22c55e73]",
+ violet: "bg-[#EDE9FE] text-[#5B21B6] border-[#7C3AED] dark:bg-[#7c3aed2e] dark:text-[#7C3AED] dark:border-[#7c3aed73]",
+ red: "bg-[#FEE2E2] text-[#991B1B] border-[#DC2626] dark:bg-[#dc26262e] dark:text-[#DC2626] dark:border-[#dc262673]",
+};
+
// ---------------------------------------------------------------------------
// Badge colors — used by StatusBadge for all entity types
// ---------------------------------------------------------------------------
export const statusBadge: Record<string, string> = {
// Agent statuses
- active: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
- running: "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",
+ // Gallery feedback r3: agent chips route through the brand chip families
+ // (bordered .task-chip recipes) instead of ad-hoc tints. NOTE: `active` has
+ // no canonical agent status — user-ruled mapping to the brand GREEN family;
+ // `idle` is the gray family (was a yellow/amber tint); `error` rides the
+ // shared run-status red entry below.
+ active: `border ${brandChipBadge.green}`,
+ running: `border ${brandChipBadge.blue}`, // r1 made this blue; r3 routes through brandChipBadge.blue.
scheduled_retry: "bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",
- paused: "bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",
- idle: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",
+ paused: `border ${brandChipBadge.amber}`,
+ idle: `border ${brandChipBadge.gray}`,
archived: "bg-muted text-muted-foreground",
// Goal statuses
@@ -107,13 +132,10 @@ export const agentStatusColor: Record<string, AgentBadgeColor> = {
export const agentStatusColorDefault: AgentBadgeColor = "gray";
-/** Brand `.task-chip` styles (1px border) per colour name — light + dark. */
-export const agentStatusBadge: Record<AgentBadgeColor, string> = {
- gray: "bg-[#F5F3F0] text-[#52585D] border-[#A8AEB2] dark:bg-[#6e696024] dark:text-[#9A958A] dark:border-[#9e958a73]",
- blue: "bg-[#DBEAFE] text-[#1D4ED8] border-[#2563EB] dark:bg-[#2563eb2e] dark:text-[#2563EB] dark:border-[#2563eb73]",
- amber: "bg-[#FEF3C7] text-[#B45309] border-[#F59E0B] dark:bg-[#f59e0b24] dark:text-[#F59E0B] dark:border-[#f59e0b73]",
- red: "bg-[#FEE2E2] text-[#991B1B] border-[#DC2626] dark:bg-[#dc26262e] dark:text-[#DC2626] dark:border-[#dc262673]",
-};
+// Brand `.task-chip` styles per colour name live in `brandChipBadge` below —
+// `AgentBadgeColor` is a subset of `BrandChipColor`, so agent badges index
+// straight into it. (A byte-identical `agentStatusBadge` duplicate map was
+// collapsed into `brandChipBadge` in the Run 2 review; DECISION-SHEET.md A1.)
/** Heartbeat-capsule fill (solid) per colour name. gray darkens in dark mode. */
export const agentStatusCapsule: Record<AgentBadgeColor, string> = {
@@ -129,25 +151,14 @@ export const agentStatusMotion: Record<string, string> = {
error: "hb-blink",
};
-// ---------------------------------------------------------------------------
-// Brand `.task-chip` status palette (PAP-75 / status-reference.html)
-//
-// Colour-named, 1px border, light + dark — values straight from paperclip.ing
-// `brand.css`. Shared by the agents section (PAP-80) and the All Projects page
-// (PAP-91); PAP-99 brings it to issue/task status chips, adding `violet` for
-// `in_review`.
-// ---------------------------------------------------------------------------
-
-export type BrandChipColor = "gray" | "blue" | "amber" | "green" | "violet" | "red";
-export const brandChipBadge: Record<BrandChipColor, string> = {
- gray: "bg-[#F5F3F0] text-[#52585D] border-[#A8AEB2] dark:bg-[#6e696024] dark:text-[#9A958A] dark:border-[#9e958a73]",
- blue: "bg-[#DBEAFE] text-[#1D4ED8] border-[#2563EB] dark:bg-[#2563eb2e] dark:text-[#2563EB] dark:border-[#2563eb73]",
- amber: "bg-[#FEF3C7] text-[#B45309] border-[#F59E0B] dark:bg-[#f59e0b24] dark:text-[#F59E0B] dark:border-[#f59e0b73]",
- green: "bg-[#DCFCE7] text-[#188A3C] border-[#22C55E] dark:bg-[#22c55e1f] dark:text-[#22C55E] dark:border-[#22c55e73]",
- violet: "bg-[#EDE9FE] text-[#5B21B6] border-[#7C3AED] dark:bg-[#7c3aed2e] dark:text-[#7C3AED] dark:border-[#7c3aed73]",
- red: "bg-[#FEE2E2] text-[#991B1B] border-[#DC2626] dark:bg-[#dc26262e] dark:text-[#DC2626] dark:border-[#dc262673]",
-};
+/**
+ * Brand blue TEXT pair (the text hues of `brandChipBadge.blue`) for non-chip
+ * "Running" labels — Gallery feedback round 1: running-state copy uses the
+ * canonical status blue, not cyan/teal. Kept here so components stay free of
+ * hex literals (token-gate scope).
+ */
+export const runningLabelText = "text-[#1D4ED8] dark:text-[#2563EB]";
/**
* Issue/task status → brand colour name (PAP-75). `in_progress` is blue
@@ -222,7 +233,7 @@ export const taskStatusIconVarDefault = "--status-task-icon-backlog";
// ---------------------------------------------------------------------------
export const agentStatusDot: Record<string, string> = {
- running: "bg-cyan-400 animate-pulse",
+ running: "bg-blue-400 animate-pulse", // Gallery feedback r1: running dot = blue, not cyan.
active: "bg-green-400",
paused: "bg-yellow-400",
idle: "bg-yellow-400",
@@ -257,7 +268,7 @@ export const priorityColorDefault = "text-yellow-600 dark:text-yellow-400";
// unknown → backlog hue (muted, dashed circle)
// open → todo / blue
// waiting → amber (distinct from internal in_progress yellow)
-// running → cyan, animated when motion is allowed
+// running → status blue (gallery r2; was cyan), animated when motion is allowed
// succeeded → done / green
// failed → red
// blocked → red
@@ -270,7 +281,7 @@ export const externalObjectStatusIcon: Record<string, string> = {
unknown: "text-muted-foreground border-muted-foreground",
open: "text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",
waiting: "text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",
- running: "text-cyan-600 border-cyan-600 dark:text-cyan-400 dark:border-cyan-400",
+ running: "text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400", // Gallery feedback r2: running = status blue (pulse animation still distinguishes it from static blue `open`).
succeeded: "text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",
merged: "text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",
failed: "text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",
@@ -287,7 +298,7 @@ export const externalObjectStatusBadge: Record<string, string> = {
unknown: "bg-muted text-muted-foreground",
open: "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",
waiting: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",
- running: "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",
+ running: "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300", // Gallery feedback r2: running = status blue (now shares tint with `open`; liveness animation differentiates).
succeeded: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
failed: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
blocked: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
diff --git a/ui/src/lib/timeline/layout.ts b/ui/src/lib/timeline/layout.ts
index 68b1d55398..0f27db9478 100644
--- a/ui/src/lib/timeline/layout.ts
+++ b/ui/src/lib/timeline/layout.ts
@@ -125,7 +125,7 @@ export function isCancelledStatus(status: string): boolean {
* (kicked off by another actor) read blue; automation/self-started runs read
* amber. The blue/amber pair is colour-blind-safe and holds contrast on both
* light and dark backgrounds so the chart screenshots cleanly. Cancelled runs
- * drop their fill entirely (rendered as a hollow dashed bar) and a teal "now"
+ * drop their fill entirely (rendered as a hollow dashed bar) and a status-blue "now"
* line marks the present.
*/
export const TIMELINE_COLORS = {
@@ -133,7 +133,7 @@ export const TIMELINE_COLORS = {
automation: "#f4b740",
/** stroke/ink for a hollow, cancelled bar. */
cancelled: "#9aa3ad",
- now: "#2dd4bf",
+ now: "#2563eb", // Gallery feedback r2: "now" liveness marker = status blue (was teal #2dd4bf); shape (1.5px vertical line) still distinguishes it from #5b9bf6 delegated bars.
} as const;
export type RunSourceKind = "delegated" | "automation";
diff --git a/ui/src/lib/worktree-branding.ts b/ui/src/lib/worktree-branding.ts
index 6f6d8dc4e4..d4781ded4d 100644
--- a/ui/src/lib/worktree-branding.ts
+++ b/ui/src/lib/worktree-branding.ts
@@ -1,3 +1,5 @@
+import { READABLE_TEXT_LIGHT, READABLE_TEXT_DARK } from "./color-contrast";
+
export type WorktreeUiBranding = {
enabled: true;
name: string;
@@ -46,7 +48,7 @@ function pickReadableTextColor(background: string): string {
(0.0722 * relativeLuminanceChannel(b));
const whiteContrast = 1.05 / (luminance + 0.05);
const blackContrast = (luminance + 0.05) / 0.05;
- return whiteContrast >= blackContrast ? "#f8fafc" : "#111827";
+ return whiteContrast >= blackContrast ? READABLE_TEXT_LIGHT : READABLE_TEXT_DARK;
}
export function getWorktreeUiBranding(): WorktreeUiBranding | null {
diff --git a/ui/src/pages/Activity.tsx b/ui/src/pages/Activity.tsx
index 88eabc6ec3..e205212e1c 100644
--- a/ui/src/pages/Activity.tsx
+++ b/ui/src/pages/Activity.tsx
@@ -121,7 +121,7 @@ export function Activity() {
<div className="space-y-4">
<div className="flex items-center justify-end">
<Select value={filter} onValueChange={setFilter}>
- <SelectTrigger className="w-[140px] h-8 text-xs">
+ <SelectTrigger className="w-(--sz-140px) h-8 text-xs">
<SelectValue placeholder="Filter by type" />
</SelectTrigger>
<SelectContent>
diff --git a/ui/src/pages/AdapterManager.tsx b/ui/src/pages/AdapterManager.tsx
index a90cc517f0..733b59d89a 100644
--- a/ui/src/pages/AdapterManager.tsx
+++ b/ui/src/pages/AdapterManager.tsx
@@ -84,7 +84,7 @@ function AdapterRow({
: <span title="Installed from npm"><Package className="h-4 w-4 text-red-500" /></span>
)}
{adapter.version && (
- <Badge variant="secondary" className="font-mono text-[10px]">
+ <Badge variant="secondary" className="font-mono text-(length:--text-nano)">
v{adapter.version}
</Badge>
)}
diff --git a/ui/src/pages/AgentDetail.tsx b/ui/src/pages/AgentDetail.tsx
index 61b436c9a1..bc838024bf 100644
--- a/ui/src/pages/AgentDetail.tsx
+++ b/ui/src/pages/AgentDetail.tsx
@@ -116,7 +116,7 @@ import {
const runStatusIcons: Record<string, { icon: typeof CheckCircle2; color: string }> = {
succeeded: { icon: CheckCircle2, color: "text-green-600 dark:text-green-400" },
failed: { icon: XCircle, color: "text-red-600 dark:text-red-400" },
- running: { icon: Loader2, color: "text-cyan-600 dark:text-cyan-400" },
+ running: { icon: Loader2, color: "text-blue-600 dark:text-blue-400" }, // Gallery feedback r1: running = status blue, not cyan.
queued: { icon: Clock, color: "text-yellow-600 dark:text-yellow-400" },
scheduled_retry: { icon: Clock, color: "text-sky-600 dark:text-sky-400" },
timed_out: { icon: Timer, color: "text-orange-600 dark:text-orange-400" },
@@ -477,7 +477,7 @@ function workspaceOperationStatusTone(status: WorkspaceOperation["status"]) {
case "failed":
return "border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300";
case "running":
- return "border-cyan-500/20 bg-cyan-500/10 text-cyan-700 dark:text-cyan-300";
+ return "border-blue-500/20 bg-blue-500/10 text-blue-700 dark:text-blue-300";
case "skipped":
return "border-yellow-500/20 bg-yellow-500/10 text-yellow-700 dark:text-yellow-300";
default:
@@ -489,7 +489,7 @@ function WorkspaceOperationStatusBadge({ status }: { status: WorkspaceOperation[
return (
<span
className={cn(
- "inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize",
+ "inline-flex items-center rounded-full border px-2 py-0.5 text-(length:--text-micro) font-medium capitalize",
workspaceOperationStatusTone(status),
)}
>
@@ -522,7 +522,7 @@ function WorkspaceOperationLogViewer({
<div className="space-y-2">
<button
type="button"
- className="text-[11px] text-muted-foreground underline underline-offset-2 hover:text-foreground"
+ className="text-(length:--text-micro) text-muted-foreground underline underline-offset-2 hover:text-foreground"
onClick={() => setOpen((value) => !value)}
>
{open ? "Hide full log" : "Show full log"}
@@ -590,7 +590,7 @@ function WorkspaceOperationsSection({
<div className="flex flex-wrap items-center gap-2">
<div className="text-sm font-medium">{workspaceOperationPhaseLabel(operation.phase)}</div>
<WorkspaceOperationStatusBadge status={operation.status} />
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
{relativeTime(operation.startedAt)}
{operation.finishedAt && ` to ${relativeTime(operation.finishedAt)}`}
</div>
@@ -963,7 +963,7 @@ export function AgentDetail() {
return (
<div className={cn("space-y-6", isMobile && showConfigActionBar && "pb-24")}>
{showLeftAgentNotice ? (
- <div className="flex items-center gap-3 border border-yellow-300/35 bg-yellow-300/10 px-3 py-2 text-sm text-yellow-100">
+ <div className="flex items-center gap-3 border border-yellow-300/35 bg-yellow-300/10 px-3 py-2 text-sm text-yellow-900 dark:text-yellow-100">
<p className="min-w-0 flex-1">
You left this agent. It no longer appears in your sidebar.
</p>
@@ -988,7 +988,7 @@ export function AgentDetail() {
/>
<button
type="button"
- className="h-6 w-6 shrink-0 text-yellow-100/70 hover:text-yellow-100"
+ className="h-6 w-6 shrink-0 text-yellow-900/70 hover:text-yellow-900 dark:text-yellow-100/70 dark:hover:text-yellow-100"
aria-label="Dismiss agent membership notice"
onClick={() => setDismissedLeftAgentIds((current) => new Set(current).add(agent.id))}
>
@@ -997,20 +997,20 @@ export function AgentDetail() {
</div>
) : null}
{hasInvalidOrgChain ? (
- <div className="flex items-start gap-3 border border-amber-300/35 bg-amber-300/10 px-3 py-2 text-sm text-amber-100">
+ <div className="flex items-start gap-3 border border-amber-300/35 bg-amber-300/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-100">
<AlertTriangle className="mt-0.5 h-4 w-4 shrink-0" />
<div className="min-w-0 space-y-1">
<p className="font-medium">Invalid reporting chain</p>
- <p className="text-amber-100/90">
+ <p className="text-amber-900/90 dark:text-amber-100/90">
{agent.name} cannot accept tasks or start runs until its reporting chain is repaired.
</p>
- <p className="break-words font-mono text-xs text-amber-100/80">
+ <p className="break-words font-mono text-xs text-amber-900/80 dark:text-amber-100/80">
{formatOrgChainHealthPath(agent)}
</p>
{agent.orgChainHealth?.repairGuidance ? (
- <p className="text-amber-100/85">{agent.orgChainHealth.repairGuidance}</p>
+ <p className="text-amber-900/85 dark:text-amber-100/85">{agent.orgChainHealth.repairGuidance}</p>
) : (
- <p className="text-amber-100/85">
+ <p className="text-amber-900/85 dark:text-amber-100/85">
Assign this agent to an active manager/root, or explicitly pause or terminate the affected agent/subtree.
</p>
)}
@@ -1068,7 +1068,7 @@ export function AgentDetail() {
<span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500" />
</span>
- <span className="text-[11px] font-medium text-blue-600 dark:text-blue-400">Live</span>
+ <span className="text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400">Live</span>
</Link>
)}
</AgentActionButtons>
@@ -1280,8 +1280,8 @@ function LatestRunCard({ runs, agentId }: { runs: HeartbeatRun[]; agentId: strin
<h3 className="flex items-center gap-2 text-sm font-medium">
{isLive && (
<span className="relative flex h-2 w-2">
- <span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75" />
- <span className="relative inline-flex rounded-full h-2 w-2 bg-cyan-400" />
+ <span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
+ <span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500" />
</span>
)}
{isLive ? "Live Run" : "Latest Run"}
@@ -1298,7 +1298,7 @@ function LatestRunCard({ runs, agentId }: { runs: HeartbeatRun[]; agentId: strin
to={`/agents/${agentId}/runs/${run.id}`}
className={cn(
"block border rounded-lg p-4 space-y-2 w-full no-underline transition-colors hover:bg-muted/50 cursor-pointer",
- isLive ? "border-cyan-500/30 shadow-[0_0_12px_rgba(6,182,212,0.08)]" : "border-border"
+ isLive ? "border-blue-500/30 shadow-(--shadow-extract-14)" : "border-border"
)}
>
<div className="flex items-center gap-2">
@@ -1306,7 +1306,7 @@ function LatestRunCard({ runs, agentId }: { runs: HeartbeatRun[]; agentId: strin
<StatusBadge status={run.status} />
<span className="font-mono text-xs text-muted-foreground">{run.id.slice(0, 8)}</span>
<span className={cn(
- "inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium",
+ "inline-flex items-center rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium",
run.invocationSource === "timer" ? "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300"
: run.invocationSource === "assignment" ? "bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300"
: run.invocationSource === "on_demand" ? "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300"
@@ -2156,7 +2156,7 @@ function PromptsTab({
{(bundle?.warnings ?? []).length > 0 && (
<div className="space-y-2">
{(bundle?.warnings ?? []).map((warning) => (
- <div key={warning} className="rounded-md border border-sky-500/25 bg-sky-500/10 px-3 py-2 text-xs text-sky-100">
+ <div key={warning} className="rounded-md border border-sky-500/25 bg-sky-500/10 px-3 py-2 text-xs text-sky-900 dark:text-sky-100">
{warning}
</div>
))}
@@ -2173,7 +2173,7 @@ function PromptsTab({
</CollapsibleTrigger>
<CollapsibleContent className="pt-4 pb-6">
<TooltipProvider>
- <div className="grid gap-x-6 gap-y-4 md:grid-cols-[auto_minmax(0,1fr)_minmax(12rem,0.65fr)]">
+ <div className="grid gap-x-6 gap-y-4 md:grid-cols-(--gtc-18)">
<label className="space-y-1.5 min-w-0">
<span className="text-xs font-medium text-muted-foreground flex items-center gap-1">
Mode
@@ -2435,7 +2435,7 @@ function PromptsTab({
return (
<Tooltip>
<TooltipTrigger asChild>
- <span className="ml-3 shrink-0 rounded border border-amber-500/40 bg-amber-500/10 text-amber-200 px-1.5 py-0.5 text-[10px] uppercase tracking-wide cursor-help">
+ <span className="ml-3 shrink-0 rounded border border-amber-500/40 bg-amber-500/10 text-amber-800 dark:text-amber-200 px-1.5 py-0.5 text-(length:--text-nano) uppercase tracking-wide cursor-help">
virtual file
</span>
</TooltipTrigger>
@@ -2446,7 +2446,7 @@ function PromptsTab({
);
}
return (
- <span className="ml-3 shrink-0 rounded border border-border text-muted-foreground px-1.5 py-0.5 text-[10px] uppercase tracking-wide">
+ <span className="ml-3 shrink-0 rounded border border-border text-muted-foreground px-1.5 py-0.5 text-(length:--text-nano) uppercase tracking-wide">
{file.isEntryFile ? "entry" : `${file.size}b`}
</span>
);
@@ -2531,7 +2531,7 @@ function PromptsTab({
onChange={(value) => setDraft(value ?? "")}
placeholder="# Agent instructions"
className="min-w-0 overflow-hidden"
- contentClassName="min-h-[420px] max-w-full break-words text-sm font-mono"
+ contentClassName="min-h-(--sz-420px) max-w-full break-words text-sm font-mono"
imageUploadHandler={async (file) => {
const namespace = `agents/${agent.id}/instructions/${selectedOrEntryFile.replaceAll("/", "-")}`;
const asset = await uploadMarkdownImage.mutateAsync({ file, namespace });
@@ -2542,7 +2542,7 @@ function PromptsTab({
<textarea
value={displayValue}
onChange={(event) => setDraft(event.target.value)}
- className="min-h-[420px] w-full min-w-0 rounded-md border border-border bg-transparent px-3 py-2 font-mono text-sm outline-none"
+ className="min-h-(--sz-420px) w-full min-w-0 rounded-md border border-border bg-transparent px-3 py-2 font-mono text-sm outline-none"
placeholder="File contents"
/>
)}
@@ -2560,7 +2560,7 @@ function PromptsTabSkeleton() {
<div className="flex items-start justify-between gap-4">
<div className="space-y-2">
<Skeleton className="h-4 w-40" />
- <Skeleton className="h-4 w-[30rem] max-w-full" />
+ <Skeleton className="h-4 w-(--sz-30rem) max-w-full" />
</div>
<Skeleton className="h-4 w-16" />
</div>
@@ -2573,7 +2573,7 @@ function PromptsTabSkeleton() {
))}
</div>
</div>
- <div className="grid gap-4 lg:grid-cols-[260px_minmax(0,1fr)]">
+ <div className="grid gap-4 lg:grid-cols-(--gtc-19)">
<div className="rounded-lg border border-border p-3 space-y-3">
<div className="flex items-center justify-between">
<Skeleton className="h-4 w-12" />
@@ -2602,7 +2602,7 @@ function PromptEditorSkeleton() {
return (
<div className="space-y-3">
<Skeleton className="h-10 w-full" />
- <Skeleton className="h-[420px] w-full" />
+ <Skeleton className="h-(--sz-420px) w-full" />
</div>
);
}
@@ -3043,7 +3043,7 @@ function RunListItem({ run, isSelected, agentId }: { run: HeartbeatRun; isSelect
{run.id.slice(0, 8)}
</span>
<span className={cn(
- "inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium shrink-0",
+ "inline-flex items-center rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium shrink-0",
run.invocationSource === "timer" ? "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300"
: run.invocationSource === "assignment" ? "bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300"
: run.invocationSource === "on_demand" ? "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300"
@@ -3051,8 +3051,8 @@ function RunListItem({ run, isSelected, agentId }: { run: HeartbeatRun; isSelect
)}>
{sourceLabels[run.invocationSource] ?? run.invocationSource}
</span>
- {sourceResolvedFold ? <SourceResolvedFoldBadge showIcon={false} className="shrink-0 text-[10px] py-0" /> : null}
- <span className="ml-auto text-[11px] text-muted-foreground shrink-0">
+ {sourceResolvedFold ? <SourceResolvedFoldBadge showIcon={false} className="shrink-0 text-(length:--text-nano) py-0" /> : null}
+ <span className="ml-auto text-(length:--text-micro) text-muted-foreground shrink-0">
{relativeTime(run.createdAt)}
</span>
</div>
@@ -3062,7 +3062,7 @@ function RunListItem({ run, isSelected, agentId }: { run: HeartbeatRun; isSelect
</span>
)}
{(metrics.totalTokens > 0 || metrics.cost > 0) && (
- <div className="flex items-center gap-2 pl-5.5 text-[11px] text-muted-foreground tabular-nums">
+ <div className="flex items-center gap-2 pl-5.5 text-(length:--text-micro) text-muted-foreground tabular-nums">
{metrics.totalTokens > 0 && <span>{formatTokens(metrics.totalTokens)} tok</span>}
{metrics.cost > 0 && <span>${metrics.cost.toFixed(3)}</span>}
</div>
@@ -3372,9 +3372,9 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
?? asNonEmptyString(adapterConfig?.model);
if (!adapterType && !displayProvider && !displayModel) return null;
return (
- <div className="text-[11px] text-muted-foreground font-mono flex items-center gap-1.5 flex-wrap">
+ <div className="text-(length:--text-micro) text-muted-foreground font-mono flex items-center gap-1.5 flex-wrap">
{adapterType && (
- <span className="bg-muted rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide">{adapterType.replace(/_/g, " ")}</span>
+ <span className="bg-muted rounded px-1.5 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide">{adapterType.replace(/_/g, " ")}</span>
)}
{displayProvider && displayModel && (
<span>{displayProvider}/{displayModel}</span>
@@ -3413,7 +3413,7 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
{endTime && <span className="text-muted-foreground"> &rarr; </span>}
{endTime}
</div>
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
{relativeTime(run.startedAt!)}
{run.finishedAt && <> &rarr; {relativeTime(run.finishedAt)}</>}
</div>
@@ -3494,7 +3494,7 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
<div className="flex flex-wrap items-center gap-2">
<span
className={cn(
- "rounded-md border px-1.5 py-0.5 text-[11px] font-medium",
+ "rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
retryState.tone,
)}
>
@@ -3567,7 +3567,7 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
<div className="pt-1">
<button
type="button"
- className="text-[11px] text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-60"
+ className="text-(length:--text-micro) text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-60"
disabled={clearSessionsForTouchedIssues.isPending}
onClick={() => {
const issueCount = touchedIssueIds.length;
@@ -3583,7 +3583,7 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
: "clear session for these tasks"}
</button>
{clearSessionsForTouchedIssues.isError && (
- <p className="text-[11px] text-destructive mt-1">
+ <p className="text-(length:--text-micro) text-destructive mt-1">
{clearSessionsForTouchedIssues.error instanceof Error
? clearSessionsForTouchedIssues.error.message
: "Failed to clear sessions"}
@@ -4105,7 +4105,7 @@ function LogViewer({ run, adapterType }: { run: HeartbeatRun; adapterType: strin
key={mode}
type="button"
className={cn(
- "rounded-md px-2.5 py-1 text-[11px] font-medium capitalize transition-colors",
+ "rounded-md px-2.5 py-1 text-(length:--text-micro) font-medium capitalize transition-colors",
transcriptMode === mode
? "bg-accent text-foreground shadow-sm"
: "text-muted-foreground hover:text-foreground",
@@ -4132,17 +4132,17 @@ function LogViewer({ run, adapterType }: { run: HeartbeatRun; adapterType: strin
</Button>
)}
{isLive && (
- <span className="flex items-center gap-1 text-xs text-cyan-400">
+ <span className="flex items-center gap-1 text-xs text-blue-600 dark:text-blue-400">
<span className="relative flex h-2 w-2">
- <span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75" />
- <span className="relative inline-flex rounded-full h-2 w-2 bg-cyan-400" />
+ <span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
+ <span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500" />
</span>
Live
</span>
)}
</div>
</div>
- <div className="max-h-[38rem] overflow-y-auto rounded-2xl border border-border/70 bg-background/40 p-3 sm:p-4">
+ <div className="max-h-(--sz-38rem) overflow-y-auto rounded-2xl border border-border/70 bg-background/40 p-3 sm:p-4">
<RunTranscriptView
entries={transcript}
mode={transcriptMode}
diff --git a/ui/src/pages/Agents.test.tsx b/ui/src/pages/Agents.test.tsx
index a5fa24b4c9..b73c5d8e2d 100644
--- a/ui/src/pages/Agents.test.tsx
+++ b/ui/src/pages/Agents.test.tsx
@@ -684,7 +684,7 @@ describe("Agents", () => {
await flushReact();
// The title cell carries a constant width (`w-56`), not a content-sized
- // `min-w-[7rem]`, so the `meta` group starts at the same x on every row and
+ // `min-w-(--sz-7rem)`, so the `meta` group starts at the same x on every row and
// the model + timestamp columns line up vertically.
const titleCell = container.querySelector(".w-56");
expect(titleCell).not.toBeNull();
diff --git a/ui/src/pages/Agents.tsx b/ui/src/pages/Agents.tsx
index c957d3bed3..bcc7570274 100644
--- a/ui/src/pages/Agents.tsx
+++ b/ui/src/pages/Agents.tsx
@@ -287,7 +287,7 @@ export function Agents() {
// Fixed (truncating) title width so the `meta` group starts at a
// constant x on every row — that's what makes the model + timestamp
// columns line up vertically. Agent names vary in width, so
- // a content-sized title (`min-w-[7rem]`) shifted meta's start per row.
+ // a content-sized title (`min-w-(--sz-7rem)`) shifted meta's start per row.
titleClassName="w-56"
subtitle={`${roleLabels[agent.role] ?? agent.role}${agent.title ? ` - ${agent.title}` : ""}`}
to={agentUrl(agent)}
@@ -550,7 +550,7 @@ function OrgTreeNode({
) : (
<AgentStatusCapsule status={node.status} />
)}
- <div className="flex-1 min-w-[7rem]">
+ <div className="flex-1 min-w-(--sz-7rem)">
<span className="text-sm font-medium">{node.name}</span>
<span className="text-xs text-muted-foreground ml-2">
{roleLabels[node.role] ?? node.role}
@@ -676,7 +676,7 @@ function AgentMetaColumns({
>
{model ?? "—"}
</div>
- <div className="truncate font-mono text-[11px] text-muted-foreground/70" title={adapterLabel}>
+ <div className="truncate font-mono text-(length:--text-micro) text-muted-foreground/70" title={adapterLabel}>
{adapterLabel}
</div>
</div>
@@ -685,7 +685,7 @@ function AgentMetaColumns({
<div className="truncate text-xs text-muted-foreground" title={environment.title}>
{environment.label}
</div>
- <div className="truncate text-[11px] text-muted-foreground/70">
+ <div className="truncate text-(length:--text-micro) text-muted-foreground/70">
{environment.detail}
</div>
</div>
@@ -716,7 +716,7 @@ function LiveRunIndicator({
<span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500" />
</span>
- <span className="text-[11px] font-medium text-blue-600 dark:text-blue-400">
+ <span className="text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400">
Live{liveCount > 1 ? ` (${liveCount})` : ""}
</span>
</Link>
diff --git a/ui/src/pages/ApprovalDetail.tsx b/ui/src/pages/ApprovalDetail.tsx
index 8ae692f74b..972b920f5e 100644
--- a/ui/src/pages/ApprovalDetail.tsx
+++ b/ui/src/pages/ApprovalDetail.tsx
@@ -255,7 +255,7 @@ export function ApprovalDetail() {
</Link>
))}
</div>
- <p className="text-[11px] text-muted-foreground mt-2">
+ <p className="text-(length:--text-micro) text-muted-foreground mt-2">
Linked tasks remain open until the requesting agent follows up and closes them.
</p>
</div>
diff --git a/ui/src/pages/Approvals.tsx b/ui/src/pages/Approvals.tsx
index a8fae37007..4369d83359 100644
--- a/ui/src/pages/Approvals.tsx
+++ b/ui/src/pages/Approvals.tsx
@@ -89,7 +89,7 @@ export function Approvals() {
<PageTabBar items={[
{ value: "pending", label: <>Pending{pendingCount > 0 && (
<span className={cn(
- "ml-1.5 rounded-full px-1.5 py-0.5 text-[10px] font-medium",
+ "ml-1.5 rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium",
"bg-yellow-500/20 text-yellow-500"
)}>
{pendingCount}
diff --git a/ui/src/pages/BoardChat.tsx b/ui/src/pages/BoardChat.tsx
index 3cd7f98b30..cb6037cc0c 100644
--- a/ui/src/pages/BoardChat.tsx
+++ b/ui/src/pages/BoardChat.tsx
@@ -51,7 +51,7 @@ const BOARD_CHAT_MARKDOWN_CLASS =
"max-w-full overflow-visible [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:block [&_table]:max-w-full [&_table]:overflow-x-auto";
const boardChatBubbleShell =
- "min-w-0 max-w-[85%] break-words px-3 py-2 text-sm overflow-x-auto overflow-y-visible";
+ "min-w-0 max-w-(--pct-85) break-words px-3 py-2 text-sm overflow-x-auto overflow-y-visible";
/** First-letter(s) fallback for an agent with no icon. */
function agentInitials(name: string): string {
@@ -668,7 +668,7 @@ export function BoardChat() {
}
return (
- <div className="flex h-[calc(100%+3rem)] flex-col -m-6">
+ <div className="flex h-(--sz-calc-29) flex-col -m-6">
<div
ref={splitContainerRef}
className="flex min-h-0 min-w-0 flex-1 flex-row"
@@ -1010,7 +1010,7 @@ export function BoardChat() {
<Activity className="h-4 w-4" />
</Button>
</SheetTrigger>
- <SheetContent side="bottom" className="h-[70vh] p-0 rounded-t-xl">
+ <SheetContent side="bottom" className="h-(--sz-70vh) p-0 rounded-t-xl">
<ActivityFeed />
</SheetContent>
</Sheet>
diff --git a/ui/src/pages/CloudUpstream.tsx b/ui/src/pages/CloudUpstream.tsx
index 0b23d3549a..012ead2f7d 100644
--- a/ui/src/pages/CloudUpstream.tsx
+++ b/ui/src/pages/CloudUpstream.tsx
@@ -271,7 +271,7 @@ export function CloudUpstream() {
<div className="text-xs font-medium uppercase tracking-wide text-muted-foreground">Connection</div>
<div className="rounded-md border border-border px-4 py-4">
{connection ? (
- <div className="grid gap-3 lg:grid-cols-[1fr_auto] lg:items-start">
+ <div className="grid gap-3 lg:grid-cols-(--gtc-17) lg:items-start">
<div>
<div className="text-sm font-medium">
{connection.target.stackDisplayName ?? connection.target.stackSlug ?? connection.target.stackId}
@@ -297,7 +297,7 @@ export function CloudUpstream() {
</div>
</div>
) : (
- <div className="grid gap-3 md:grid-cols-[1fr_auto]">
+ <div className="grid gap-3 md:grid-cols-(--gtc-17)">
<Input
value={remoteUrl}
onChange={(event) => setRemoteUrl(event.target.value)}
@@ -382,7 +382,7 @@ export function CloudUpstream() {
</div>
<div className="mt-4 divide-y divide-border">
{latestRun.events.map((event) => (
- <div key={event.id} className="grid gap-2 py-2 text-sm sm:grid-cols-[7rem_8rem_1fr]">
+ <div key={event.id} className="grid gap-2 py-2 text-sm sm:grid-cols-(--gtc-20)">
<span className="text-xs text-muted-foreground">{formatDate(event.at)}</span>
<span className="text-xs capitalize text-muted-foreground">{event.phase}</span>
<span>{event.message}</span>
@@ -413,7 +413,7 @@ export function CloudUpstream() {
<button
key={run.id}
type="button"
- className="grid w-full gap-1 px-4 py-3 text-left text-sm hover:bg-accent/40 sm:grid-cols-[1fr_auto]"
+ className="grid w-full gap-1 px-4 py-3 text-left text-sm hover:bg-accent/40 sm:grid-cols-(--gtc-17)"
onClick={() => setActiveRun(run)}
>
<span>Run {run.id.slice(0, 8)} · {run.status}</span>
@@ -486,7 +486,7 @@ function WarningsPanel({ warnings }: { warnings: CloudUpstreamPreview["warnings"
</div>
<div className="divide-y divide-border">
{warnings.map((warning) => (
- <div key={warning.code} className="grid gap-2 py-2 sm:grid-cols-[1.25rem_12rem_1fr]">
+ <div key={warning.code} className="grid gap-2 py-2 sm:grid-cols-(--gtc-21)">
<AlertTriangle className={warning.severity === "blocker" ? "h-4 w-4 text-destructive" : "h-4 w-4 text-amber-600"} />
<div className="text-sm font-medium">{warning.title}</div>
<div className="text-sm text-muted-foreground">{warning.detail}</div>
@@ -506,7 +506,7 @@ function ConflictTable({ conflicts }: { conflicts: CloudUpstreamPreview["conflic
) : (
<div className="divide-y divide-border">
{conflicts.map((conflict) => (
- <div key={conflict.id} className="grid gap-2 py-2 text-sm sm:grid-cols-[8rem_1fr_1fr_8rem]">
+ <div key={conflict.id} className="grid gap-2 py-2 text-sm sm:grid-cols-(--gtc-22)">
<span className="text-muted-foreground">{conflict.entityType}</span>
<span>{conflict.sourceLabel}</span>
<span>{conflict.targetLabel}</span>
@@ -539,7 +539,7 @@ function ActivationChecklist({
const pending = isPending && pendingEntityType === row.key;
const activated = row.status === "activated";
return (
- <div key={row.key} className="grid gap-2 py-2 text-sm sm:grid-cols-[8rem_1fr_auto] sm:items-center">
+ <div key={row.key} className="grid gap-2 py-2 text-sm sm:grid-cols-(--gtc-23) sm:items-center">
<div>
<div className="font-medium">{row.label}</div>
<div className="text-xs text-muted-foreground">{row.statusLabel}</div>
diff --git a/ui/src/pages/CloudUpstreamUxLab.tsx b/ui/src/pages/CloudUpstreamUxLab.tsx
index 976c3d865a..ecc1f20bac 100644
--- a/ui/src/pages/CloudUpstreamUxLab.tsx
+++ b/ui/src/pages/CloudUpstreamUxLab.tsx
@@ -189,7 +189,7 @@ function CloudUpstreamRender({ fixture }: { fixture: Fixture }) {
<div className="text-xs font-medium uppercase tracking-wide text-muted-foreground">Connection</div>
<div className="rounded-md border border-border px-4 py-4">
{connection ? (
- <div className="grid gap-3 lg:grid-cols-[1fr_auto] lg:items-start">
+ <div className="grid gap-3 lg:grid-cols-(--gtc-17) lg:items-start">
<div>
<div className="text-sm font-medium">
{connection.target.stackDisplayName ?? connection.target.stackSlug ?? connection.target.stackId}
@@ -207,7 +207,7 @@ function CloudUpstreamRender({ fixture }: { fixture: Fixture }) {
</Button>
</div>
) : (
- <div className="grid gap-3 md:grid-cols-[1fr_auto]">
+ <div className="grid gap-3 md:grid-cols-(--gtc-17)">
<Input
defaultValue="https://paperclip.paperclip.app/PC521D/dashboard"
placeholder="https://paperclip.paperclip.app/PC521D/dashboard"
@@ -279,7 +279,7 @@ function CloudUpstreamRender({ fixture }: { fixture: Fixture }) {
</div>
<div className="mt-4 divide-y divide-border">
{latestRun.events.map((event) => (
- <div key={event.id} className="grid gap-2 py-2 text-sm sm:grid-cols-[7rem_8rem_1fr]">
+ <div key={event.id} className="grid gap-2 py-2 text-sm sm:grid-cols-(--gtc-20)">
<span className="text-xs text-muted-foreground">{formatDate(event.at)}</span>
<span className="text-xs capitalize text-muted-foreground">{event.phase}</span>
<span>{event.message}</span>
@@ -302,7 +302,7 @@ function CloudUpstreamRender({ fixture }: { fixture: Fixture }) {
{history.map((run) => (
<div
key={run.id}
- className="grid w-full gap-1 px-4 py-3 text-left text-sm hover:bg-accent/40 sm:grid-cols-[1fr_auto]"
+ className="grid w-full gap-1 px-4 py-3 text-left text-sm hover:bg-accent/40 sm:grid-cols-(--gtc-17)"
>
<span>Run {run.id.slice(0, 8)} · {run.status}</span>
<span className="text-xs text-muted-foreground">{formatDate(run.createdAt)}</span>
@@ -359,7 +359,7 @@ function WarningsPanel({ warnings }: { warnings: CloudUpstreamWarning[] }) {
</div>
<div className="divide-y divide-border">
{warnings.map((warning) => (
- <div key={warning.code} className="grid gap-2 py-2 sm:grid-cols-[1.25rem_12rem_1fr]">
+ <div key={warning.code} className="grid gap-2 py-2 sm:grid-cols-(--gtc-21)">
<AlertTriangle className={warning.severity === "blocker" ? "h-4 w-4 text-destructive" : "h-4 w-4 text-amber-600"} />
<div className="text-sm font-medium">{warning.title}</div>
<div className="text-sm text-muted-foreground">{warning.detail}</div>
@@ -379,7 +379,7 @@ function ConflictTable({ conflicts }: { conflicts: CloudUpstreamConflict[] }) {
) : (
<div className="divide-y divide-border">
{conflicts.map((conflict) => (
- <div key={conflict.id} className="grid gap-2 py-2 text-sm sm:grid-cols-[8rem_1fr_1fr_8rem]">
+ <div key={conflict.id} className="grid gap-2 py-2 text-sm sm:grid-cols-(--gtc-22)">
<span className="text-muted-foreground">{conflict.entityType}</span>
<span>{conflict.sourceLabel}</span>
<span>{conflict.targetLabel}</span>
@@ -401,7 +401,7 @@ function ActivationChecklist({ run }: { run: CloudUpstreamRun }) {
{rows.map((row) => {
const activated = row.status === "activated";
return (
- <div key={row.key} className="grid gap-2 py-2 text-sm sm:grid-cols-[8rem_1fr_auto] sm:items-center">
+ <div key={row.key} className="grid gap-2 py-2 text-sm sm:grid-cols-(--gtc-23) sm:items-center">
<div>
<div className="font-medium">{row.label}</div>
<div className="text-xs text-muted-foreground">{row.statusLabel}</div>
diff --git a/ui/src/pages/Companies.tsx b/ui/src/pages/Companies.tsx
index a5046bbda8..d6438e9b5f 100644
--- a/ui/src/pages/Companies.tsx
+++ b/ui/src/pages/Companies.tsx
@@ -168,7 +168,7 @@ export function Companies() {
<div className="flex items-center gap-2">
<h3 className="font-semibold text-base">{company.name}</h3>
<span
- className={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${
+ className={`inline-flex items-center rounded-full px-2 py-0.5 text-(length:--text-micro) font-medium ${
company.status === "active"
? "bg-green-500/10 text-green-600 dark:text-green-400"
: company.status === "paused"
diff --git a/ui/src/pages/CompanyAccess.tsx b/ui/src/pages/CompanyAccess.tsx
index 558bd05b01..24ef4b6061 100644
--- a/ui/src/pages/CompanyAccess.tsx
+++ b/ui/src/pages/CompanyAccess.tsx
@@ -249,7 +249,7 @@ export function CompanyAccess() {
</div>
{access && !access.currentUserRole && (
- <div className="rounded-xl border border-amber-500/40 px-4 py-3 text-sm text-amber-200">
+ <div className="rounded-xl border border-amber-500/40 px-4 py-3 text-sm text-amber-800 dark:text-amber-200">
This account can manage access here through instance-admin privileges, but it does not currently hold an active company membership.
</div>
)}
@@ -310,7 +310,7 @@ export function CompanyAccess() {
) : null}
<div className="overflow-hidden rounded-xl border border-border">
- <div className="grid grid-cols-[minmax(0,1.5fr)_120px_120px_180px] gap-3 border-b border-border px-4 py-3 text-xs font-medium uppercase tracking-wide text-muted-foreground">
+ <div className="grid grid-cols-(--gtc-24) gap-3 border-b border-border px-4 py-3 text-xs font-medium uppercase tracking-wide text-muted-foreground">
<div>User account</div>
<div>Role</div>
<div>Status</div>
@@ -325,7 +325,7 @@ export function CompanyAccess() {
return (
<div
key={member.id}
- className="grid grid-cols-[minmax(0,1.5fr)_120px_120px_180px] gap-3 border-b border-border px-4 py-3 last:border-b-0"
+ className="grid grid-cols-(--gtc-24) gap-3 border-b border-border px-4 py-3 last:border-b-0"
>
<div className="min-w-0">
<div className="truncate font-medium">{member.user?.name?.trim() || member.user?.email || member.principalId}</div>
diff --git a/ui/src/pages/CompanyEnvironments.tsx b/ui/src/pages/CompanyEnvironments.tsx
index 444db4358c..8b0d3c6880 100644
--- a/ui/src/pages/CompanyEnvironments.tsx
+++ b/ui/src/pages/CompanyEnvironments.tsx
@@ -424,6 +424,7 @@ function EnvironmentCustomImageBrowserTerminal({
lineHeight: 1.35,
scrollback: CUSTOM_IMAGE_TERMINAL_SCROLLBACK_ROWS,
theme: {
+ // token-extraction: allowlisted — xterm.js terminal theme config; functional third-party option object, not a rendered CSS value.
background: "#0a0a0a",
foreground: "#f5f5f5",
cursor: "#22d3ee",
@@ -620,7 +621,7 @@ function EnvironmentCustomImageBrowserTerminal({
tabIndex={0}
onFocus={() => xtermRef.current?.focus()}
onClick={() => xtermRef.current?.focus()}
- className="h-[18rem] w-full overflow-hidden bg-neutral-950 outline-none sm:h-[22rem] [&_.xterm-cursor-bar]:!border-l-2 [&_.xterm-cursor-bar]:!border-l-cyan-300 [&_.xterm-cursor-layer_.xterm-cursor]:!bg-cyan-300 [&_.xterm-helper-textarea]:!opacity-0 [&_.xterm-screen]:focus:outline-none [&_.xterm-viewport]:!overflow-y-auto [&_.xterm]:h-full"
+ className="h-(--sz-18rem) w-full overflow-hidden bg-neutral-950 outline-none sm:h-(--sz-22rem) [&_.xterm-cursor-bar]:!border-l-2 [&_.xterm-cursor-bar]:!border-l-cyan-300 [&_.xterm-cursor-layer_.xterm-cursor]:!bg-cyan-300 [&_.xterm-helper-textarea]:!opacity-0 [&_.xterm-screen]:focus:outline-none [&_.xterm-viewport]:!overflow-y-auto [&_.xterm]:h-full"
/>
</div>
{errorMessage ? (
@@ -942,7 +943,7 @@ function EnvironmentImageTemplatePanel({
<summary className="cursor-pointer select-none font-medium text-foreground">
SSH command fallback
</summary>
- <code className="mt-2 block overflow-x-auto whitespace-nowrap text-[11px] leading-5">
+ <code className="mt-2 block overflow-x-auto whitespace-nowrap text-(length:--text-micro) leading-5">
{connectionCommand}
</code>
</details>
@@ -1381,7 +1382,7 @@ export function CompanyEnvironments() {
<div className="space-y-1">
<div className="text-sm font-medium">Default</div>
</div>
- <div className="min-w-[18rem] flex-1">
+ <div className="min-w-(--sz-18rem) flex-1">
<select
className="w-full rounded-md border border-border bg-transparent px-2.5 py-1.5 text-sm outline-none"
value={instanceDefaultEnvironmentId}
@@ -1478,7 +1479,7 @@ export function CompanyEnvironments() {
>
<div className="font-medium">{probe.summary}</div>
{probe.details?.error && typeof probe.details.error === "string" ? (
- <div className="mt-1 font-mono text-[11px]">{probe.details.error}</div>
+ <div className="mt-1 font-mono text-(length:--text-micro)">{probe.details.error}</div>
) : null}
</div>
) : null}
@@ -1498,7 +1499,7 @@ export function CompanyEnvironments() {
closeEnvironmentDialog();
}}
>
- <DialogContent className="flex max-h-[calc(100dvh-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl">
+ <DialogContent className="flex max-h-(--sz-calc-18) flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl">
<DialogHeader className="border-b border-border/60 px-6 pb-4 pr-12 pt-6">
<DialogTitle>{editingEnvironmentId ? "Edit environment" : "Add environment"}</DialogTitle>
<DialogDescription>
diff --git a/ui/src/pages/CompanyExport.tsx b/ui/src/pages/CompanyExport.tsx
index 0a5c1773f8..7bca198761 100644
--- a/ui/src/pages/CompanyExport.tsx
+++ b/ui/src/pages/CompanyExport.tsx
@@ -353,7 +353,7 @@ function FrontmatterCard({
}) {
return (
<div className="rounded-md border border-border bg-accent/20 px-4 py-3 mb-4">
- <dl className="grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1.5 text-sm">
+ <dl className="grid grid-cols-(--gtc-5) gap-x-4 gap-y-1.5 text-sm">
{Object.entries(data).map(([key, value]) => (
<div key={key} className="contents">
<dt className="text-muted-foreground whitespace-nowrap py-0.5">
@@ -528,7 +528,7 @@ function ExportPreviewPane({
<div className="border-b border-border px-5 py-3">
<div className="truncate font-mono text-sm">{selectedFile}</div>
</div>
- <div className="min-h-[560px] px-5 py-5">
+ <div className="min-h-(--sz-560px) px-5 py-5">
{parsed ? (
<>
<FrontmatterCard data={parsed.data} onSkillClick={onSkillClick} />
@@ -537,8 +537,8 @@ function ExportPreviewPane({
) : isMarkdown ? (
<MarkdownBody resolveImageSrc={resolveImageSrc} softBreaks={false} linkIssueReferences={false}>{textContent ?? ""}</MarkdownBody>
) : imageSrc ? (
- <div className="flex min-h-[520px] items-center justify-center rounded-lg border border-border bg-accent/10 p-6">
- <img src={imageSrc} alt={selectedFile} className="max-h-[480px] max-w-full object-contain" />
+ <div className="flex min-h-(--sz-520px) items-center justify-center rounded-lg border border-border bg-accent/10 p-6">
+ <img src={imageSrc} alt={selectedFile} className="max-h-(--sz-480px) max-w-full object-contain" />
</div>
) : textContent !== null ? (
<pre className="overflow-x-auto whitespace-pre-wrap break-words border-0 bg-transparent p-0 font-mono text-sm text-foreground">
@@ -969,8 +969,8 @@ export function CompanyExport() {
)}
{/* Two-column layout */}
- <div className="grid gap-4 xl:h-[calc(100vh-12rem)] xl:grid-cols-[19rem_minmax(0,1fr)] xl:gap-0">
- <aside className="flex max-h-[24rem] flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r">
+ <div className="grid gap-4 xl:h-(--sz-calc-30) xl:grid-cols-(--gtc-25) xl:gap-0">
+ <aside className="flex max-h-(--sz-24rem) flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r">
<div className="border-b border-border px-4 py-3 shrink-0">
<h2 className="text-base font-semibold">Package files</h2>
</div>
diff --git a/ui/src/pages/CompanyImport.tsx b/ui/src/pages/CompanyImport.tsx
index cae6bcf0c0..08d041af9f 100644
--- a/ui/src/pages/CompanyImport.tsx
+++ b/ui/src/pages/CompanyImport.tsx
@@ -115,7 +115,7 @@ const ACTION_COLORS: Record<string, string> = {
function FrontmatterCard({ data }: { data: FrontmatterData }) {
return (
<div className="rounded-md border border-border bg-accent/20 px-4 py-3 mb-4">
- <dl className="grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1.5 text-sm">
+ <dl className="grid grid-cols-(--gtc-5) gap-x-4 gap-y-1.5 text-sm">
{Object.entries(data).map(([key, value]) => (
<div key={key} className="contents">
<dt className="text-muted-foreground whitespace-nowrap py-0.5">
@@ -151,7 +151,7 @@ function renderImportFileExtra(node: FileTreeNode, checked: boolean, renameMap:
const renamedTo = node.kind === "dir" ? renameMap.get(node.path) : undefined;
const actionBadge = node.action ? (
<span className={cn(
- "shrink-0 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wide",
+ "shrink-0 rounded-full border px-2 py-0.5 text-(length:--text-nano) uppercase tracking-wide",
ACTION_COLORS[node.action] ?? ACTION_COLORS.skip,
)}>
{checked ? node.action : "skip"}
@@ -163,7 +163,7 @@ function renderImportFileExtra(node: FileTreeNode, checked: boolean, renameMap:
return (
<span className="inline-flex items-center gap-1.5 shrink-0">
{renamedTo && checked && (
- <span className="text-[10px] text-cyan-500 font-mono truncate max-w-[7rem]" title={renamedTo}>
+ <span className="text-(length:--text-nano) text-cyan-500 font-mono truncate max-w-(--sz-7rem)" title={renamedTo}>
&rarr; {renamedTo}
</span>
)}
@@ -237,7 +237,7 @@ function ImportPreviewPane({
)}
</div>
</div>
- <div className="min-h-[560px] px-5 py-5">
+ <div className="min-h-(--sz-560px) px-5 py-5">
{parsed ? (
<>
<FrontmatterCard data={parsed.data} />
@@ -246,8 +246,8 @@ function ImportPreviewPane({
) : isMarkdown ? (
<MarkdownBody resolveImageSrc={resolveImageSrc} softBreaks={false} linkIssueReferences={false}>{textContent ?? ""}</MarkdownBody>
) : imageSrc ? (
- <div className="flex min-h-[520px] items-center justify-center rounded-lg border border-border bg-accent/10 p-6">
- <img src={imageSrc} alt={selectedFile} className="max-h-[480px] max-w-full object-contain" />
+ <div className="flex min-h-(--sz-520px) items-center justify-center rounded-lg border border-border bg-accent/10 p-6">
+ <img src={imageSrc} alt={selectedFile} className="max-h-(--sz-480px) max-w-full object-contain" />
</div>
) : textContent !== null ? (
<pre className="overflow-x-auto whitespace-pre-wrap break-words border-0 bg-transparent p-0 font-mono text-sm text-foreground">
@@ -446,7 +446,7 @@ function ConflictResolutionList({
</button>
<span className={cn(
- "shrink-0 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wide",
+ "shrink-0 rounded-full border px-2 py-0.5 text-(length:--text-nano) uppercase tracking-wide",
isSkipped
? "text-muted-foreground border-border"
: isConfirmed
@@ -564,7 +564,7 @@ function AdapterPickerList({
<div key={agent.slug}>
<div className="flex items-center gap-3 px-4 py-2.5 text-sm">
<span className={cn(
- "shrink-0 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wide",
+ "shrink-0 rounded-full border px-2 py-0.5 text-(length:--text-nano) uppercase tracking-wide",
"text-blue-500 border-blue-500/30",
)}>
agent
@@ -1319,8 +1319,8 @@ export function CompanyImport() {
)}
{/* Two-column layout */}
- <div className="grid gap-4 xl:h-[calc(100vh-16rem)] xl:grid-cols-[19rem_minmax(0,1fr)] xl:gap-0">
- <aside className="flex max-h-[24rem] flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r">
+ <div className="grid gap-4 xl:h-(--sz-calc-31) xl:grid-cols-(--gtc-25) xl:gap-0">
+ <aside className="flex max-h-(--sz-24rem) flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r">
<div className="border-b border-border px-4 py-3 shrink-0">
<h2 className="text-base font-semibold">Package files</h2>
</div>
diff --git a/ui/src/pages/CompanySettings.tsx b/ui/src/pages/CompanySettings.tsx
index 5fce4d0587..a174b63366 100644
--- a/ui/src/pages/CompanySettings.tsx
+++ b/ui/src/pages/CompanySettings.tsx
@@ -217,7 +217,7 @@ export function CompanySettings() {
companyName={companyName || selectedCompany.name}
logoUrl={logoUrl || null}
brandColor={brandColor || null}
- className="rounded-[14px]"
+ className="rounded-(--rad-14)"
/>
</div>
<div className="flex-1 space-y-3">
@@ -267,6 +267,7 @@ export function CompanySettings() {
hint="Sets the hue for the company icon. Leave empty for auto-generated color."
>
<div className="flex items-center gap-2">
+ {/* token-extraction: allowlisted — <input type="color"> value must be a real hex string, not a var() reference. */}
<input
type="color"
value={brandColor || "#6366f1"}
diff --git a/ui/src/pages/CompanySettingsPluginPage.tsx b/ui/src/pages/CompanySettingsPluginPage.tsx
index e4961a369c..77b0eea280 100644
--- a/ui/src/pages/CompanySettingsPluginPage.tsx
+++ b/ui/src/pages/CompanySettingsPluginPage.tsx
@@ -81,7 +81,7 @@ export function CompanySettingsPluginPage() {
<PluginSlotMount
slot={pageSlot}
context={{ companyId: resolvedCompanyId, companyPrefix }}
- className="min-h-[200px]"
+ className="min-h-(--sz-200px)"
missingBehavior="placeholder"
/>
);
diff --git a/ui/src/pages/CompanySkills.tsx b/ui/src/pages/CompanySkills.tsx
index 0e1b12b010..1d023705d4 100644
--- a/ui/src/pages/CompanySkills.tsx
+++ b/ui/src/pages/CompanySkills.tsx
@@ -336,7 +336,7 @@ function SourceFilterMenu({
>
<Filter className="h-3.5 w-3.5" />
{activeFilterCount > 0 ? (
- <span className="absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-[9px] font-bold text-white">
+ <span className="absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-(length:--text-nano) font-bold text-white">
{activeFilterCount}
</span>
) : null}
@@ -382,13 +382,13 @@ function CatalogFilterMenu({
>
<Filter className="h-3.5 w-3.5" />
{activeFilterCount > 0 ? (
- <span className="absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-[9px] font-bold text-white">
+ <span className="absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-(length:--text-nano) font-bold text-white">
{activeFilterCount}
</span>
) : null}
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="max-h-[min(28rem,70vh)] w-56 overflow-y-auto">
+ <DropdownMenuContent align="end" className="max-h-(--sz-calc-32) w-56 overflow-y-auto">
<DropdownMenuLabel>Type</DropdownMenuLabel>
<DropdownMenuRadioGroup value={kindFilter} onValueChange={(next) => onKindChange(next as "all" | "bundled" | "optional")}>
<DropdownMenuRadioItem value="all">All</DropdownMenuRadioItem>
@@ -422,13 +422,13 @@ function TrustChip({ level }: { level: CompanySkillTrustLevel }) {
icon: Folder,
label: "Includes assets",
tooltip: "Ships images, fonts, or other non-script files.",
- className: "border-cyan-500/30 bg-cyan-500/10 text-cyan-200",
+ className: "border-cyan-500/30 bg-cyan-500/10 text-cyan-800 dark:text-cyan-200",
},
scripts_executables: {
icon: AlertTriangle,
label: "Includes scripts",
tooltip: "Ships executable scripts. Review before installing.",
- className: "border-amber-500/40 bg-amber-500/10 text-amber-200",
+ className: "border-amber-500/40 bg-amber-500/10 text-amber-800 dark:text-amber-200",
},
} as const;
const config = map[level] ?? map.markdown_only;
@@ -436,7 +436,7 @@ function TrustChip({ level }: { level: CompanySkillTrustLevel }) {
return (
<Tooltip>
<TooltipTrigger asChild>
- <span className={cn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]", config.className)}>
+ <span className={cn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-(length:--text-micro)", config.className)}>
<Icon className="h-3 w-3" aria-hidden="true" />
{config.label}
</span>
@@ -453,7 +453,7 @@ function CompatChip({ compatibility }: { compatibility: CompanySkillCompatibilit
icon: HelpCircle,
label: "Unknown format",
tooltip: "Paperclip could not validate this skill as Agent Skills markdown. Install at your own risk.",
- className: "border-yellow-500/40 bg-yellow-500/10 text-yellow-200",
+ className: "border-yellow-500/40 bg-yellow-500/10 text-yellow-800 dark:text-yellow-200",
},
invalid: {
icon: XOctagon,
@@ -467,7 +467,7 @@ function CompatChip({ compatibility }: { compatibility: CompanySkillCompatibilit
return (
<Tooltip>
<TooltipTrigger asChild>
- <span className={cn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]", config.className)}>
+ <span className={cn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-(length:--text-micro)", config.className)}>
<Icon className="h-3 w-3" aria-hidden="true" />
{config.label}
</span>
@@ -482,7 +482,7 @@ function ProvenanceBadge({ packageName, packageVersion }: { packageName: string
return (
<Tooltip>
<TooltipTrigger asChild>
- <span className="inline-flex items-center gap-1 rounded border border-border bg-muted/30 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground">
+ <span className="inline-flex items-center gap-1 rounded border border-border bg-muted/30 px-1.5 py-0.5 font-mono text-(length:--text-nano) text-muted-foreground">
<Boxes className="h-3 w-3" aria-hidden="true" />
<span>{packageName}{packageVersion ? ` v${packageVersion}` : ""}</span>
</span>
@@ -545,6 +545,7 @@ export type DiscoveryCard = {
// Stable palette used to auto-assign an accent colour to a skill when the
// backend has not stored an explicit one. Colour is derived from the skill key
// so the same skill always lands on the same hue.
+// token-extraction: allowlisted — skill.color is persisted/compared JS data (SkillCreateDraft), not just a rendered value; a var() string would corrupt it.
const DISCOVERY_ACCENTS = [
"#6366f1", "#0ea5e9", "#10b981", "#f59e0b", "#ef4444",
"#8b5cf6", "#ec4899", "#14b8a6", "#f97316", "#22c55e",
@@ -791,7 +792,7 @@ function SkillStat({ icon: Icon, value }: { icon: typeof Star; value: string })
function SkillCategoryChip({ label }: { label: string }) {
return (
- <span className="inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[10px] capitalize text-muted-foreground">
+ <span className="inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-(length:--text-nano) capitalize text-muted-foreground">
{label}
</span>
);
@@ -803,7 +804,7 @@ function SkillCard({ card, onOpen }: { card: DiscoveryCard; onOpen: (card: Disco
type="button"
onClick={() => onOpen(card)}
className={cn(
- "group flex h-full min-h-[11.5rem] flex-col rounded-md border border-border p-4 text-left transition-colors hover:border-primary hover:bg-accent/30 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "group flex h-full min-h-(--sz-11_5rem) flex-col rounded-md border border-border p-4 text-left transition-colors hover:border-primary hover:bg-accent/30 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
card.required && "bg-muted/30",
)}
>
@@ -828,7 +829,7 @@ function SkillCard({ card, onOpen }: { card: DiscoveryCard; onOpen: (card: Disco
</div>
{card.forkedFrom ? (
- <div className="mt-2 inline-flex items-center gap-1 text-[11px] text-muted-foreground">
+ <div className="mt-2 inline-flex items-center gap-1 text-(length:--text-micro) text-muted-foreground">
<GitFork className="h-3 w-3" aria-hidden="true" />
Forked
</div>
@@ -846,7 +847,7 @@ function SkillCard({ card, onOpen }: { card: DiscoveryCard; onOpen: (card: Disco
<div className="mt-auto pt-3">
{/* Stats: installed agents · stars · forks — stars/forks only when > 0. */}
- <div className="flex items-center gap-2 text-[11px] text-muted-foreground">
+ <div className="flex items-center gap-2 text-(length:--text-micro) text-muted-foreground">
<span>{card.agentCount} {card.agentCount === 1 ? "agent" : "agents"}</span>
{card.starCount > 0 ? (
<>
@@ -863,7 +864,7 @@ function SkillCard({ card, onOpen }: { card: DiscoveryCard; onOpen: (card: Disco
</div>
<div className="mt-2 flex flex-wrap items-center gap-1">
{card.installed ? (
- <span className="inline-flex items-center rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-0.5 text-[10px] text-emerald-300">
+ <span className="inline-flex items-center rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-0.5 text-(length:--text-nano) text-emerald-700 dark:text-emerald-300">
Installed
</span>
) : null}
@@ -871,7 +872,7 @@ function SkillCard({ card, onOpen }: { card: DiscoveryCard; onOpen: (card: Disco
<SkillCategoryChip key={category} label={category} />
))}
{card.required ? (
- <span className="ml-auto inline-flex items-center gap-1 rounded-full border border-border bg-muted/60 px-2 py-0.5 text-[10px] text-muted-foreground">
+ <span className="ml-auto inline-flex items-center gap-1 rounded-full border border-border bg-muted/60 px-2 py-0.5 text-(length:--text-nano) text-muted-foreground">
<Lock className="h-3 w-3" aria-hidden="true" />
Bundled
</span>
@@ -996,7 +997,7 @@ export function DiscoveryGrid({
// On desktop the store is bounded to the viewport so the category sidebar
// and the results pane each scroll independently (PAP-10907). Mobile keeps
// the natural page flow.
- <div className="flex min-h-[calc(100vh-12rem)] md:h-[calc(100dvh-6rem)] md:min-h-0 md:overflow-hidden">
+ <div className="flex min-h-(--sz-calc-30) md:h-(--sz-calc-33) md:min-h-0 md:overflow-hidden">
{/* Secondary category sidebar — the main app nav collapses to a rail while
this is present (handled in Layout). */}
<aside className="hidden w-60 shrink-0 flex-col overflow-hidden border-r border-border md:flex">
@@ -1004,7 +1005,7 @@ export function DiscoveryGrid({
<h2 className="text-sm font-semibold text-foreground">Skills Store</h2>
<p className="text-xs text-muted-foreground">Discover, install, fork, share</p>
</div>
- <div className="px-4 pb-1 pt-3 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
+ <div className="px-4 pb-1 pt-3 text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">
Categories
</div>
<div className="min-h-0 flex-1 overflow-y-auto pb-4">
@@ -1020,7 +1021,7 @@ export function DiscoveryGrid({
<div className="flex min-w-0 flex-1 flex-col overflow-hidden">
{/* Search + sort + actions */}
<div className="flex flex-wrap items-center gap-2 border-b border-border px-4 py-3">
- <div className="flex h-9 min-w-[12rem] flex-1 items-center gap-2 rounded-md border border-border px-2.5">
+ <div className="flex h-9 min-w-(--sz-12rem) flex-1 items-center gap-2 rounded-md border border-border px-2.5">
<Search className="h-4 w-4 shrink-0 text-muted-foreground" aria-hidden="true" />
<input
value={search}
@@ -1137,19 +1138,19 @@ export function DiscoveryGrid({
<TabsList variant="line" className="p-0">
<TabsTrigger value="all" className="px-3">
<span>All</span>
- <span className="ml-1.5 text-[11px] text-muted-foreground">{tabCounts.all}</span>
+ <span className="ml-1.5 text-(length:--text-micro) text-muted-foreground">{tabCounts.all}</span>
</TabsTrigger>
<TabsTrigger value="installed" className="px-3">
<span>Installed</span>
- <span className="ml-1.5 text-[11px] text-muted-foreground">{tabCounts.installed}</span>
+ <span className="ml-1.5 text-(length:--text-micro) text-muted-foreground">{tabCounts.installed}</span>
</TabsTrigger>
<TabsTrigger value="catalog" className="px-3">
<span>Catalog</span>
- <span className="ml-1.5 text-[11px] text-muted-foreground">{tabCounts.catalog}</span>
+ <span className="ml-1.5 text-(length:--text-micro) text-muted-foreground">{tabCounts.catalog}</span>
</TabsTrigger>
<TabsTrigger value="bundled" className="px-3">
<span>Bundled</span>
- <span className="ml-1.5 text-[11px] text-muted-foreground">{tabCounts.bundled}</span>
+ <span className="ml-1.5 text-(length:--text-micro) text-muted-foreground">{tabCounts.bundled}</span>
</TabsTrigger>
</TabsList>
</Tabs>
@@ -1450,12 +1451,12 @@ function NewSkillWizard({
<Textarea
value={draft.markdown}
onChange={(event) => patchDraft({ markdown: event.target.value })}
- className="h-[clamp(14rem,45vh,28rem)] resize-y font-mono text-xs"
+ className="h-(--sz-calc-34) resize-y font-mono text-xs"
/>
</div>
) : (
<div className="space-y-4 text-sm">
- <div className="grid grid-cols-[7rem_minmax(0,1fr)] gap-y-2">
+ <div className="grid grid-cols-(--gtc-26) gap-y-2">
<span className="text-muted-foreground">Name</span>
<span>{draft.name || "Untitled"}</span>
<span className="text-muted-foreground">Slug</span>
@@ -1588,7 +1589,7 @@ function CatalogList({
<div key={skill.id} className="border-b border-border">
<div
className={cn(
- "group grid grid-cols-[minmax(0,1fr)_2.25rem] items-center gap-x-1 px-3 py-1.5 hover:bg-accent/30",
+ "group grid grid-cols-(--gtc-3) items-center gap-x-1 px-3 py-1.5 hover:bg-accent/30",
isSelected && "text-foreground",
)}
>
@@ -1601,14 +1602,14 @@ function CatalogList({
<span className="flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground opacity-75 transition-opacity group-hover:opacity-100">
<Boxes className={cn("h-3.5 w-3.5", skill.kind === "optional" && "opacity-70")} aria-hidden="true" />
</span>
- <span className="min-w-0 overflow-hidden text-[13px] font-medium leading-5 [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:3]">
+ <span className="min-w-0 overflow-hidden text-(length:--text-compact) font-medium leading-5 [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:3]">
{skill.name}
</span>
</span>
</Link>
<button
type="button"
- className="flex h-9 w-9 shrink-0 items-center justify-center self-center rounded-sm text-muted-foreground opacity-80 transition-[background-color,color,opacity] hover:bg-accent hover:text-foreground group-hover:opacity-100"
+ className="flex h-9 w-9 shrink-0 items-center justify-center self-center rounded-sm text-muted-foreground opacity-80 transition-(--tp-background-color-color-opacity) hover:bg-accent hover:text-foreground group-hover:opacity-100"
onClick={() => onToggleSkill(skill.id)}
aria-label={expanded ? `Collapse ${skill.name}` : `Expand ${skill.name}`}
>
@@ -1618,8 +1619,8 @@ function CatalogList({
<div
aria-hidden={!expanded}
className={cn(
- "grid overflow-hidden transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]",
- expanded ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",
+ "grid overflow-hidden transition-(--tp-grid-template-rows-opacity) duration-200 ease-(--e-cubic-bezier-0_16-1-0_3-1)",
+ expanded ? "grid-rows-(--gtr-2) opacity-100" : "grid-rows-(--gtr-3) opacity-0",
)}
>
<div className="min-h-0 overflow-hidden">
@@ -1726,7 +1727,7 @@ function CatalogDetailPane({
);
} else if (hashOutOfSync) {
cta = (
- <Button onClick={onUpdate} disabled={loadingPrimaryAction} className="border-amber-500/40 bg-amber-500/20 text-amber-100 hover:bg-amber-500/30">
+ <Button onClick={onUpdate} disabled={loadingPrimaryAction} className="border-amber-500/40 bg-amber-500/20 text-amber-900 dark:text-amber-100 hover:bg-amber-500/30">
<ArrowUpCircle className="mr-1.5 h-3.5 w-3.5" />
Update from catalog
</Button>
@@ -1769,7 +1770,7 @@ function CatalogDetailPane({
{hashOutOfSync ? (
<Tooltip>
<TooltipTrigger asChild>
- <span className="inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[11px] text-amber-200">
+ <span className="inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-(length:--text-micro) text-amber-800 dark:text-amber-200">
<ArrowUpCircle className="h-3 w-3" aria-hidden="true" />
Update available
</span>
@@ -1778,27 +1779,27 @@ function CatalogDetailPane({
</Tooltip>
) : null}
{skill.requires.length > 0 ? (
- <span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[11px] text-muted-foreground">
+ <span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-(length:--text-micro) text-muted-foreground">
Requires: {skill.requires.join(", ")}
</span>
) : null}
{skill.recommendedForRoles.length > 0 ? (
- <span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[11px] text-muted-foreground">
+ <span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-(length:--text-micro) text-muted-foreground">
Roles: {skill.recommendedForRoles.join(" · ")}
</span>
) : null}
{skill.tags.length > 0 ? (
- <span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[11px] text-muted-foreground">
+ <span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-(length:--text-micro) text-muted-foreground">
Tags: {skill.tags.join(" · ")}
</span>
) : null}
</div>
<div className="mt-3 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
- <span className="uppercase tracking-[0.18em]">Key</span>
+ <span className="uppercase tracking-(--tracking-caps)">Key</span>
<span className="font-mono">{skill.key}</span>
- <span className="uppercase tracking-[0.18em]">·</span>
- <span className="uppercase tracking-[0.18em]">Hash</span>
+ <span className="uppercase tracking-(--tracking-caps)">·</span>
+ <span className="uppercase tracking-(--tracking-caps)">Hash</span>
<span className="font-mono">{skill.contentHash.slice(0, 24)}…</span>
<CopyText
text={skill.contentHash}
@@ -1816,7 +1817,7 @@ function CatalogDetailPane({
<div className="truncate font-mono text-sm">{selectedPath}</div>
</div>
- <div className="min-h-[400px] px-5 py-5">
+ <div className="min-h-(--sz-400px) px-5 py-5">
{fileQuery.isLoading ? (
<PageSkeleton variant="detail" />
) : fileQuery.error ? (
@@ -1900,14 +1901,14 @@ function InstallPreviewDialog({
<div className="space-y-4 text-sm">
<div className="rounded-md border border-border p-3">
- <div className="grid grid-cols-[7rem_minmax(0,1fr)] gap-y-2 text-xs">
+ <div className="grid grid-cols-(--gtc-26) gap-y-2 text-xs">
<div className="text-muted-foreground">Trust</div>
<div className="flex items-center gap-2">
<TrustChip level={skill.trustLevel} />
{skill.trustLevel === "markdown_only" ? (
<span className="text-muted-foreground">Safe</span>
) : skill.trustLevel === "scripts_executables" ? (
- <span className="text-amber-200">Review required</span>
+ <span className="text-amber-800 dark:text-amber-200">Review required</span>
) : (
<span className="text-muted-foreground">Non-script assets</span>
)}
@@ -1930,7 +1931,7 @@ function InstallPreviewDialog({
<div className="text-muted-foreground">Provenance</div>
<div className="min-w-0">
<div className="truncate">{packageName ?? "—"}{packageVersion ? ` v${packageVersion}` : ""}</div>
- <div className="truncate font-mono text-[11px] text-muted-foreground">{skill.contentHash}</div>
+ <div className="truncate font-mono text-(length:--text-micro) text-muted-foreground">{skill.contentHash}</div>
</div>
</div>
</div>
@@ -1941,17 +1942,17 @@ function InstallPreviewDialog({
</div>
<div className="max-h-48 overflow-y-auto">
{skill.files.map((file) => (
- <div key={file.path} className="grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-3 border-b border-border/50 px-3 py-1.5 text-xs last:border-b-0">
+ <div key={file.path} className="grid grid-cols-(--gtc-27) items-center gap-x-3 border-b border-border/50 px-3 py-1.5 text-xs last:border-b-0">
<span className="truncate font-mono text-muted-foreground">{file.path}</span>
- <span className="rounded border border-border bg-muted/40 px-1 py-0.5 text-[10px] uppercase text-muted-foreground">{file.kind}</span>
- <span className="text-[11px] text-muted-foreground">{formatBytes(file.sizeBytes)}</span>
+ <span className="rounded border border-border bg-muted/40 px-1 py-0.5 text-(length:--text-nano) uppercase text-muted-foreground">{file.kind}</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">{formatBytes(file.sizeBytes)}</span>
</div>
))}
</div>
</div>
{conflict ? (
- <div className="rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs text-amber-200">
+ <div className="rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs text-amber-800 dark:text-amber-200">
An existing skill with key <span className="font-mono">{conflict.key}</span> is installed (
{conflict.sourceLabel ?? conflict.sourceType}). Installing will {defaultAction === "update" ? "overwrite the catalog content" : "replace the existing skill"}.
</div>
@@ -2126,13 +2127,13 @@ function AttachAgentsPopover({
<span className="flex items-center gap-1.5">
<span className="truncate">{agent.name}</span>
{agent.paused ? (
- <span className="inline-flex shrink-0 items-center gap-1 rounded-full border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wide text-amber-500">
+ <span className="inline-flex shrink-0 items-center gap-1 rounded-full border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide text-amber-500">
<Pause className="h-2.5 w-2.5" aria-hidden="true" />
Paused
</span>
) : null}
</span>
- <span className="text-[10px] uppercase tracking-wide text-muted-foreground">
+ <span className="text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
{agent.adapterType}
{agent.required ? " · required" : ""}
{!agent.supportsSkills ? " · skills not supported" : ""}
@@ -2194,7 +2195,7 @@ function SkillTree({
<div key={node.path ?? node.name}>
<div
className={cn(
- "group grid w-full grid-cols-[minmax(0,1fr)_2.25rem] items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground",
+ "group grid w-full grid-cols-(--gtc-3) items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground",
SKILL_TREE_ROW_HEIGHT_CLASS,
)}
>
@@ -2211,7 +2212,7 @@ function SkillTree({
</button>
<button
type="button"
- className="flex h-9 w-9 items-center justify-center self-center rounded-sm text-muted-foreground opacity-70 transition-[background-color,color,opacity] hover:bg-accent hover:text-foreground group-hover:opacity-100"
+ className="flex h-9 w-9 items-center justify-center self-center rounded-sm text-muted-foreground opacity-70 transition-(--tp-background-color-color-opacity) hover:bg-accent hover:text-foreground group-hover:opacity-100"
onClick={() => node.path && onToggleDir(node.path)}
>
{expanded ? <ChevronDown className="h-3.5 w-3.5" /> : <ChevronRight className="h-3.5 w-3.5" />}
@@ -2322,7 +2323,7 @@ function SkillList({
<div key={skill.id} className="border-b border-border">
<div
className={cn(
- "group grid grid-cols-[minmax(0,1fr)_2.25rem] items-center gap-x-1 px-3 py-1.5 hover:bg-accent/30",
+ "group grid grid-cols-(--gtc-3) items-center gap-x-1 px-3 py-1.5 hover:bg-accent/30",
skill.id === selectedSkillId && "text-foreground",
)}
>
@@ -2341,14 +2342,14 @@ function SkillList({
</TooltipTrigger>
<TooltipContent side="top">{source.managedLabel}</TooltipContent>
</Tooltip>
- <span className="min-w-0 overflow-hidden text-[13px] font-medium leading-5 [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:3]">
+ <span className="min-w-0 overflow-hidden text-(length:--text-compact) font-medium leading-5 [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:3]">
{skill.name}
</span>
</span>
</Link>
<button
type="button"
- className="flex h-9 w-9 shrink-0 items-center justify-center self-center rounded-sm text-muted-foreground opacity-80 transition-[background-color,color,opacity] hover:bg-accent hover:text-foreground group-hover:opacity-100"
+ className="flex h-9 w-9 shrink-0 items-center justify-center self-center rounded-sm text-muted-foreground opacity-80 transition-(--tp-background-color-color-opacity) hover:bg-accent hover:text-foreground group-hover:opacity-100"
onClick={() => onToggleSkill(skill.id)}
aria-label={expanded ? `Collapse ${skill.name}` : `Expand ${skill.name}`}
>
@@ -2358,8 +2359,8 @@ function SkillList({
<div
aria-hidden={!expanded}
className={cn(
- "grid overflow-hidden transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]",
- expanded ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",
+ "grid overflow-hidden transition-(--tp-grid-template-rows-opacity) duration-200 ease-(--e-cubic-bezier-0_16-1-0_3-1)",
+ expanded ? "grid-rows-(--gtr-2) opacity-100" : "grid-rows-(--gtr-3) opacity-0",
)}
>
<div className="min-h-0 overflow-hidden">
@@ -2455,8 +2456,8 @@ function SkillVersionDiffDialog({
);
const lineClassesByKind: Record<DiffRow["kind"], string> = {
context: "bg-transparent",
- removed: "bg-red-500/10 text-red-100",
- added: "bg-green-500/10 text-green-100",
+ removed: "bg-red-500/10 text-red-900 dark:text-red-100",
+ added: "bg-green-500/10 text-green-900 dark:text-green-100",
};
const markerByKind: Record<DiffRow["kind"], string> = {
context: " ",
@@ -2472,7 +2473,7 @@ function SkillVersionDiffDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="flex max-h-[85vh] w-full !max-w-[90%] flex-col overflow-hidden">
+ <DialogContent className="flex max-h-(--sz-85vh) w-full !max-w-(--pct-90) flex-col overflow-hidden">
<div className="flex flex-wrap items-center justify-between gap-4">
<DialogHeader className="shrink-0">
<DialogTitle>Diff · skill files</DialogTitle>
@@ -2528,8 +2529,8 @@ function SkillVersionDiffDialog({
) : left?.id === right.id ? (
<div className="p-6 text-center text-sm text-muted-foreground">Both sides are the same version.</div>
) : (
- <div className="font-mono text-[12px] leading-6">
- <div className="grid grid-cols-[56px_56px_24px_minmax(0,1fr)] border-b border-border/60 bg-muted/30 px-3 py-2 text-[11px] uppercase tracking-wide text-muted-foreground">
+ <div className="font-mono text-xs leading-6">
+ <div className="grid grid-cols-(--gtc-1) border-b border-border/60 bg-muted/30 px-3 py-2 text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">
<span>Old</span>
<span>New</span>
<span />
@@ -2538,7 +2539,7 @@ function SkillVersionDiffDialog({
{diffRows.map((row, index) => (
<div
key={`${row.kind}-${index}-${row.oldLineNumber ?? "x"}-${row.newLineNumber ?? "x"}`}
- className={cn("grid grid-cols-[56px_56px_24px_minmax(0,1fr)] gap-0 border-b border-border/30 px-3", lineClassesByKind[row.kind])}
+ className={cn("grid grid-cols-(--gtc-1) gap-0 border-b border-border/30 px-3", lineClassesByKind[row.kind])}
>
<span className="select-none border-r border-border/30 pr-3 text-right text-muted-foreground">{row.oldLineNumber ?? ""}</span>
<span className="select-none border-r border-border/30 px-3 text-right text-muted-foreground">{row.newLineNumber ?? ""}</span>
@@ -2731,7 +2732,7 @@ export function SkillDetailPage({
function renderFilesBody() {
return (
- <div className="grid min-h-[560px] gap-0 lg:grid-cols-[13rem_minmax(0,1fr)]">
+ <div className="grid min-h-(--sz-560px) gap-0 lg:grid-cols-(--gtc-28)">
<aside className="border-b border-border pb-3 lg:border-b-0 lg:border-r lg:pb-0 lg:pr-3">
<div className="mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground">Files</div>
<SkillTree
@@ -2787,12 +2788,12 @@ export function SkillDetailPage({
<div className="text-sm text-muted-foreground">Select a file to inspect.</div>
) : editMode && file.editable ? (
file.markdown ? (
- <MarkdownEditor value={draft} onChange={setDraft} bordered={false} className="min-h-[520px]" />
+ <MarkdownEditor value={draft} onChange={setDraft} bordered={false} className="min-h-(--sz-520px)" />
) : (
<Textarea
value={draft}
onChange={(event) => setDraft(event.target.value)}
- className="min-h-[520px] rounded-none border-0 bg-transparent px-0 py-0 font-mono text-sm shadow-none focus-visible:ring-0"
+ className="min-h-(--sz-520px) rounded-none border-0 bg-transparent px-0 py-0 font-mono text-sm shadow-none focus-visible:ring-0"
/>
)
) : file.markdown && viewMode === "preview" ? (
@@ -2866,7 +2867,7 @@ export function SkillDetailPage({
<div className="py-6 text-sm text-muted-foreground">No saved versions yet.</div>
) : (
sortedVersions.map((version) => (
- <div key={version.id} className="grid gap-2 border-b border-border px-0 py-3 text-sm last:border-b-0 sm:grid-cols-[minmax(0,1fr)_auto]">
+ <div key={version.id} className="grid gap-2 border-b border-border px-0 py-3 text-sm last:border-b-0 sm:grid-cols-(--gtc-13)">
<div className="min-w-0">
<div className="font-medium">{versionLabel(version)}</div>
<div className="mt-1 text-xs text-muted-foreground">
@@ -2933,7 +2934,7 @@ export function SkillDetailPage({
<div className="flex items-center gap-1.5">
<span className="truncate font-medium">{agent.name}</span>
{meta?.paused ? (
- <span className="inline-flex shrink-0 items-center gap-1 rounded-full border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wide text-amber-500">
+ <span className="inline-flex shrink-0 items-center gap-1 rounded-full border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide text-amber-500">
<Pause className="h-2.5 w-2.5" aria-hidden="true" />
Paused
</span>
@@ -2965,7 +2966,7 @@ export function SkillDetailPage({
: renderOverviewBody();
return (
- <div className="min-h-[calc(100vh-12rem)]">
+ <div className="min-h-(--sz-calc-30)">
<div className="border-b border-border px-4 py-5">
<div className="flex flex-wrap items-start justify-between gap-4">
<div className="min-w-0">
@@ -3088,7 +3089,7 @@ export function SkillDetailPage({
</div>
</div>
- <div className="grid gap-6 px-4 py-4 xl:grid-cols-[minmax(0,1fr)_18rem]">
+ <div className="grid gap-6 px-4 py-4 xl:grid-cols-(--gtc-29)">
<main className="min-w-0">
<Tabs value={activeTab} onValueChange={(value) => onTabChange(value as SkillDetailTab)}>
{/* Underlined tab strip: the bottom padding keeps the active-tab
@@ -3173,7 +3174,7 @@ export function SkillDetailPage({
<span className="truncate">{githubRepoText}</span>
<ExternalLink className="h-3 w-3 shrink-0" aria-hidden="true" />
</a>
- <div className="mt-0.5 truncate font-mono text-[11px] text-muted-foreground" title={githubSource.commit}>
+ <div className="mt-0.5 truncate font-mono text-(length:--text-micro) text-muted-foreground" title={githubSource.commit}>
{githubSource.ref}
{githubSource.commit ? ` · ${githubSource.commit.slice(0, 7)}` : ""}
</div>
@@ -3478,13 +3479,13 @@ function SkillPane({
<div className="mt-4 space-y-3 border-t border-border pt-4 text-sm">
<div className="flex flex-wrap items-center gap-x-6 gap-y-2">
<div className="flex min-w-0 items-center gap-2">
- <span className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Source</span>
+ <span className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Source</span>
<span className="flex min-w-0 items-center gap-2">
<SourceIcon className="h-3.5 w-3.5 text-muted-foreground" />
{detail.sourcePath && displaySourcePath ? (
<>
<span
- className="block min-w-0 max-w-[min(34rem,55vw)] truncate font-mono text-xs text-muted-foreground"
+ className="block min-w-0 max-w-(--sz-calc-35) truncate font-mono text-xs text-muted-foreground"
title={detail.sourcePath}
>
{displaySourcePath}
@@ -3506,7 +3507,7 @@ function SkillPane({
</div>
{detail.sourceType === "github" && (
<div className="flex flex-wrap items-center gap-2">
- <span className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Pin</span>
+ <span className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Pin</span>
<span className="font-mono text-xs">{currentPin ?? "untracked"}</span>
{updateStatus?.trackingRef && (
<span className="text-xs text-muted-foreground">tracking {updateStatus.trackingRef}</span>
@@ -3539,22 +3540,22 @@ function SkillPane({
</div>
)}
<div className="flex items-center gap-2">
- <span className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Key</span>
+ <span className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Key</span>
<span className="font-mono text-xs">{detail.key}</span>
</div>
<div className="flex items-center gap-2">
- <span className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Mode</span>
+ <span className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Mode</span>
<span>{detail.editable ? "Editable" : "Read only"}</span>
</div>
</div>
<div className="flex flex-wrap items-center gap-2">
- <span className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Trust</span>
+ <span className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Trust</span>
<TrustChip level={detail.trustLevel} />
<CompatChip compatibility={detail.compatibility} />
{readonlyMetadataValue(detail.metadata, "userModifiedAt") ? (
<Tooltip>
<TooltipTrigger asChild>
- <span className="inline-flex items-center gap-1 rounded-full border border-violet-500/40 bg-violet-500/10 px-2 py-0.5 text-[11px] text-violet-200">
+ <span className="inline-flex items-center gap-1 rounded-full border border-violet-500/40 bg-violet-500/10 px-2 py-0.5 text-(length:--text-micro) text-violet-200">
<Pencil className="h-3 w-3" aria-hidden="true" />
Locally modified
</span>
@@ -3570,7 +3571,7 @@ function SkillPane({
</div>
<div className="flex flex-wrap items-start gap-x-3 gap-y-2">
<div className="flex items-center gap-2">
- <span className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">Used by</span>
+ <span className="text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-muted-foreground">Used by</span>
<AttachAgentsPopover
agents={attachAgents}
attachedAgentIds={usedBy.map((agent) => agent.id)}
@@ -3642,7 +3643,7 @@ function SkillPane({
</div>
</div>
- <div className="min-h-[560px] px-5 py-5">
+ <div className="min-h-(--sz-560px) px-5 py-5">
{fileLoading ? (
<PageSkeleton variant="detail" />
) : !file ? (
@@ -3653,13 +3654,13 @@ function SkillPane({
value={draft}
onChange={setDraft}
bordered={false}
- className="min-h-[520px]"
+ className="min-h-(--sz-520px)"
/>
) : (
<Textarea
value={draft}
onChange={(event) => setDraft(event.target.value)}
- className="min-h-[520px] rounded-none border-0 bg-transparent px-0 py-0 font-mono text-sm shadow-none focus-visible:ring-0"
+ className="min-h-(--sz-520px) rounded-none border-0 bg-transparent px-0 py-0 font-mono text-sm shadow-none focus-visible:ring-0"
/>
)
) : file.markdown && viewMode === "preview" ? (
@@ -4554,7 +4555,7 @@ export function CompanySkills() {
/>
<Dialog open={createDialogOpen} onOpenChange={setCreateDialogOpen}>
- <DialogContent className="flex max-h-[85vh] flex-col overflow-y-auto sm:max-w-3xl">
+ <DialogContent className="flex max-h-(--sz-85vh) flex-col overflow-y-auto sm:max-w-3xl">
<DialogHeader>
<DialogTitle>{createDraft.forkedFromSkillId ? "Fork skill" : "Create a new skill"}</DialogTitle>
<DialogDescription>
@@ -4702,7 +4703,7 @@ export function CompanySkills() {
) : selectedCatalogRef ? (
// Catalog / optional / bundled skills open as a regular full page in the
// new store — no modal, no legacy split view (PAP-10907).
- <div className="min-h-[calc(100vh-12rem)]">
+ <div className="min-h-(--sz-calc-30)">
<div className="border-b border-border px-4 py-3">
<Link
to={backToStoreHref}
@@ -4717,7 +4718,7 @@ export function CompanySkills() {
) : !selectedCatalogSkill ? (
<EmptyState icon={Boxes} message="Catalog skill not found." />
) : (
- <div className="grid gap-0 xl:grid-cols-[14rem_minmax(0,1fr)]">
+ <div className="grid gap-0 xl:grid-cols-(--gtc-30)">
<aside className="border-b border-border px-3 py-4 xl:border-b-0 xl:border-r">
<div className="mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground">Files</div>
<SkillTree
@@ -4756,7 +4757,7 @@ export function CompanySkills() {
)}
</div>
) : (
- <div className="min-h-[calc(100vh-12rem)]">
+ <div className="min-h-(--sz-calc-30)">
{skillsQuery.isLoading ? (
<PageSkeleton variant="detail" />
) : (
diff --git a/ui/src/pages/Costs.tsx b/ui/src/pages/Costs.tsx
index c78f8f54a6..b51a3f59ee 100644
--- a/ui/src/pages/Costs.tsx
+++ b/ui/src/pages/Costs.tsx
@@ -83,7 +83,7 @@ function MetricTile({
<div className="border border-border p-4">
<div className="flex items-center justify-between gap-3">
<div className="min-w-0">
- <div className="text-[11px] uppercase tracking-[0.16em] text-muted-foreground">{label}</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">{label}</div>
<div className="mt-2 text-2xl font-semibold tabular-nums">{value}</div>
<div className="mt-1 text-xs leading-5 text-muted-foreground">{subtitle}</div>
</div>
@@ -655,7 +655,7 @@ export function Costs() {
</div>
) : null}
- <div className="grid gap-4 xl:grid-cols-[1.3fr,1fr]">
+ <div className="grid gap-4 xl:grid-cols-(--gtc-31)">
<Card>
<CardHeader className="px-5 pt-5 pb-2">
<CardTitle className="text-base">Inference ledger</CardTitle>
@@ -676,7 +676,7 @@ export function Costs() {
</div>
</div>
<div className="border border-border px-4 py-3 text-right">
- <div className="text-[11px] uppercase tracking-[0.14em] text-muted-foreground">usage</div>
+ <div className="text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground">usage</div>
<div className="mt-1 text-lg font-medium tabular-nums">
{formatTokens(inferenceTokenTotal)}
</div>
@@ -687,12 +687,12 @@ export function Costs() {
<div className="h-2 overflow-hidden bg-muted">
<div
className={cn(
- "h-full transition-[width,background-color] duration-150",
+ "h-full transition-(--tp-width-background-color) duration-150",
spendData.summary.utilizationPercent > 90
- ? "bg-red-400"
+ ? "bg-(--status-task-blocked)"
: spendData.summary.utilizationPercent > 70
- ? "bg-yellow-400"
- : "bg-emerald-400",
+ ? "bg-(--status-task-todo)"
+ : "bg-(--status-task-done)",
)}
style={{ width: `${Math.min(100, spendData.summary.utilizationPercent)}%` }}
/>
@@ -714,7 +714,7 @@ export function Costs() {
/>
</div>
- <div className="grid gap-4 xl:grid-cols-[1.25fr,0.95fr]">
+ <div className="grid gap-4 xl:grid-cols-(--gtc-32)">
<Card>
<CardHeader className="px-5 pt-5 pb-2">
<CardTitle className="text-base">By agent</CardTitle>
@@ -839,7 +839,7 @@ export function Costs() {
<p className="text-sm text-destructive">{(budgetError as Error).message}</p>
) : (
<>
- <Card className="border-border/70 bg-[linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02))]">
+ <Card className="border-border/70 bg-(image:--gradient-extract-2)">
<CardHeader className="px-5 pt-5 pb-3">
<CardTitle className="text-base">Budget control plane</CardTitle>
<CardDescription>
@@ -1074,7 +1074,7 @@ export function Costs() {
eventCount={financeData?.summary.eventCount ?? 0}
/>
- <div className="grid gap-4 xl:grid-cols-[1.2fr,0.95fr]">
+ <div className="grid gap-4 xl:grid-cols-(--gtc-33)">
<div className="space-y-4">
<Card>
<CardHeader className="px-5 pt-5 pb-2">
diff --git a/ui/src/pages/Dashboard.tsx b/ui/src/pages/Dashboard.tsx
index 63d5b20e0c..68a0a9cca7 100644
--- a/ui/src/pages/Dashboard.tsx
+++ b/ui/src/pages/Dashboard.tsx
@@ -219,19 +219,19 @@ export function Dashboard() {
{data && (
<>
{data.budgets.activeIncidents > 0 ? (
- <div className="flex items-start justify-between gap-3 rounded-xl border border-red-500/20 bg-[linear-gradient(180deg,rgba(255,80,80,0.12),rgba(255,255,255,0.02))] px-4 py-3">
+ <div className="flex items-start justify-between gap-3 rounded-xl border border-red-500/20 bg-(image:--gradient-extract-1) px-4 py-3">
<div className="flex items-start gap-2.5">
- <PauseCircle className="mt-0.5 h-4 w-4 shrink-0 text-red-300" />
+ <PauseCircle className="mt-0.5 h-4 w-4 shrink-0 text-red-700 dark:text-red-300" />
<div>
- <p className="text-sm font-medium text-red-50">
+ <p className="text-sm font-medium text-red-950 dark:text-red-50">
{data.budgets.activeIncidents} active budget incident{data.budgets.activeIncidents === 1 ? "" : "s"}
</p>
- <p className="text-xs text-red-100/70">
+ <p className="text-xs text-red-900/70 dark:text-red-100/70">
{data.budgets.pausedAgents} agents paused · {data.budgets.pausedProjects} projects paused · {data.budgets.pendingApprovals} pending budget approvals
</p>
</div>
</div>
- <Link to="/costs" className="text-sm underline underline-offset-2 text-red-100">
+ <Link to="/costs" className="text-sm underline underline-offset-2 text-red-900 dark:text-red-100">
Open budgets
</Link>
</div>
diff --git a/ui/src/pages/DashboardLive.tsx b/ui/src/pages/DashboardLive.tsx
index c899c4bb78..8c50ae09d4 100644
--- a/ui/src/pages/DashboardLive.tsx
+++ b/ui/src/pages/DashboardLive.tsx
@@ -54,7 +54,7 @@ export function DashboardLive() {
fetchLimit={DASHBOARD_LIVE_RUN_LIMIT}
cardLimit={DASHBOARD_LIVE_RUN_LIMIT}
gridClassName="gap-3 md:grid-cols-2 2xl:grid-cols-3"
- cardClassName="h-[420px]"
+ cardClassName="h-(--sz-420px)"
emptyMessage="No active or recent agent runs."
queryScope="dashboard-live"
showMoreLink={false}
diff --git a/ui/src/pages/DesignGuide.tsx b/ui/src/pages/DesignGuide.tsx
index 6b5c449c80..f89702ff6b 100644
--- a/ui/src/pages/DesignGuide.tsx
+++ b/ui/src/pages/DesignGuide.tsx
@@ -322,7 +322,7 @@ function EnvironmentVariablesEditorShowcase() {
STRIPE_API_KEY: { type: "plain", value: "sk-live-51H8xL0aBcDeFgHiJkLmNoPq" },
});
return (
- <div className="max-w-[640px] rounded-md border border-border p-4">
+ <div className="max-w-(--sz-640px) rounded-md border border-border p-4">
<EnvironmentVariablesEditor
value={env}
secrets={DESIGN_GUIDE_SECRETS}
@@ -406,7 +406,7 @@ export function DesignGuide() {
"command", "dialog", "dropdown-menu", "input", "label", "popover", "scroll-area",
"select", "separator", "sheet", "skeleton", "tabs", "textarea", "tooltip",
].map((name) => (
- <Badge key={name} variant="outline" className="font-mono text-[10px]">
+ <Badge key={name} variant="outline" className="font-mono text-(length:--text-nano)">
{name}
</Badge>
))}
@@ -419,7 +419,7 @@ export function DesignGuide() {
"FilterBar", "InlineEditor", "PageSkeleton", "Identity", "CommentThread", "MarkdownEditor",
"PropertiesPanel", "Sidebar", "CommandPalette", "EnvironmentVariablesEditor",
].map((name) => (
- <Badge key={name} variant="ghost" className="font-mono text-[10px]">
+ <Badge key={name} variant="ghost" className="font-mono text-(length:--text-nano)">
{name}
</Badge>
))}
@@ -663,7 +663,7 @@ export function DesignGuide() {
["on_demand", "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300"],
["automation", "bg-muted text-muted-foreground"],
].map(([label, cls]) => (
- <span key={label} className={`rounded-full px-1.5 py-0.5 text-[10px] font-medium ${cls}`}>
+ <span key={label} className={`rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium ${cls}`}>
{label}
</span>
))}
@@ -742,7 +742,7 @@ export function DesignGuide() {
{Array.from({ length: AGENT_GRADIENT_COUNT }, (_, i) => (
<div key={i} className="flex flex-col items-center gap-1.5">
<AgentCapsule state="online" size="sm" gradient={i + 1} />
- <span className="text-[10px] font-mono text-muted-foreground">{i + 1}</span>
+ <span className="text-(length:--text-nano) font-mono text-muted-foreground">{i + 1}</span>
</div>
))}
</div>
@@ -1379,7 +1379,7 @@ export function DesignGuide() {
</div>
<div className="w-full h-2 bg-muted rounded-full overflow-hidden">
<div
- className={`h-full rounded-full transition-[width,background-color] duration-150 ${color}`}
+ className={`h-full rounded-full transition-(--tp-width-background-color) duration-150 ${color}`}
style={{ width: `${pct}%` }}
/>
</div>
@@ -1402,10 +1402,10 @@ export function DesignGuide() {
<div className="text-foreground">[12:00:17] INFO Reconnected successfully</div>
<div className="flex items-center gap-1.5">
<span className="relative flex h-1.5 w-1.5">
- <span className="absolute inline-flex h-full w-full rounded-full bg-cyan-400 animate-pulse" />
- <span className="inline-flex h-full w-full rounded-full bg-cyan-400" />
+ <span className="absolute inline-flex h-full w-full rounded-full bg-blue-400 animate-pulse" />
+ <span className="inline-flex h-full w-full rounded-full bg-blue-500" />
</span>
- <span className="text-cyan-400">Live</span>
+ <span className="text-blue-600 dark:text-blue-400">Live</span>
</div>
</div>
</Section>
@@ -1621,16 +1621,16 @@ export function DesignGuide() {
</p>
<SubSection title="TeamRow (browse list)">
- <div className="w-[28rem] rounded-md border border-border">
- <div className="px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="w-(--sz-28rem) rounded-md border border-border">
+ <div className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Bundled · 1
</div>
<TeamRow team={sampleTeam} selected onSelect={() => {}} />
- <div className="px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Optional · 2
</div>
<TeamRow team={optionalTeam} selected={false} onSelect={() => {}} />
- <div className="px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Installed · 2
</div>
<TeamRow team={sampleTeam} selected={false} onSelect={() => {}} installed={outOfDateInstalledState} />
@@ -1725,7 +1725,7 @@ export function DesignGuide() {
return (
<div key={name as string} className="flex flex-col items-center gap-1.5 p-2">
<LucideIcon className="h-4 w-4 text-muted-foreground" />
- <span className="text-[10px] text-muted-foreground font-mono">{name as string}</span>
+ <span className="text-(length:--text-nano) text-muted-foreground font-mono">{name as string}</span>
</div>
);
})}
diff --git a/ui/src/pages/ExecutionWorkspaceDetail.tsx b/ui/src/pages/ExecutionWorkspaceDetail.tsx
index 75141c3094..3e6445f7ef 100644
--- a/ui/src/pages/ExecutionWorkspaceDetail.tsx
+++ b/ui/src/pages/ExecutionWorkspaceDetail.tsx
@@ -421,7 +421,7 @@ function WorkspaceRoutineRow({
<span>Last run {formatOptionalDateTime(routine.lastRun?.triggeredAt ?? routine.lastTriggeredAt)}</span>
<span className="flex flex-wrap gap-1">
{variableNames.map((name) => (
- <span key={name} className="rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground">
+ <span key={name} className="rounded-sm bg-muted px-1.5 py-0.5 font-mono text-(length:--text-micro) text-muted-foreground">
{name}
</span>
))}
@@ -807,7 +807,7 @@ export function ExecutionWorkspaceDetail() {
<div className="space-y-4 overflow-hidden sm:space-y-6">
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div className="min-w-0 space-y-2">
- <div className="text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground">
+ <div className="text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Execution workspace
</div>
<h1 className="truncate text-xl font-semibold sm:text-2xl">{workspace.name}</h1>
diff --git a/ui/src/pages/Inbox.tsx b/ui/src/pages/Inbox.tsx
index 753232a61e..a66362e804 100644
--- a/ui/src/pages/Inbox.tsx
+++ b/ui/src/pages/Inbox.tsx
@@ -351,7 +351,7 @@ export function FailedRunInboxRow({
<span className="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground">
<StatusBadge status={run.status} />
{linkedAgentName && issue ? <span>{linkedAgentName}</span> : null}
- <span className="truncate max-w-[300px]">{displayError}</span>
+ <span className="truncate max-w-(--sz-300px)">{displayError}</span>
<span>{timeAgo(run.createdAt)}</span>
</span>
</span>
@@ -2052,7 +2052,7 @@ export function Inbox() {
e.currentTarget.blur();
}
}}
- className="h-8 w-[220px] pl-8 text-xs"
+ className="h-8 w-(--sz-220px) pl-8 text-xs"
data-page-search-target="true"
/>
</div>
@@ -2265,7 +2265,7 @@ export function Inbox() {
value={allCategoryFilter}
onValueChange={(value) => updateAllCategoryFilter(value as InboxCategoryFilter)}
>
- <SelectTrigger className="h-8 w-[170px] text-xs">
+ <SelectTrigger className="h-8 w-(--sz-170px) text-xs">
<SelectValue placeholder="Category" />
</SelectTrigger>
<SelectContent>
@@ -2283,7 +2283,7 @@ export function Inbox() {
value={allApprovalFilter}
onValueChange={(value) => updateAllApprovalFilter(value as InboxApprovalFilter)}
>
- <SelectTrigger className="h-8 w-[170px] text-xs">
+ <SelectTrigger className="h-8 w-(--sz-170px) text-xs">
<SelectValue placeholder="Approval status" />
</SelectTrigger>
<SelectContent>
@@ -2401,7 +2401,7 @@ export function Inbox() {
selected={selected}
className={
isArchiving
- ? "pointer-events-none -translate-x-4 scale-[0.98] opacity-0 transition-all duration-200 ease-out"
+ ? "pointer-events-none -translate-x-4 scale-(--s-0_98) opacity-0 transition-all duration-200 ease-out"
: "transition-all duration-200 ease-out"
}
desktopMetaLeading={
@@ -2510,7 +2510,7 @@ export function Inbox() {
className="flex items-center gap-3 border-y border-border/70 bg-muted/30 px-4 py-2"
>
<div className="h-px flex-1 bg-border/80" />
- <span className="shrink-0 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <span className="shrink-0 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
{group.searchSection === "archived" ? "Archived" : "Other results"}
</span>
<div className="h-px flex-1 bg-border/80" />
@@ -2588,7 +2588,7 @@ export function Inbox() {
elements.push(
<div key={`today-divider-${group.key}-${index}`} className="my-2 flex items-center gap-3 px-4">
<div className="flex-1 border-t border-zinc-600" />
- <span className="shrink-0 text-[11px] font-medium uppercase tracking-wider text-zinc-500">
+ <span className="shrink-0 text-(length:--text-micro) font-medium uppercase tracking-wider text-zinc-500">
Earlier
</span>
</div>,
@@ -2614,7 +2614,7 @@ export function Inbox() {
archiveDisabled={isArchiving}
className={
isArchiving
- ? "pointer-events-none -translate-x-4 scale-[0.98] opacity-0 transition-all duration-200 ease-out"
+ ? "pointer-events-none -translate-x-4 scale-(--s-0_98) opacity-0 transition-all duration-200 ease-out"
: "transition-all duration-200 ease-out"
}
/>
@@ -2652,7 +2652,7 @@ export function Inbox() {
archiveDisabled={isArchiving}
className={
isArchiving
- ? "pointer-events-none -translate-x-4 scale-[0.98] opacity-0 transition-all duration-200 ease-out"
+ ? "pointer-events-none -translate-x-4 scale-(--s-0_98) opacity-0 transition-all duration-200 ease-out"
: "transition-all duration-200 ease-out"
}
/>
@@ -2687,7 +2687,7 @@ export function Inbox() {
archiveDisabled={isArchiving}
className={
isArchiving
- ? "pointer-events-none -translate-x-4 scale-[0.98] opacity-0 transition-all duration-200 ease-out"
+ ? "pointer-events-none -translate-x-4 scale-(--s-0_98) opacity-0 transition-all duration-200 ease-out"
: "transition-all duration-200 ease-out"
}
/>
diff --git a/ui/src/pages/InstanceAccess.tsx b/ui/src/pages/InstanceAccess.tsx
index a568c366a0..814d359b5d 100644
--- a/ui/src/pages/InstanceAccess.tsx
+++ b/ui/src/pages/InstanceAccess.tsx
@@ -110,7 +110,7 @@ export function InstanceAccess() {
</p>
</div>
- <div className="grid gap-6 lg:grid-cols-[320px_minmax(0,1fr)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-34)">
<section className="space-y-4 rounded-xl border border-border bg-card p-4">
<label className="block space-y-2 text-sm">
<span className="font-medium">Search users</span>
diff --git a/ui/src/pages/InstanceExperimentalSettings.tsx b/ui/src/pages/InstanceExperimentalSettings.tsx
index 54e5938582..79344559e5 100644
--- a/ui/src/pages/InstanceExperimentalSettings.tsx
+++ b/ui/src/pages/InstanceExperimentalSettings.tsx
@@ -62,7 +62,7 @@ function RecoveryPreviewDialog({
</DialogDescription>
</DialogHeader>
- <div className="max-h-[min(28rem,65vh)] space-y-3 overflow-y-auto pr-1">
+ <div className="max-h-(--sz-calc-36) space-y-3 overflow-y-auto pr-1">
{preview && preview.items.length === 0 ? (
<div className="rounded-md border border-border bg-muted/30 px-3 py-4 text-sm text-muted-foreground">
No recovery tasks would be created right now. Auto-recovery can still run for future liveness incidents in
@@ -541,7 +541,7 @@ export function InstanceExperimentalSettings() {
/>
</div>
- <div className="grid gap-3 sm:grid-cols-[minmax(10rem,14rem)_1fr] sm:items-end">
+ <div className="grid gap-3 sm:grid-cols-(--gtc-35) sm:items-end">
<label className="space-y-1.5">
<span className="flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
<Clock className="h-3.5 w-3.5" />
diff --git a/ui/src/pages/InstanceSettings.tsx b/ui/src/pages/InstanceSettings.tsx
index 5ca4e0badb..c0ce3823a3 100644
--- a/ui/src/pages/InstanceSettings.tsx
+++ b/ui/src/pages/InstanceSettings.tsx
@@ -228,7 +228,7 @@ export function InstanceSettings() {
>
<Badge
variant={agent.schedulerActive ? "default" : "outline"}
- className="shrink-0 text-[10px] px-1.5 py-0"
+ className="shrink-0 text-(length:--text-nano) px-1.5 py-0"
>
{agent.schedulerActive ? "On" : "Off"}
</Badge>
diff --git a/ui/src/pages/InviteLanding.tsx b/ui/src/pages/InviteLanding.tsx
index 8c8eca5b31..2c06666f0a 100644
--- a/ui/src/pages/InviteLanding.tsx
+++ b/ui/src/pages/InviteLanding.tsx
@@ -537,7 +537,7 @@ export function InviteLandingPage() {
return (
<div className="min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100">
<div className="mx-auto max-w-5xl">
- <div className="grid gap-6 lg:grid-cols-[minmax(0,1.15fr)_minmax(360px,0.85fr)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-36)">
<section className={`${panelClassName} space-y-6`}>
<div className="flex items-start gap-4">
<InviteCompanyLogo
@@ -547,7 +547,7 @@ export function InviteLandingPage() {
className="h-16 w-16 rounded-none border border-zinc-800"
/>
<div className="min-w-0">
- <p className="text-xs uppercase tracking-[0.24em] text-zinc-500">
+ <p className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">
You&apos;ve been invited to join Paperclip
</p>
<h1 className="mt-2 text-2xl font-semibold">
@@ -565,28 +565,28 @@ export function InviteLandingPage() {
<div className="grid gap-3 sm:grid-cols-2">
<div className="border border-zinc-800 p-3">
- <div className="text-xs uppercase tracking-[0.2em] text-zinc-500">Company</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">Company</div>
<div className="mt-1 text-sm text-zinc-100">{companyDisplayName}</div>
</div>
<div className="border border-zinc-800 p-3">
- <div className="text-xs uppercase tracking-[0.2em] text-zinc-500">Invited by</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">Invited by</div>
<div className="mt-1 text-sm text-zinc-100">{invitedByUserName ?? "Paperclip board"}</div>
</div>
<div className="border border-zinc-800 p-3">
- <div className="text-xs uppercase tracking-[0.2em] text-zinc-500">Requested access</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">Requested access</div>
<div className="mt-1 text-sm text-zinc-100">
{showsAgentForm ? "Agent join request" : requestedHumanRole ?? "Company access"}
</div>
</div>
<div className="border border-zinc-800 p-3">
- <div className="text-xs uppercase tracking-[0.2em] text-zinc-500">Invite expires</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">Invite expires</div>
<div className="mt-1 text-sm text-zinc-100">{formatDate(invite.expiresAt)}</div>
</div>
</div>
{inviteMessage ? (
<div className="border border-amber-500/40 bg-amber-500/10 p-4">
- <div className="text-xs uppercase tracking-[0.2em] text-amber-200/80">Message from inviter</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-amber-200/80">Message from inviter</div>
<p className="mt-2 text-sm leading-6 text-amber-50">{inviteMessage}</p>
</div>
) : null}
diff --git a/ui/src/pages/InviteUxLab.tsx b/ui/src/pages/InviteUxLab.tsx
index 38bcd24c2f..3f6e9f1470 100644
--- a/ui/src/pages/InviteUxLab.tsx
+++ b/ui/src/pages/InviteUxLab.tsx
@@ -1,3 +1,7 @@
+// token-extraction: allowlisted — intentional one-off decoration (DECISION-SHEET.md B1
+// user ruling). The bg-[...gradient...] / shadow-[...] literals in this demo/UX-lab page
+// are deliberate one-off decoration, reverted from --gradient-extract-*/--shadow-extract-*
+// tokens; the file is on the check-token-gates allowlist in ui/src/index.css.
import type { ReactNode } from "react";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
@@ -109,13 +113,13 @@ function LabSection({
return (
<section
className={cn(
- "rounded-[28px] border border-border/70 bg-background/80 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.08)] sm:p-5",
+ "rounded-(--rad-28) border border-border/70 bg-background/80 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.08)] sm:p-5",
accentClassName,
)}
>
<div className="mb-4 flex flex-wrap items-start justify-between gap-3">
<div className="min-w-0">
- <div className="text-[11px] font-semibold uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{eyebrow}
</div>
<h2 className="mt-1 text-xl font-semibold tracking-tight">{title}</h2>
@@ -146,7 +150,7 @@ function StatusCard({
}[tone];
return (
- <Card className={cn("rounded-[24px] shadow-none", toneClassName)}>
+ <Card className={cn("rounded-(--rad-24) shadow-none", toneClassName)}>
<CardHeader className="space-y-3">
<div className="flex h-10 w-10 items-center justify-center rounded-full border border-current/10 bg-background/70 text-muted-foreground">
{icon}
@@ -168,8 +172,8 @@ function InviteLandingShell({
right: ReactNode;
}) {
return (
- <div className="overflow-hidden rounded-[28px] border border-zinc-800 bg-zinc-950 shadow-[0_30px_80px_rgba(2,6,23,0.55)]">
- <div className="grid gap-px bg-zinc-800 lg:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]">
+ <div className="overflow-hidden rounded-(--rad-28) border border-zinc-800 bg-zinc-950 shadow-[0_30px_80px_rgba(2,6,23,0.55)]">
+ <div className="grid gap-px bg-zinc-800 lg:grid-cols-(--gtc-37)">
<section className={cn(panelClassName, "space-y-6 bg-zinc-950")}>{left}</section>
<section className={cn(panelClassName, "h-full bg-zinc-950")}>{right}</section>
</div>
@@ -192,6 +196,7 @@ function InviteSummaryPanel({
}) {
return (
<>
+ {/* token-extraction: allowlisted — brandColor feeds CompanyPatternIcon's hexToHue() color math via a canvas fill; demo/showcase-only prop, not a rendered CSS value. */}
<div className="flex items-start gap-4">
<CompanyPatternIcon
companyName="Acme Robotics"
@@ -200,7 +205,7 @@ function InviteSummaryPanel({
className="h-16 w-16 rounded-none border border-zinc-800"
/>
<div className="min-w-0">
- <p className="text-xs uppercase tracking-[0.24em] text-zinc-500">You&apos;ve been invited to join Paperclip</p>
+ <p className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">You&apos;ve been invited to join Paperclip</p>
<h3 className="mt-2 text-2xl font-semibold text-zinc-100">{title}</h3>
<p className="mt-2 max-w-2xl text-sm leading-6 text-zinc-300">{description}</p>
</div>
@@ -215,7 +220,7 @@ function InviteSummaryPanel({
{inviteMessage ? (
<div className="border border-amber-500/40 bg-amber-500/10 p-4">
- <div className="text-xs uppercase tracking-[0.2em] text-amber-200/80">Message from inviter</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-amber-200/80">Message from inviter</div>
<p className="mt-2 text-sm leading-6 text-amber-50">{inviteMessage}</p>
</div>
) : null}
@@ -232,7 +237,7 @@ function InviteSummaryPanel({
function MetaCard({ label, value }: { label: string; value: string }) {
return (
<div className="border border-zinc-800 p-3">
- <div className="text-xs uppercase tracking-[0.2em] text-zinc-500">{label}</div>
+ <div className="text-xs uppercase tracking-(--tracking-caps) text-zinc-500">{label}</div>
<div className="mt-1 text-sm text-zinc-100">{value}</div>
</div>
);
@@ -451,9 +456,9 @@ function InviteResultPreview({
function AuthScreenPreview({ mode, error }: { mode: "sign_in" | "sign_up"; error?: string }) {
return (
- <div className="overflow-hidden rounded-[28px] border border-border/70 bg-background shadow-[0_24px_60px_rgba(15,23,42,0.08)]">
+ <div className="overflow-hidden rounded-(--rad-28) border border-border/70 bg-background shadow-[0_24px_60px_rgba(15,23,42,0.08)]">
<div className="grid gap-px bg-border/60 md:grid-cols-2">
- <div className="flex min-h-[420px] flex-col justify-center bg-background px-8 py-10">
+ <div className="flex min-h-(--sz-420px) flex-col justify-center bg-background px-8 py-10">
<div className="mx-auto w-full max-w-md">
<div className="mb-8 flex items-center gap-2">
<FlaskConical className="h-4 w-4 text-muted-foreground" />
@@ -507,9 +512,9 @@ function AuthScreenPreview({ mode, error }: { mode: "sign_in" | "sign_up"; error
</div>
</div>
</div>
- <div className="hidden min-h-[420px] items-center justify-center bg-[radial-gradient(circle_at_top,rgba(8,145,178,0.18),transparent_48%),linear-gradient(180deg,rgba(15,23,42,0.96),rgba(2,6,23,1))] px-8 py-10 md:flex">
+ <div className="hidden min-h-(--sz-420px) items-center justify-center bg-[radial-gradient(circle_at_top,rgba(8,145,178,0.18),transparent_48%),linear-gradient(180deg,rgba(15,23,42,0.96),rgba(2,6,23,1))] px-8 py-10 md:flex">
<div className="max-w-sm space-y-4 text-zinc-200">
- <div className="inline-flex items-center gap-2 rounded-full border border-cyan-400/30 bg-cyan-500/[0.08] px-3 py-1 text-[10px] uppercase tracking-[0.22em] text-cyan-200">
+ <div className="inline-flex items-center gap-2 rounded-full border border-cyan-400/30 bg-cyan-500/[0.08] px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps) text-cyan-200">
Auth preview
</div>
<div className="text-2xl font-semibold">Side-by-side signup styling review</div>
@@ -525,8 +530,8 @@ function AuthScreenPreview({ mode, error }: { mode: "sign_in" | "sign_up"; error
function CompanyInvitesPreview() {
return (
- <div className="grid gap-5 xl:grid-cols-[minmax(0,0.92fr)_minmax(0,1.08fr)]">
- <Card className="rounded-[28px] shadow-none">
+ <div className="grid gap-5 xl:grid-cols-(--gtc-38)">
+ <Card className="rounded-(--rad-28) shadow-none">
<CardHeader className="space-y-3">
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<MailPlus className="h-4 w-4" />
@@ -609,7 +614,7 @@ function CompanyInvitesPreview() {
</CardContent>
</Card>
- <Card className="rounded-[28px] shadow-none">
+ <Card className="rounded-(--rad-28) shadow-none">
<CardHeader className="space-y-3">
<div className="flex items-center justify-between gap-3">
<div>
@@ -697,10 +702,10 @@ function CompanyInvitesPreview() {
export function InviteUxLab() {
return (
<div className="space-y-6">
- <div className="overflow-hidden rounded-[32px] border border-border/70 bg-[linear-gradient(135deg,rgba(8,145,178,0.10),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent_44%),var(--background)] shadow-[0_30px_80px_rgba(15,23,42,0.10)]">
- <div className="grid gap-6 lg:grid-cols-[minmax(0,1.2fr)_320px]">
+ <div className="overflow-hidden rounded-(--rad-32) border border-border/70 bg-[linear-gradient(135deg,rgba(8,145,178,0.10),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent_44%),var(--background)] shadow-[0_30px_80px_rgba(15,23,42,0.10)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-39)">
<div className="p-6 sm:p-7">
- <div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] text-cyan-700 dark:text-cyan-300">
+ <div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-cyan-700 dark:text-cyan-300">
<FlaskConical className="h-3.5 w-3.5" />
Invite UX Lab
</div>
@@ -710,20 +715,20 @@ export function InviteUxLab() {
</p>
<div className="mt-5 flex flex-wrap items-center gap-2">
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
/tests/ux/invites
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
signup + invite states
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
fixture-backed preview
</Badge>
</div>
</div>
<aside className="border-t border-border/60 bg-background/70 p-6 lg:border-l lg:border-t-0">
- <div className="mb-4 text-[11px] font-semibold uppercase tracking-[0.2em] text-muted-foreground">
+ <div className="mb-4 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Covered states
</div>
<div className="space-y-3">
diff --git a/ui/src/pages/IssueChatLongThreadPerf.tsx b/ui/src/pages/IssueChatLongThreadPerf.tsx
index 1ede09f2ce..e8cecbd984 100644
--- a/ui/src/pages/IssueChatLongThreadPerf.tsx
+++ b/ui/src/pages/IssueChatLongThreadPerf.tsx
@@ -41,7 +41,7 @@ function formatMs(value: number | null) {
function MetricTile({ label, value, testId }: { label: string; value: string; testId: string }) {
return (
<div className="rounded-md border border-border bg-background px-3 py-2">
- <div className="text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
{label}
</div>
<div data-testid={testId} className="mt-1 font-mono text-sm text-foreground">
@@ -109,7 +109,7 @@ export function IssueChatLongThreadPerf() {
<div className="flex flex-col gap-3 border-b border-border pb-5 lg:flex-row lg:items-end lg:justify-between">
<div className="min-w-0">
<div className="flex flex-wrap items-center gap-2">
- <Badge variant="outline" className="font-mono text-[11px]">
+ <Badge variant="outline" className="font-mono text-(length:--text-micro)">
{fixture.issue.identifier}
</Badge>
<Badge variant="secondary">{fixture.issue.status.replace(/_/g, " ")}</Badge>
@@ -122,13 +122,13 @@ export function IssueChatLongThreadPerf() {
sub-issues, and sidebar context.
</p>
</div>
- <div className="grid min-w-[280px] grid-cols-2 gap-2">
+ <div className="grid min-w-(--sz-280px) grid-cols-2 gap-2">
<MetricTile label="Fixture rows" value={String(rowTarget)} testId="perf-fixture-row-target" />
<MetricTile label="Markdown rows" value={String(LONG_THREAD_MARKDOWN_COMMENT_COUNT)} testId="perf-fixture-markdown-rows" />
</div>
</div>
- <div className="grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px]">
+ <div className="grid gap-4 xl:grid-cols-(--gtc-40)">
<main className="min-w-0 space-y-4">
<Card className="border-border/70">
<CardHeader className="pb-2">
diff --git a/ui/src/pages/IssueChatUxLab.tsx b/ui/src/pages/IssueChatUxLab.tsx
index 1027ff4c35..97109f9e1c 100644
--- a/ui/src/pages/IssueChatUxLab.tsx
+++ b/ui/src/pages/IssueChatUxLab.tsx
@@ -1,3 +1,7 @@
+// token-extraction: allowlisted — intentional one-off decoration (DECISION-SHEET.md B1
+// user ruling). The bg-[...gradient...] / shadow-[...] literals in this demo/UX-lab page
+// are deliberate one-off decoration, reverted from --gradient-extract-*/--shadow-extract-*
+// tokens; the file is on the check-token-gates allowlist in ui/src/index.css.
import { useEffect, useRef, useState, type ReactNode } from "react";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
@@ -49,13 +53,13 @@ function LabSection({
<section
id={id}
className={cn(
- "rounded-[28px] border border-border/70 bg-background/80 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.08)] sm:p-5",
+ "rounded-(--rad-28) border border-border/70 bg-background/80 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.08)] sm:p-5",
accentClassName,
)}
>
<div className="mb-4 flex flex-wrap items-start justify-between gap-3">
<div className="min-w-0">
- <div className="text-[11px] font-semibold uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{eyebrow}
</div>
<h2 className="mt-1 text-xl font-semibold tracking-tight">{title}</h2>
@@ -111,7 +115,7 @@ function RotatingReasoningDemo({ intervalMs = 2200 }: { intervalMs?: number }) {
{ticker.exiting !== null && (
<span
key={`out-${ticker.key}`}
- className="cot-line-exit absolute inset-x-0 truncate text-[13px] italic leading-5 text-muted-foreground/70"
+ className="cot-line-exit absolute inset-x-0 truncate text-(length:--text-compact) italic leading-5 text-muted-foreground/70"
onAnimationEnd={() => setTicker((t) => ({ ...t, exiting: null }))}
>
{ticker.exiting}
@@ -120,7 +124,7 @@ function RotatingReasoningDemo({ intervalMs = 2200 }: { intervalMs?: number }) {
<span
key={`in-${ticker.key}`}
className={cn(
- "absolute inset-x-0 truncate text-[13px] italic leading-5 text-muted-foreground/70",
+ "absolute inset-x-0 truncate text-(length:--text-compact) italic leading-5 text-muted-foreground/70",
ticker.key > 0 && "cot-line-enter",
)}
>
@@ -136,10 +140,10 @@ export function IssueChatUxLab() {
return (
<div className="space-y-6">
- <div className="overflow-hidden rounded-[32px] border border-border/70 bg-[linear-gradient(135deg,rgba(8,145,178,0.10),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent_44%),var(--background)] shadow-[0_30px_80px_rgba(15,23,42,0.10)]">
- <div className="grid gap-6 lg:grid-cols-[minmax(0,1.2fr)_320px]">
+ <div className="overflow-hidden rounded-(--rad-32) border border-border/70 bg-[linear-gradient(135deg,rgba(8,145,178,0.10),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.10),transparent_44%),var(--background)] shadow-[0_30px_80px_rgba(15,23,42,0.10)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-39)">
<div className="p-6 sm:p-7">
- <div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] text-cyan-700 dark:text-cyan-300">
+ <div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-cyan-700 dark:text-cyan-300">
<FlaskConical className="h-3.5 w-3.5" />
Chat UX Lab
</div>
@@ -151,13 +155,13 @@ export function IssueChatUxLab() {
</p>
<div className="mt-5 flex flex-wrap items-center gap-2">
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
/tests/ux/chat
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
assistant-ui thread
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
fixture-backed live run
</Badge>
</div>
@@ -177,7 +181,7 @@ export function IssueChatUxLab() {
</div>
<aside className="border-t border-border/60 bg-background/70 p-6 lg:border-l lg:border-t-0">
- <div className="mb-4 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.2em] text-muted-foreground">
+ <div className="mb-4 flex items-center gap-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
<WandSparkles className="h-4 w-4 text-cyan-700 dark:text-cyan-300" />
Covered states
</div>
@@ -204,13 +208,13 @@ export function IssueChatUxLab() {
>
<div className="space-y-4">
<div className="rounded-xl border border-border/60 bg-accent/10 p-4">
- <div className="mb-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-2 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Default interval (2.2s)
</div>
<RotatingReasoningDemo />
</div>
<div className="rounded-xl border border-border/60 bg-accent/10 p-4">
- <div className="mb-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-2 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Fast interval (1s) — stress test
</div>
<RotatingReasoningDemo intervalMs={1000} />
@@ -227,7 +231,7 @@ export function IssueChatUxLab() {
>
<div className="grid gap-4 sm:grid-cols-2">
<div className="rounded-xl border border-border/60 bg-accent/10 p-4">
- <div className="mb-3 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-3 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Active run — shimmer
</div>
<div className="flex items-center gap-2.5 rounded-lg px-1 py-2">
@@ -239,7 +243,7 @@ export function IssueChatUxLab() {
</div>
</div>
<div className="rounded-xl border border-border/60 bg-accent/10 p-4">
- <div className="mb-3 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="mb-3 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Completed run — static
</div>
<div className="flex items-center gap-2.5 rounded-lg px-1 py-2">
@@ -354,7 +358,7 @@ export function IssueChatUxLab() {
<Card className="gap-4 border-border/70 bg-background/85 py-0">
<CardHeader className="px-5 pt-5 pb-0">
- <div className="flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="flex items-center gap-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
<MessagesSquare className="h-4 w-4 text-cyan-700 dark:text-cyan-300" />
Review checklist
</div>
diff --git a/ui/src/pages/IssueDetail.test.tsx b/ui/src/pages/IssueDetail.test.tsx
index ab71a82b23..ca53a5040f 100644
--- a/ui/src/pages/IssueDetail.test.tsx
+++ b/ui/src/pages/IssueDetail.test.tsx
@@ -2438,7 +2438,7 @@ describe("IssueDetail", () => {
const dialogContent = container.querySelector('[data-slot="dialog-content"]') as HTMLDivElement | null;
expect(dialogContent).toBeTruthy();
- expect(dialogContent!.className).toContain("max-h-[calc(100dvh-2rem)]");
+ expect(dialogContent!.className).toContain("max-h-(--sz-calc-18)");
expect(dialogContent!.className).toContain("overflow-hidden");
expect(dialogContent!.className).toContain("flex-col");
diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx
index 951eca1d41..f8ee2d5611 100644
--- a/ui/src/pages/IssueDetail.tsx
+++ b/ui/src/pages/IssueDetail.tsx
@@ -522,10 +522,10 @@ function AttributionAvatar({
</AvatarFallback>
</Avatar>
<div className="min-w-0">
- <div className="text-[10px] font-medium uppercase leading-none text-background/70">{label}</div>
+ <div className="text-(length:--text-nano) font-medium uppercase leading-none text-background/70">{label}</div>
<div className="max-w-48 truncate text-xs font-medium leading-4 text-background">{actor.name}</div>
{via ? (
- <div className="max-w-48 truncate text-[10px] leading-3 text-background/60">via {via}</div>
+ <div className="max-w-48 truncate text-(length:--text-nano) leading-3 text-background/60">via {via}</div>
) : null}
</div>
</div>
@@ -634,7 +634,7 @@ function IssueChatSkeleton() {
</div>
<Skeleton className="h-8 w-8 rounded-full" />
</div>
- <Skeleton className="ml-auto h-16 w-[85%] rounded-xl" />
+ <Skeleton className="ml-auto h-16 w-(--pct-85) rounded-xl" />
</div>
<div className="space-y-2 border-t border-border pt-3">
<Skeleton className="h-3 w-28" />
@@ -666,7 +666,7 @@ function IssueDetailLoadingState({
) : null}
{headerSeed.originKind === "routine_execution" && headerSeed.originId ? (
<span
- className="inline-flex items-center gap-1 rounded-full border border-violet-500/30 bg-violet-500/10 px-2 py-0.5 text-[10px] font-medium text-violet-600 dark:text-violet-400 shrink-0"
+ className="inline-flex items-center gap-1 rounded-full border border-violet-500/30 bg-violet-500/10 px-2 py-0.5 text-(length:--text-nano) font-medium text-violet-600 dark:text-violet-400 shrink-0"
title={`Routine execution from routine ${headerSeed.originId}`}
>
<Repeat className="h-3 w-3" />
@@ -702,12 +702,12 @@ function IssueDetailLoadingState({
<h2 className="text-xl font-bold leading-tight">{headerSeed.title}</h2>
<div className="space-y-2">
<Skeleton className="h-4 w-full max-w-xl" />
- <Skeleton className="h-4 w-[72%]" />
+ <Skeleton className="h-4 w-(--pct-72)" />
</div>
</>
) : (
<>
- <Skeleton className="h-8 w-[min(100%,22rem)]" />
+ <Skeleton className="h-8 w-(--sz-calc-37)" />
<Skeleton className="h-16 w-full" />
</>
)}
@@ -3846,7 +3846,7 @@ export function IssueDetail() {
resolvedIssueDetailState ?? location.state,
location.search,
)}
- className="hover:text-foreground transition-colors truncate max-w-[200px]"
+ className="hover:text-foreground transition-colors truncate max-w-(--sz-200px)"
title={ancestor.title}
>
{ancestor.title}
@@ -3854,7 +3854,7 @@ export function IssueDetail() {
</span>
))}
<ChevronRight className="h-3 w-3 shrink-0" />
- <span className="text-foreground/60 truncate max-w-[200px]">{issue.title}</span>
+ <span className="text-foreground/60 truncate max-w-(--sz-200px)">{issue.title}</span>
</nav>
)}
@@ -3955,10 +3955,10 @@ export function IssueDetail() {
<span className="text-sm font-mono text-muted-foreground shrink-0">{issue.identifier ?? issue.id.slice(0, 8)}</span>
{hasLiveRuns && (
- <span className="inline-flex items-center gap-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/30 px-2 py-0.5 text-[10px] font-medium text-cyan-600 dark:text-cyan-400 shrink-0">
+ <span className="inline-flex items-center gap-1.5 rounded-full bg-blue-500/10 border border-blue-500/30 px-2 py-0.5 text-(length:--text-nano) font-medium text-blue-600 dark:text-blue-400 shrink-0">
<span className="relative flex h-1.5 w-1.5">
- <span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75" />
- <span className="relative inline-flex rounded-full h-1.5 w-1.5 bg-cyan-400" />
+ <span className="animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75" />
+ <span className="relative inline-flex rounded-full h-1.5 w-1.5 bg-blue-500" />
</span>
Live
</span>
@@ -3967,7 +3967,7 @@ export function IssueDetail() {
{issue.originKind === "routine_execution" && issue.originId && (
<Link
to={`/routines/${issue.originId}`}
- className="inline-flex items-center gap-1 rounded-full bg-violet-500/10 border border-violet-500/30 px-2 py-0.5 text-[10px] font-medium text-violet-600 dark:text-violet-400 shrink-0 hover:bg-violet-500/20 transition-colors"
+ className="inline-flex items-center gap-1 rounded-full bg-violet-500/10 border border-violet-500/30 px-2 py-0.5 text-(length:--text-nano) font-medium text-violet-600 dark:text-violet-400 shrink-0 hover:bg-violet-500/20 transition-colors"
title={`Routine execution from routine ${issue.originId}`}
>
<Repeat className="h-3 w-3" />
@@ -3981,7 +3981,7 @@ export function IssueDetail() {
{issue.originKind === "issue_productivity_review" ? (
<span
- className="inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300 shrink-0"
+ className="inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:text-amber-300 shrink-0"
title="This task is a productivity review."
>
<Eye className="h-3 w-3" />
@@ -3991,7 +3991,7 @@ export function IssueDetail() {
{issue.originKind === "task_watchdog" ? (
<span
- className="inline-flex items-center gap-1 rounded-full border border-sky-500/40 bg-sky-500/10 px-2 py-0.5 text-[10px] font-medium text-sky-700 dark:text-sky-300 shrink-0"
+ className="inline-flex items-center gap-1 rounded-full border border-sky-500/40 bg-sky-500/10 px-2 py-0.5 text-(length:--text-nano) font-medium text-sky-700 dark:text-sky-300 shrink-0"
title="This task is a generated watchdog task. It verifies whether stopped work in the watched task tree is legitimate."
>
<ScanEye className="h-3 w-3" />
@@ -4004,7 +4004,7 @@ export function IssueDetail() {
const WorkModeIcon = workModeMeta.icon;
return (
<span
- className={cn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium shrink-0", workModeMeta.classes.badge)}
+ className={cn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-(length:--text-nano) font-medium shrink-0", workModeMeta.classes.badge)}
title={`This task is in ${workModeMeta.label.toLowerCase()}.`}
>
<WorkModeIcon className="h-3 w-3" aria-hidden />
@@ -4016,7 +4016,7 @@ export function IssueDetail() {
{hasAssignedBacklogBlocker(issue.blockedBy) ? (
<span
data-testid="issue-detail-parked-blocker"
- className="inline-flex items-center gap-1 rounded-full border border-amber-500/60 bg-amber-500/15 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300 shrink-0"
+ className="inline-flex items-center gap-1 rounded-full border border-amber-500/60 bg-amber-500/15 px-2 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:text-amber-300 shrink-0"
title="Blocked by parked work — at least one assigned blocker is in backlog and will not wake its assignee."
>
<Flag className="h-3 w-3" />
@@ -4051,7 +4051,7 @@ export function IssueDetail() {
{(issue.labels ?? []).slice(0, 4).map((label) => (
<span
key={label.id}
- className="inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium"
+ className="inline-flex items-center rounded-full border px-2 py-0.5 text-(length:--text-nano) font-medium"
style={{
borderColor: label.color,
color: pickTextColorForPillBg(label.color, 0.12),
@@ -4062,7 +4062,7 @@ export function IssueDetail() {
</span>
))}
{(issue.labels ?? []).length > 4 && (
- <span className="text-[10px] text-muted-foreground">+{(issue.labels ?? []).length - 4}</span>
+ <span className="text-(length:--text-nano) text-muted-foreground">+{(issue.labels ?? []).length - 4}</span>
)}
</div>
)}
@@ -4268,7 +4268,7 @@ export function IssueDetail() {
value={issue.description ?? ""}
onSave={(description) => updateIssue.mutateAsync({ description })}
as="p"
- className="text-[15px] leading-7 text-foreground"
+ className="text-sm leading-7 text-foreground"
placeholder="Add a description..."
multiline
foldable
@@ -4640,7 +4640,7 @@ export function IssueDetail() {
</Tabs>
<Dialog open={treeControlOpen} onOpenChange={setTreeControlOpen}>
- <DialogContent className="flex max-h-[calc(100dvh-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-[560px]">
+ <DialogContent className="flex max-h-(--sz-calc-18) flex-col gap-0 overflow-hidden p-0 sm:max-w-(--sz-560px)">
<DialogHeader className="border-b border-border/60 px-6 pb-4 pr-12 pt-6">
<DialogTitle>{issueTreeControlLabel(treeControlMode, treeControlScope)}</DialogTitle>
<DialogDescription>
@@ -4662,7 +4662,7 @@ export function IssueDetail() {
value={treeControlReason}
onChange={(event) => setTreeControlReason(event.target.value)}
placeholder="Explain why this subtree control is being applied..."
- className="min-h-[88px]"
+ className="min-h-(--sz-88px)"
/>
</div>
@@ -4795,7 +4795,7 @@ export function IssueDetail() {
{/* Mobile properties drawer */}
<Sheet open={mobilePropsOpen} onOpenChange={setMobilePropsOpen}>
- <SheetContent side="bottom" className="max-h-[85dvh] pb-[env(safe-area-inset-bottom)]">
+ <SheetContent side="bottom" className="max-h-(--sz-85dvh) pb-(--sz-safe-bottom)">
<SheetHeader>
<SheetTitle className="text-sm">Properties</SheetTitle>
</SheetHeader>
diff --git a/ui/src/pages/Org.tsx b/ui/src/pages/Org.tsx
index 2cbc181643..1cd2b8a974 100644
--- a/ui/src/pages/Org.tsx
+++ b/ui/src/pages/Org.tsx
@@ -10,6 +10,7 @@ import { EmptyState } from "../components/EmptyState";
import { PageSkeleton } from "../components/PageSkeleton";
import { ChevronRight, GitBranch } from "lucide-react";
import { cn } from "../lib/utils";
+import { agentStatusDot, agentStatusDotDefault } from "../lib/status-colors";
function OrgTree({
nodes,
@@ -67,15 +68,9 @@ function OrgTreeNode({
<span
className={cn(
"h-2 w-2 rounded-full shrink-0",
- node.status === "active"
- ? "bg-green-400"
- : node.status === "paused"
- ? "bg-yellow-400"
- : node.status === "pending_approval"
- ? "bg-amber-400"
- : node.status === "error"
- ? "bg-red-400"
- : "bg-neutral-400"
+ // Gallery feedback r3: route through the canonical agentStatusDot
+ // map (identical hues for existing keys; adds the blue running dot).
+ agentStatusDot[node.status] ?? agentStatusDotDefault,
)}
/>
<span className="font-medium flex-1">{node.name}</span>
diff --git a/ui/src/pages/OrgChart.tsx b/ui/src/pages/OrgChart.tsx
index c5ea70e501..6488136181 100644
--- a/ui/src/pages/OrgChart.tsx
+++ b/ui/src/pages/OrgChart.tsx
@@ -159,14 +159,14 @@ function touchCenter(a: React.Touch, b: React.Touch, container: HTMLDivElement):
import { getAdapterLabel } from "../adapters/adapter-display-registry";
const statusDotColor: Record<string, string> = {
- running: "#22d3ee",
- active: "#4ade80",
- paused: "#facc15",
- idle: "#facc15",
- error: "#f87171",
- terminated: "#a3a3a3",
+ running: "var(--hex-22d3ee)",
+ active: "var(--hex-4ade80)",
+ paused: "var(--hex-facc15)",
+ idle: "var(--hex-facc15)",
+ error: "var(--hex-f87171)",
+ terminated: "var(--hex-a3a3a3)",
};
-const defaultDotColor = "#a3a3a3";
+const defaultDotColor = "var(--hex-a3a3a3)";
// ── Main component ──────────────────────────────────────────────────────
@@ -441,7 +441,7 @@ export function OrgChart() {
}
return (
- <div className="flex h-[calc(100dvh-9rem)] min-h-[420px] flex-col md:h-full md:min-h-0">
+ <div className="flex h-(--sz-calc-38) min-h-(--sz-420px) flex-col md:h-full md:min-h-0">
<div className="mb-2 flex shrink-0 flex-wrap items-center justify-start gap-2">
<Link to="/company/import">
<Button variant="outline" size="sm">
@@ -510,7 +510,7 @@ export function OrgChart() {
<Minus className="h-4 w-4 sm:h-3.5 sm:w-3.5" />
</button>
<button
- className="flex size-9 items-center justify-center rounded border border-border bg-background text-[10px] transition-colors hover:bg-accent sm:size-7"
+ className="flex size-9 items-center justify-center rounded border border-border bg-background text-(length:--text-nano) transition-colors hover:bg-accent sm:size-7"
onClick={fitToScreen}
title="Fit to screen"
aria-label="Fit chart to screen"
@@ -565,7 +565,7 @@ export function OrgChart() {
<div
key={node.id}
data-org-card
- className="absolute bg-card border border-border rounded-lg shadow-sm hover:shadow-md hover:border-foreground/20 transition-[box-shadow,border-color] duration-150 cursor-pointer select-none"
+ className="absolute bg-card border border-border rounded-lg shadow-sm hover:shadow-md hover:border-foreground/20 transition-(--tp-box-shadow-border-color) duration-150 cursor-pointer select-none"
style={{
left: node.x,
top: node.y,
@@ -596,16 +596,16 @@ export function OrgChart() {
<span className="text-sm font-semibold text-foreground leading-tight">
{node.name}
</span>
- <span className="text-[11px] text-muted-foreground leading-tight mt-0.5">
+ <span className="text-(length:--text-micro) text-muted-foreground leading-tight mt-0.5">
{agent?.title ?? roleLabel(node.role)}
</span>
{agent && (
- <span className="text-[10px] text-muted-foreground/60 font-mono leading-tight mt-1">
+ <span className="text-(length:--text-nano) text-muted-foreground/60 font-mono leading-tight mt-1">
{getAdapterLabel(agent.adapterType)}
</span>
)}
{agent && agent.capabilities && (
- <span className="text-[10px] text-muted-foreground/80 leading-tight mt-1 line-clamp-2">
+ <span className="text-(length:--text-nano) text-muted-foreground/80 leading-tight mt-1 line-clamp-2">
{agent.capabilities}
</span>
)}
diff --git a/ui/src/pages/PipelineSettings.tsx b/ui/src/pages/PipelineSettings.tsx
index aa7bc2a28a..dfbd6d53df 100644
--- a/ui/src/pages/PipelineSettings.tsx
+++ b/ui/src/pages/PipelineSettings.tsx
@@ -1074,7 +1074,7 @@ function FieldRow({
children: ReactNode;
}) {
return (
- <div className="grid gap-2 py-3 text-sm sm:grid-cols-[10rem_minmax(0,1fr)] sm:items-center">
+ <div className="grid gap-2 py-3 text-sm sm:grid-cols-(--gtc-41) sm:items-center">
<div className="font-medium text-muted-foreground">{label}</div>
<div className="min-w-0">{children}</div>
</div>
@@ -1197,11 +1197,11 @@ function StageSubSidebar({
</div>
<nav
aria-label="Stage sections"
- className="sticky top-14 hidden max-h-[calc(100dvh-3.5rem)] w-52 shrink-0 flex-col gap-4 self-start overflow-y-auto border-r border-border bg-sidebar/30 px-3 py-4 md:flex"
+ className="sticky top-14 hidden max-h-(--sz-calc-39) w-52 shrink-0 flex-col gap-4 self-start overflow-y-auto border-r border-border bg-sidebar/30 px-3 py-4 md:flex"
>
{groups.map((group) => (
<div key={group.label} className="flex flex-col gap-0.5">
- <p className="px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground/80">
+ <p className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground/80">
{group.label}
</p>
{group.items.map((item) => {
@@ -1249,7 +1249,7 @@ function StageEventsList({
{events.map((event) => (
<div
key={event.id}
- className="grid min-h-11 grid-cols-[6rem_1fr] items-center gap-3 border-b border-border/70 px-3 py-2 text-sm last:border-b-0"
+ className="grid min-h-11 grid-cols-(--gtc-15) items-center gap-3 border-b border-border/70 px-3 py-2 text-sm last:border-b-0"
>
<span className="text-xs text-muted-foreground" title={new Date(event.createdAt).toLocaleString()}>
{relativeTime(event.createdAt)}
@@ -2585,7 +2585,7 @@ export function PipelineSettings() {
</DropdownMenuContent>
</DropdownMenu>
</div>
- <div className="grid gap-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-end">
+ <div className="grid gap-3 md:grid-cols-(--gtc-13) md:items-end">
<div className="space-y-3">
<label className="block space-y-1.5 text-sm font-medium">
<span className="sr-only">Pipeline name</span>
@@ -2780,7 +2780,7 @@ export function PipelineSettings() {
<ChevronDown className="h-4 w-4 shrink-0 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="w-[min(24rem,calc(100vw-2rem))]">
+ <DropdownMenuContent align="start" className="w-(--sz-calc-40)">
<DropdownMenuRadioGroup value={stageKind} onValueChange={setStageKindWithDefaults}>
{STAGE_KIND_OPTIONS.map((option) => {
const Icon = option.icon;
@@ -2854,7 +2854,7 @@ export function PipelineSettings() {
] as const).map(([label, value, setValue, emptyLabel]) => (
<div
key={label}
- className="grid grid-cols-1 items-center gap-2 sm:grid-cols-[minmax(0,1fr)_240px]"
+ className="grid grid-cols-1 items-center gap-2 sm:grid-cols-(--gtc-42)"
>
<span className="text-sm font-medium">{label}</span>
<select
@@ -2870,13 +2870,13 @@ export function PipelineSettings() {
</select>
</div>
))}
- <div className="grid grid-cols-1 items-center gap-2 sm:grid-cols-[minmax(0,1fr)_240px]">
+ <div className="grid grid-cols-1 items-center gap-2 sm:grid-cols-(--gtc-42)">
<span className="text-sm font-medium">Ask for a note when requesting changes</span>
<div className="sm:justify-self-start">
<ToggleSwitch checked={requireRequestChangesReason} onCheckedChange={setRequireRequestChangesReason} />
</div>
</div>
- <div className="grid grid-cols-1 items-center gap-2 sm:grid-cols-[minmax(0,1fr)_240px]">
+ <div className="grid grid-cols-1 items-center gap-2 sm:grid-cols-(--gtc-42)">
<span className="text-sm font-medium">Ask for a note when declining</span>
<div className="sm:justify-self-start">
<ToggleSwitch checked={requireRejectReason} onCheckedChange={setRequireRejectReason} />
@@ -2941,7 +2941,7 @@ export function PipelineSettings() {
<>
<div className="divide-y divide-border border-y border-border">
<FieldRow label="Project context">
- <div className="grid gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
+ <div className="grid gap-2 sm:grid-cols-(--gtc-43)">
<InlineEntitySelector
value={stageProjectId}
options={projectOptions}
@@ -2956,7 +2956,7 @@ export function PipelineSettings() {
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: selectedAutomationProject.color ?? "#6366f1" }}
+ style={{ backgroundColor: selectedAutomationProject.color ?? "var(--project-seed)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -2971,7 +2971,7 @@ export function PipelineSettings() {
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: project?.color ?? "#6366f1" }}
+ style={{ backgroundColor: project?.color ?? "var(--project-seed)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -3007,7 +3007,7 @@ export function PipelineSettings() {
{selectedAutomationProject && selectedProjectSupportsExecutionWorkspace ? (
<FieldRow label="Execution workspace">
- <div className="grid gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
+ <div className="grid gap-2 sm:grid-cols-(--gtc-43)">
<select
aria-label="Execution workspace mode"
value={stageExecutionWorkspacePreference || "shared_workspace"}
@@ -3093,7 +3093,7 @@ export function PipelineSettings() {
: "Tell the agent exactly what to do when an item enters this step..."
}
bordered={false}
- contentClassName="min-h-[120px] text-[15px] leading-7"
+ contentClassName="min-h-(--sz-120px) text-sm leading-7"
mentions={mentionOptions}
onSubmit={() => {
if (!saveStage.isPending && stageName.trim() && !reviewTargetsMissing && canSaveAutomationWorkspace) {
@@ -3228,7 +3228,7 @@ export function PipelineSettings() {
Advance when the last child is done
</span>
</div>
- <div className="grid grid-cols-1 items-center gap-2 sm:grid-cols-[5rem_240px]">
+ <div className="grid grid-cols-1 items-center gap-2 sm:grid-cols-(--gtc-44)">
<span className="text-sm font-medium text-muted-foreground">Move to</span>
<select
aria-label="Move to stage when children finish"
diff --git a/ui/src/pages/Pipelines.tsx b/ui/src/pages/Pipelines.tsx
index 41fb43237a..4089562409 100644
--- a/ui/src/pages/Pipelines.tsx
+++ b/ui/src/pages/Pipelines.tsx
@@ -733,9 +733,9 @@ export function PipelinesIndexTable({
<EmptyState icon={Hexagon} message="No pipelines match your search." />
) : (
<div className="overflow-x-auto">
- <table className="w-full min-w-[780px] border-collapse text-sm">
+ <table className="w-full min-w-(--sz-780px) border-collapse text-sm">
<thead>
- <tr className="border-b border-border text-left text-[11px] font-semibold uppercase tracking-widest text-muted-foreground">
+ <tr className="border-b border-border text-left text-(length:--text-micro) font-semibold uppercase tracking-widest text-muted-foreground">
<th className="py-2 pl-3 pr-4">Name</th>
<th className="px-4 py-2">Attention</th>
<th className="px-4 py-2">Open items</th>
@@ -950,7 +950,7 @@ function PipelinesIndex() {
<div className="w-full max-w-6xl px-6 py-8">
<div className="mb-6 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div>
- <p className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">Work</p>
+ <p className="text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Work</p>
<h1 className="text-2xl font-semibold text-foreground">Pipelines</h1>
<p className="mt-1 text-sm text-muted-foreground">
{formatNumber(pipelines.length)} pipeline{pipelines.length === 1 ? "" : "s"}. Connected ones are grouped from upstream work into downstream work.
@@ -1253,23 +1253,23 @@ function PipelineCaseCard({
<p className="font-medium leading-snug text-foreground">{title}</p>
<div className="mt-1.5 flex flex-wrap gap-1.5">
{isWorking ? (
- <span className="relative inline-flex items-center rounded-full border border-emerald-400/40 bg-emerald-50 px-2 py-0.5 text-[10px] font-medium text-emerald-700 dark:border-emerald-300/30 dark:bg-emerald-900/30 dark:text-emerald-300">
+ <span className="relative inline-flex items-center rounded-full border border-emerald-400/40 bg-emerald-50 px-2 py-0.5 text-(length:--text-nano) font-medium text-emerald-700 dark:border-emerald-300/30 dark:bg-emerald-900/30 dark:text-emerald-300">
<span className="absolute -left-1 -top-1 h-2 w-2 animate-pulse rounded-full bg-emerald-500"></span>
Working
</span>
) : null}
{hasNeedsAttention ? (
- <span className="inline-flex items-center rounded-full border border-amber-400/40 bg-amber-50 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:border-amber-300/30 dark:bg-amber-900/25 dark:text-amber-300">
+ <span className="inline-flex items-center rounded-full border border-amber-400/40 bg-amber-50 px-2 py-0.5 text-(length:--text-nano) font-medium text-amber-700 dark:border-amber-300/30 dark:bg-amber-900/25 dark:text-amber-300">
Needs attention
</span>
) : null}
{hasChangedNotice ? (
- <span className="inline-flex items-center rounded-full border border-indigo-400/40 bg-indigo-50 px-2 py-0.5 text-[10px] font-medium text-indigo-700 dark:border-indigo-300/30 dark:bg-indigo-900/25 dark:text-indigo-300">
+ <span className="inline-flex items-center rounded-full border border-indigo-400/40 bg-indigo-50 px-2 py-0.5 text-(length:--text-nano) font-medium text-indigo-700 dark:border-indigo-300/30 dark:bg-indigo-900/25 dark:text-indigo-300">
This changed
</span>
) : null}
{liveDownstreamCount > 0 ? (
- <span className="inline-flex items-center gap-1 rounded-full border border-emerald-400/35 bg-emerald-50 px-2 py-0.5 text-[10px] font-medium text-emerald-700 dark:border-emerald-300/30 dark:bg-emerald-900/25 dark:text-emerald-300">
+ <span className="inline-flex items-center gap-1 rounded-full border border-emerald-400/35 bg-emerald-50 px-2 py-0.5 text-(length:--text-nano) font-medium text-emerald-700 dark:border-emerald-300/30 dark:bg-emerald-900/25 dark:text-emerald-300">
<span className="h-1.5 w-1.5 rounded-full bg-emerald-500" aria-hidden="true" />
{formatLiveDownstream(liveDownstreamCount)}
</span>
@@ -1324,7 +1324,7 @@ function PipelineBoardColumn({
key={stage.id}
aria-label={`${stage.name} column`}
className={cn(
- "flex min-w-[260px] max-w-[320px] shrink-0 flex-col rounded-md border",
+ "flex min-w-(--sz-260px) max-w-(--sz-320px) shrink-0 flex-col rounded-md border",
tone.outer,
isBlockedDropTarget && "ring-1 ring-red-500/45",
)}
@@ -1380,12 +1380,12 @@ function PipelineBoardColumn({
<div
ref={setNodeRef}
className={cn(
- "min-h-[160px] flex-1 space-y-2 rounded-b-md px-2 py-2 transition-colors",
+ "min-h-(--sz-160px) flex-1 space-y-2 rounded-b-md px-2 py-2 transition-colors",
isBlockedDropTarget ? "bg-red-50 dark:bg-red-950/30" : isOver ? tone.bodyOver : tone.body,
)}
>
{isBlockedDropTarget ? (
- <p className="rounded border border-red-200 bg-red-50 px-3 py-2 text-[11px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200">
+ <p className="rounded border border-red-200 bg-red-50 px-3 py-2 text-(length:--text-micro) text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200">
This move skips the normal flow
</p>
) : null}
@@ -1394,7 +1394,7 @@ function PipelineBoardColumn({
caseGroups.map((group) => (
<div key={group.key} className="space-y-2">
{groupBy === "builtFor" ? (
- <div className="flex items-center justify-between gap-2 px-1 pt-1 text-[11px] font-medium text-muted-foreground">
+ <div className="flex items-center justify-between gap-2 px-1 pt-1 text-(length:--text-micro) font-medium text-muted-foreground">
{group.href ? (
<Link to={group.href} className="min-w-0 truncate hover:text-foreground hover:underline">
{group.label}
@@ -1707,7 +1707,7 @@ function PipelineBoard({ pipelineId }: { pipelineId: string }) {
return (
<div className="mx-auto max-w-6xl space-y-4 px-6 py-8">
<div>
- <p className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">Pipeline</p>
+ <p className="text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Pipeline</p>
<h1 className="text-2xl font-semibold text-foreground">{pipeline.name}</h1>
<p className="text-sm text-muted-foreground">No stages are set up for this pipeline yet.</p>
</div>
@@ -1727,7 +1727,7 @@ function PipelineBoard({ pipelineId }: { pipelineId: string }) {
<div className="w-full space-y-4 px-6 py-8">
<div className="flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between">
<div>
- <p className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">Pipeline</p>
+ <p className="text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Pipeline</p>
<h1 className="text-2xl font-semibold text-foreground">{pipeline.name}</h1>
{pipeline.description ? <p className="mt-1 text-sm text-muted-foreground">{pipeline.description}</p> : null}
<p className="mt-1 text-xs text-muted-foreground">{cases.length} total item{cases.length === 1 ? "" : "s"}</p>
@@ -1749,7 +1749,7 @@ function PipelineBoard({ pipelineId }: { pipelineId: string }) {
</div>
<div className="flex shrink-0 flex-wrap items-center gap-2 sm:justify-end">
<Select value={groupBy} onValueChange={handleGroupByChange}>
- <SelectTrigger className="h-9 w-[148px]" aria-label="Group by" title="Group by">
+ <SelectTrigger className="h-9 w-(--sz-148px)" aria-label="Group by" title="Group by">
<Layers className="h-4 w-4 text-muted-foreground" />
<SelectValue />
</SelectTrigger>
@@ -2784,7 +2784,7 @@ export function PipelineItemDetailView({ pipelineId, caseId }: { pipelineId: str
return (
<div className="mx-auto max-w-6xl px-6 py-8">
- <div className="mb-6 grid gap-5 lg:grid-cols-[minmax(0,1fr)_340px] lg:items-start lg:gap-8">
+ <div className="mb-6 grid gap-5 lg:grid-cols-(--gtc-45) lg:items-start lg:gap-8">
<div className="min-w-0">
<div className="mb-2 flex flex-wrap items-center gap-2 text-sm text-muted-foreground">
<Link to="/pipelines" className="hover:text-foreground">Pipelines</Link>
@@ -3084,7 +3084,7 @@ export function PipelineItemDetailView({ pipelineId, caseId }: { pipelineId: str
<label
key={option.id}
className={cn(
- "grid grid-cols-[18px_minmax(0,1fr)] gap-3 py-1.5 text-sm",
+ "grid grid-cols-(--gtc-46) gap-3 py-1.5 text-sm",
option.disabled && !option.required ? "text-muted-foreground" : "text-foreground",
)}
>
@@ -3230,7 +3230,7 @@ export function PipelineItemDetailView({ pipelineId, caseId }: { pipelineId: str
</section>
) : null}
- <div className="grid gap-8 lg:grid-cols-[minmax(0,1fr)_340px]">
+ <div className="grid gap-8 lg:grid-cols-(--gtc-45)">
<main className="min-w-0 space-y-8">
<PipelineItemBodyDocument
caseId={caseId}
@@ -3252,7 +3252,7 @@ export function PipelineItemDetailView({ pipelineId, caseId }: { pipelineId: str
<summary className="flex cursor-pointer list-none items-center gap-2 px-3 py-2 text-sm font-semibold text-foreground [&::-webkit-details-marker]:hidden">
<ChevronRight className="h-3.5 w-3.5 text-muted-foreground transition-transform group-open:rotate-90" />
More details
- <span className="text-[11px] font-normal text-muted-foreground">
+ <span className="text-(length:--text-micro) font-normal text-muted-foreground">
{mainPaneFields.length} {mainPaneFields.length === 1 ? "field" : "fields"}
</span>
</summary>
@@ -3262,7 +3262,7 @@ export function PipelineItemDetailView({ pipelineId, caseId }: { pipelineId: str
<h3 className="mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground">
{field.label}
</h3>
- <MarkdownBody className="text-[15px] leading-7 text-foreground">
+ <MarkdownBody className="text-sm leading-7 text-foreground">
{field.value}
</MarkdownBody>
</div>
@@ -3385,7 +3385,7 @@ export function PipelineItemDetailView({ pipelineId, caseId }: { pipelineId: str
{itemFields.length > 0 ? (
<dl className="divide-y divide-border">
{itemFields.map((field) => (
- <div key={field.key} className="grid grid-cols-[120px_1fr] gap-3 py-2 text-sm">
+ <div key={field.key} className="grid grid-cols-(--gtc-47) gap-3 py-2 text-sm">
<dt className="text-muted-foreground">{field.label}</dt>
<dd className="min-w-0 text-foreground [overflow-wrap:anywhere]">{field.value}</dd>
</div>
@@ -3508,7 +3508,7 @@ function WaitingChildRow({
<li>
<Link
to={`/pipelines/${row.case.pipelineId}/items/${row.case.id}`}
- className="grid grid-cols-[18px_minmax(0,1fr)_auto] items-start gap-3 py-2 text-sm"
+ className="grid grid-cols-(--gtc-48) items-start gap-3 py-2 text-sm"
>
<GitBranch className="h-4 w-4 text-muted-foreground" />
<span className="min-w-0">
@@ -3643,7 +3643,7 @@ function ReviewDecisionPanel({
return (
<section>
- <h2 className="mb-3 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground">Review</h2>
+ <h2 className="mb-3 text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Review</h2>
<div className="border-y border-amber-300 bg-amber-50/70 p-5 text-amber-950 dark:border-amber-900/70 dark:bg-amber-950/30 dark:text-amber-100 sm:p-6">
<div className="space-y-5">
<div className="flex items-start gap-3">
@@ -3773,7 +3773,7 @@ function DetailSection({
}) {
return (
<section>
- <h2 className="mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground">
+ <h2 className="mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
<span>{title}</span>
{trailing}
</h2>
@@ -3850,12 +3850,12 @@ function OutputLink({
}
function OutputMetaDot() {
- return <span className="inline-block h-[3px] w-[3px] shrink-0 rounded-full bg-muted-foreground/60" aria-hidden />;
+ return <span className="inline-block h-(--sz-3px) w-(--sz-3px) shrink-0 rounded-full bg-muted-foreground/60" aria-hidden />;
}
function OutputDeliverableTag({ label }: { label: string }) {
return (
- <span className="shrink-0 rounded-full border border-green-600 px-1.5 text-[10px] font-semibold uppercase text-green-600 dark:border-green-400 dark:text-green-400">
+ <span className="shrink-0 rounded-full border border-green-600 px-1.5 text-(length:--text-nano) font-semibold uppercase text-green-600 dark:border-green-400 dark:text-green-400">
{label}
</span>
);
@@ -3863,7 +3863,7 @@ function OutputDeliverableTag({ label }: { label: string }) {
function OutputUnverifiedTag() {
return (
- <span className="shrink-0 rounded-full border border-border px-1.5 text-[10px] font-semibold uppercase text-muted-foreground">
+ <span className="shrink-0 rounded-full border border-border px-1.5 text-(length:--text-nano) font-semibold uppercase text-muted-foreground">
Unverified
</span>
);
@@ -3881,10 +3881,10 @@ function ItemOutputMeta({ item, children }: { item: PipelineCaseOutputItem; chil
const statusClass = issueStatusText[item.sourceIssueStatus] ?? issueStatusTextDefault;
const roleLabel = OUTPUT_SOURCE_ROLE_LABELS[item.sourceRole] ?? humanizeOutputStatus(item.sourceRole);
return (
- <div className="mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[11px] text-muted-foreground">
+ <div className="mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-(length:--text-micro) text-muted-foreground">
<Link
to={issueDetailPath({ id: item.sourceIssueId, identifier: item.sourceIssueIdentifier })}
- className="font-mono text-[11px] text-muted-foreground hover:text-foreground hover:underline"
+ className="font-mono text-(length:--text-micro) text-muted-foreground hover:text-foreground hover:underline"
title={item.sourceIssueTitle}
>
{item.sourceIssueIdentifier ?? "Source task"}
@@ -3908,13 +3908,13 @@ function ItemOutputDocumentRow({ item }: { item: PipelineCaseDocumentOutputItem
const lowTrust = isLowTrustOutput(item);
const href = documentAnchorPath(item);
return (
- <div className="group flex items-start gap-[11px] py-2.5 hover:bg-accent/50">
+ <div className="group flex items-start gap-(--sz-11px) py-2.5 hover:bg-accent/50">
<FileText
className={cn("mt-0.5 h-4 w-4 shrink-0", deliverable ? "text-green-600 dark:text-green-400" : "text-muted-foreground")}
/>
<div className="min-w-0 flex-1">
<div className="flex items-center gap-1.5">
- <Link to={href} className="truncate text-[13px] font-medium text-foreground hover:underline" title={item.title}>
+ <Link to={href} className="truncate text-(length:--text-compact) font-medium text-foreground hover:underline" title={item.title}>
{item.title}
</Link>
{deliverable ? <OutputDeliverableTag label={deliverable} /> : null}
@@ -3925,7 +3925,7 @@ function ItemOutputDocumentRow({ item }: { item: PipelineCaseDocumentOutputItem
</div>
<Link
to={href}
- className="inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
+ className="inline-flex h-(--sz-30px) w-(--sz-30px) shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
aria-label={`Open ${item.title}`}
title="Open document"
>
@@ -3939,11 +3939,11 @@ function ItemOutputWorkProductRow({ item }: { item: PipelineCaseWorkProductOutpu
const lowTrust = isLowTrustOutput(item);
const href = item.url ?? issueDetailPath({ id: item.sourceIssueId, identifier: item.sourceIssueIdentifier });
return (
- <div className="group flex items-start gap-[11px] py-2.5 hover:bg-accent/50">
+ <div className="group flex items-start gap-(--sz-11px) py-2.5 hover:bg-accent/50">
<Package className="mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" />
<div className="min-w-0 flex-1">
<div className="flex items-center gap-1.5">
- <OutputLink to={href} className="truncate text-[13px] font-medium text-foreground hover:underline" title={item.title}>
+ <OutputLink to={href} className="truncate text-(length:--text-compact) font-medium text-foreground hover:underline" title={item.title}>
{item.title}
</OutputLink>
{lowTrust ? <OutputUnverifiedTag /> : null}
@@ -3953,7 +3953,7 @@ function ItemOutputWorkProductRow({ item }: { item: PipelineCaseWorkProductOutpu
</div>
<OutputLink
to={href}
- className="inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
+ className="inline-flex h-(--sz-30px) w-(--sz-30px) shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
ariaLabel={`Open ${item.title}`}
title="Open work product"
>
@@ -3969,14 +3969,14 @@ function ItemOutputAttachmentRow({ item }: { item: PipelineCaseAttachmentOutputI
return (
<div
id={`linked-attachment-${item.attachmentId}`}
- className="group flex items-start gap-[11px] py-2.5 hover:bg-accent/50"
+ className="group flex items-start gap-(--sz-11px) py-2.5 hover:bg-accent/50"
>
{isImage ? (
<a
href={item.openPath}
target="_blank"
rel="noreferrer"
- className="mt-0.5 block h-[30px] w-10 shrink-0 overflow-hidden rounded-sm border border-border bg-accent/10"
+ className="mt-0.5 block h-(--sz-30px) w-10 shrink-0 overflow-hidden rounded-sm border border-border bg-accent/10"
aria-label={`Open ${filename}`}
>
<img src={item.contentPath} alt={filename} className="h-full w-full object-cover" loading="lazy" />
@@ -3990,7 +3990,7 @@ function ItemOutputAttachmentRow({ item }: { item: PipelineCaseAttachmentOutputI
href={item.openPath}
target="_blank"
rel="noreferrer"
- className="truncate text-[13px] font-medium text-foreground hover:underline"
+ className="truncate text-(length:--text-compact) font-medium text-foreground hover:underline"
title={filename}
>
{filename}
@@ -4006,7 +4006,7 @@ function ItemOutputAttachmentRow({ item }: { item: PipelineCaseAttachmentOutputI
href={item.openPath}
target="_blank"
rel="noreferrer"
- className="inline-flex h-[30px] w-[30px] items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
+ className="inline-flex h-(--sz-30px) w-(--sz-30px) items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
aria-label={`Open ${filename}`}
title="Open"
>
@@ -4014,7 +4014,7 @@ function ItemOutputAttachmentRow({ item }: { item: PipelineCaseAttachmentOutputI
</a>
<a
href={item.downloadPath}
- className="inline-flex h-[30px] w-[30px] items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
+ className="inline-flex h-(--sz-30px) w-(--sz-30px) items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"
aria-label={`Download ${filename}`}
title="Download"
>
@@ -4073,7 +4073,7 @@ function ItemOutputsSection({
title="Item outputs"
trailing={
loading ? null : (
- <span className="rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium normal-case tracking-normal text-muted-foreground">
+ <span className="rounded-full bg-muted px-2 py-0.5 text-(length:--text-micro) font-medium normal-case tracking-normal text-muted-foreground">
{items.length}
</span>
)
@@ -4083,8 +4083,8 @@ function ItemOutputsSection({
<div className="divide-y divide-border">
{[0, 1, 2].map((index) => (
<div key={index} className="py-2.5">
- <div className="h-[11px] w-1/2 rounded bg-muted" />
- <div className="mt-1.5 h-[9px] w-1/4 rounded bg-muted opacity-70" />
+ <div className="h-(--sz-11px) w-1/2 rounded bg-muted" />
+ <div className="mt-1.5 h-(--sz-9px) w-1/4 rounded bg-muted opacity-70" />
</div>
))}
</div>
@@ -4104,7 +4104,7 @@ function ItemOutputsSection({
<div>
{groups.map((group, index) => (
<div key={group.key} className={index > 0 ? "border-t border-border" : undefined}>
- <div className="flex items-center gap-1.5 pb-1.5 pt-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="flex items-center gap-1.5 pb-1.5 pt-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
{group.icon}
<span>{group.label}</span>
<span>· {group.rows.length}</span>
@@ -4132,7 +4132,7 @@ function BuiltFromTree({
<li key={row.case.id}>
<Link
to={`/pipelines/${row.case.pipelineId}/items/${row.case.id}`}
- className="grid grid-cols-[18px_1fr_auto] items-center gap-3 py-3 text-sm hover:bg-muted/40"
+ className="grid grid-cols-(--gtc-49) items-center gap-3 py-3 text-sm hover:bg-muted/40"
>
<GitBranch className="h-4 w-4 text-muted-foreground" />
<span className="min-w-0">
@@ -4226,7 +4226,7 @@ function PipelineAddItems({ pipelineId }: { pipelineId: string }) {
return (
<div className="mx-auto max-w-6xl px-6 py-8">
<div className="mb-6">
- <p className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">
+ <p className="text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Add to {pipeline.data.name}
</p>
<h1 className="text-2xl font-semibold text-foreground">Build your list, then submit it all at once</h1>
@@ -4323,9 +4323,9 @@ function DraftItemRow({
return (
<section className={cn("border border-border bg-background", row.expanded && "border-primary")}>
- <div className="grid grid-cols-[1fr_auto] items-center gap-3 px-4 py-3">
+ <div className="grid grid-cols-(--gtc-17) items-center gap-3 px-4 py-3">
<button type="button" className="min-w-0 text-left" onClick={onToggle}>
- <span className="block text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground">Item {index + 1}</span>
+ <span className="block text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Item {index + 1}</span>
<span className="block truncate text-sm font-semibold text-foreground">{title}</span>
{!row.expanded && preview ? <span className="block truncate text-xs text-muted-foreground">{preview}</span> : null}
{!row.expanded && row.serverError ? <span className="block text-xs text-destructive">{row.serverError}</span> : null}
@@ -4341,7 +4341,7 @@ function DraftItemRow({
</div>
{row.expanded ? (
- <div className="grid gap-5 border-t border-border px-4 py-4 lg:grid-cols-[1fr_280px]">
+ <div className="grid gap-5 border-t border-border px-4 py-4 lg:grid-cols-(--gtc-50)">
<div className="grid gap-4 md:grid-cols-2">
{fields.map((field) => (
<GeneratedField
@@ -4355,7 +4355,7 @@ function DraftItemRow({
{row.serverError ? <p className="md:col-span-2 text-sm text-destructive">{row.serverError}</p> : null}
</div>
<aside className="border border-border p-4 text-sm">
- <p className="mb-3 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground">Preview</p>
+ <p className="mb-3 text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Preview</p>
<p className="font-semibold text-foreground">{title}</p>
<p className="mt-3 text-xs text-muted-foreground">First stage on submit:</p>
<p className="font-semibold text-foreground">{intake.stageName ?? "First stage"}</p>
@@ -4622,7 +4622,7 @@ function ReviewQueueDetailDialog({
{fields.length > 0 ? (
<div className="divide-y divide-border rounded-md border border-border">
{fields.map(([key, value]) => (
- <div key={key} className="grid grid-cols-[160px_1fr] gap-3 px-3 py-2 text-sm">
+ <div key={key} className="grid grid-cols-(--gtc-51) gap-3 px-3 py-2 text-sm">
<span className="text-muted-foreground">{humanizeFieldLabel(key)}</span>
<span className="text-foreground">{String(value)}</span>
</div>
@@ -4736,7 +4736,7 @@ function ReviewQueueSection({
tabIndex={0}
aria-current={active ? "true" : undefined}
className={cn(
- "grid min-h-10 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 px-2 py-2 text-sm outline-none transition-colors",
+ "grid min-h-10 grid-cols-(--gtc-13) items-center gap-3 px-2 py-2 text-sm outline-none transition-colors",
active ? "bg-accent/60" : "hover:bg-accent/40",
)}
onMouseEnter={() => onActivate(row.id)}
@@ -4766,7 +4766,7 @@ function ReviewQueueSection({
<div className="min-w-0">
<div className="flex min-w-0 items-center gap-2">
<p className="truncate font-semibold text-foreground">{row.title}</p>
- <span className="shrink-0 rounded-full border border-border px-2 py-0.5 text-[11px] font-semibold text-muted-foreground">
+ <span className="shrink-0 rounded-full border border-border px-2 py-0.5 text-(length:--text-micro) font-semibold text-muted-foreground">
{row.pipelineName}
</span>
<ReviewQueueStatusChip failed={failed} />
@@ -5221,7 +5221,7 @@ export function Learnings() {
<div
key={event.id}
className={cn(
- "grid min-h-11 grid-cols-[6rem_1fr] items-center gap-3 border-b border-border/70 px-3 py-2 text-sm last:border-b-0",
+ "grid min-h-11 grid-cols-(--gtc-15) items-center gap-3 border-b border-border/70 px-3 py-2 text-sm last:border-b-0",
forcedMove && "border-l-2 border-l-amber-400 bg-amber-50/50 dark:bg-amber-400/10",
)}
>
diff --git a/ui/src/pages/PluginManager.tsx b/ui/src/pages/PluginManager.tsx
index 3a89318614..75e9562978 100644
--- a/ui/src/pages/PluginManager.tsx
+++ b/ui/src/pages/PluginManager.tsx
@@ -549,7 +549,7 @@ export function PluginManager() {
</div>
<div className="space-y-2">
<p className="text-sm font-medium">Full error output</p>
- <pre className="max-h-[50vh] overflow-auto rounded-md border bg-muted/40 p-3 text-xs leading-5 whitespace-pre-wrap break-words">
+ <pre className="max-h-(--sz-50vh) overflow-auto rounded-md border bg-muted/40 p-3 text-xs leading-5 whitespace-pre-wrap break-words">
{errorDetailsPlugin?.lastError ?? "No stored error message."}
</pre>
</div>
diff --git a/ui/src/pages/PluginPage.tsx b/ui/src/pages/PluginPage.tsx
index 3b6aab701d..f22ee4a930 100644
--- a/ui/src/pages/PluginPage.tsx
+++ b/ui/src/pages/PluginPage.tsx
@@ -178,7 +178,7 @@ export function PluginPage() {
<PluginSlotMount
slot={pageSlot}
context={context}
- className="min-h-[200px]"
+ className="min-h-(--sz-200px)"
missingBehavior="placeholder"
/>
</div>
diff --git a/ui/src/pages/PluginSettings.tsx b/ui/src/pages/PluginSettings.tsx
index cca80b0953..5c984f2d9d 100644
--- a/ui/src/pages/PluginSettings.tsx
+++ b/ui/src/pages/PluginSettings.tsx
@@ -188,7 +188,7 @@ export function PluginSettings() {
<div className="space-y-8">
<section className="space-y-5">
<h2 className="text-base font-semibold">About</h2>
- <div className="grid gap-8 lg:grid-cols-[minmax(0,1.4fr)_minmax(220px,0.8fr)]">
+ <div className="grid gap-8 lg:grid-cols-(--gtc-52)">
<div className="space-y-2">
<h3 className="text-sm font-medium text-muted-foreground">Description</h3>
<p className="text-sm leading-6 text-foreground/90">{pluginDescription}</p>
@@ -275,7 +275,7 @@ export function PluginSettings() {
</TabsContent>
<TabsContent value="status" className="space-y-6">
- <div className="grid gap-6 xl:grid-cols-[minmax(0,1.2fr)_320px]">
+ <div className="grid gap-6 xl:grid-cols-(--gtc-39)">
<div className="space-y-6">
<Card>
<CardHeader>
@@ -359,7 +359,7 @@ export function PluginSettings() {
<span className="truncate font-mono text-xs" title={run.jobKey ?? run.jobId}>
{run.jobKey ?? run.jobId.slice(0, 8)}
</span>
- <Badge variant="outline" className="px-1 py-0 text-[10px]">
+ <Badge variant="outline" className="px-1 py-0 text-(length:--text-nano)">
{run.trigger}
</Badge>
</div>
@@ -445,7 +445,7 @@ export function PluginSettings() {
}`}
>
<span className="shrink-0 text-muted-foreground/50">{new Date(entry.createdAt).toLocaleTimeString()}</span>
- <Badge variant="outline" className="h-4 shrink-0 px-1 text-[10px]">{entry.level}</Badge>
+ <Badge variant="outline" className="h-4 shrink-0 px-1 text-(length:--text-nano)">{entry.level}</Badge>
<span className="truncate" title={entry.message}>{entry.message}</span>
</div>
))}
@@ -530,7 +530,7 @@ export function PluginSettings() {
</div>
<div className="flex justify-between gap-3">
<span>NPM Package</span>
- <span className="max-w-[170px] truncate text-right text-xs" title={plugin.packageName}>
+ <span className="max-w-(--sz-170px) truncate text-right text-xs" title={plugin.packageName}>
{plugin.packageName}
</span>
</div>
@@ -695,7 +695,7 @@ function PluginLocalFolderRow({ pluginId, companyId, declaration, status }: Plug
<div className="min-w-0 space-y-1">
<div className="flex flex-wrap items-center gap-2">
<h4 className="text-sm font-medium">{declaration.displayName}</h4>
- <Badge variant="outline" className="font-mono text-[10px]">
+ <Badge variant="outline" className="font-mono text-(length:--text-nano)">
{declaration.folderKey}
</Badge>
<Badge variant={status?.healthy ? "default" : "secondary"}>
@@ -863,15 +863,15 @@ function RequirementList({
<div className="flex items-center justify-between gap-2">
<span className="text-xs font-medium text-muted-foreground">{title}</span>
{inspectionUnavailable ? (
- <Badge variant="secondary" className="text-[10px]">
+ <Badge variant="secondary" className="text-(length:--text-nano)">
Not inspected
</Badge>
) : missingItems.length > 0 ? (
- <Badge variant="destructive" className="text-[10px]">
+ <Badge variant="destructive" className="text-(length:--text-nano)">
{missingItems.length} missing
</Badge>
) : (
- <Badge variant="outline" className="text-[10px]">Present</Badge>
+ <Badge variant="outline" className="text-(length:--text-nano)">Present</Badge>
)}
</div>
{items.length > 0 ? (
@@ -881,7 +881,7 @@ function RequirementList({
return (
<span
key={item}
- className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${
+ className={`rounded border px-1.5 py-0.5 font-mono text-(length:--text-micro) ${
inspectionUnavailable
? "border-amber-300/60 bg-amber-50 text-amber-700 dark:border-amber-800/70 dark:bg-amber-950/30 dark:text-amber-300"
: missing
diff --git a/ui/src/pages/ProfileSettings.tsx b/ui/src/pages/ProfileSettings.tsx
index 674ff78029..51417654cc 100644
--- a/ui/src/pages/ProfileSettings.tsx
+++ b/ui/src/pages/ProfileSettings.tsx
@@ -157,11 +157,11 @@ export function ProfileSettings() {
) : null}
<section className="space-y-8">
- <div className="relative overflow-hidden rounded-[28px] border border-border/70 bg-card shadow-sm">
- <div className="absolute inset-x-0 top-0 h-32 bg-[linear-gradient(135deg,hsl(var(--primary))_0%,hsl(var(--accent))_58%,color-mix(in_oklab,hsl(var(--background))_76%,white_24%)_100%)]" />
- <div className="absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(255,255,255,0.22),transparent_34%),radial-gradient(circle_at_bottom_left,rgba(255,255,255,0.08),transparent_36%)]" />
+ <div className="relative overflow-hidden rounded-(--rad-28) border border-border/70 bg-card shadow-sm">
+ <div className="absolute inset-x-0 top-0 h-32 bg-(image:--gradient-extract-26)" />
+ <div className="absolute inset-0 bg-(image:--gradient-extract-7)" />
<div className="relative p-6 pt-10">
- <div className="flex flex-wrap items-end gap-5 rounded-[24px] border border-border/70 bg-background/92 p-5 shadow-[0_18px_44px_-28px_rgba(0,0,0,0.45)] backdrop-blur-sm">
+ <div className="flex flex-wrap items-end gap-5 rounded-(--rad-24) border border-border/70 bg-background/92 p-5 shadow-(--shadow-extract-18) backdrop-blur-sm">
<div className="space-y-3">
<label
htmlFor={avatarInputId}
diff --git a/ui/src/pages/ProjectDetail.tsx b/ui/src/pages/ProjectDetail.tsx
index f0e7990213..b9265a52fe 100644
--- a/ui/src/pages/ProjectDetail.tsx
+++ b/ui/src/pages/ProjectDetail.tsx
@@ -148,7 +148,7 @@ function ProjectTilePicker({
<PopoverTrigger asChild>
<button
type="button"
- className="shrink-0 rounded-lg cursor-pointer hover:ring-2 hover:ring-foreground/20 transition-[box-shadow]"
+ className="shrink-0 rounded-lg cursor-pointer hover:ring-2 hover:ring-foreground/20 transition-(--tp-box-shadow)"
aria-label="Change project icon and color"
>
<ProjectTile color={color} icon={icon} size="md" />
@@ -192,7 +192,7 @@ function ProjectTilePicker({
<button
type="button"
onClick={() => onSelectColor(null)}
- className={`h-6 w-6 cursor-pointer transition-[transform,box-shadow] duration-150 hover:scale-110 ${
+ className={`h-6 w-6 cursor-pointer transition-(--tp-transform-box-shadow) duration-150 hover:scale-110 ${
color === null
? "ring-2 ring-foreground ring-offset-1 ring-offset-background rounded-md"
: ""
@@ -207,7 +207,7 @@ function ProjectTilePicker({
key={swatch}
type="button"
onClick={() => onSelectColor(swatch)}
- className={`h-6 w-6 rounded-md cursor-pointer transition-[transform,box-shadow] duration-150 hover:scale-110 ${
+ className={`h-6 w-6 rounded-md cursor-pointer transition-(--tp-transform-box-shadow) duration-150 hover:scale-110 ${
swatch === color
? "ring-2 ring-foreground ring-offset-1 ring-offset-background"
: "hover:ring-2 hover:ring-foreground/30"
@@ -729,7 +729,7 @@ export function ProjectDetail() {
return (
<div className="space-y-6">
{showLeftProjectNotice ? (
- <div className="flex items-center gap-3 border border-yellow-300/35 bg-yellow-300/10 px-3 py-2 text-sm text-yellow-100">
+ <div className="flex items-center gap-3 border border-yellow-300/35 bg-yellow-300/10 px-3 py-2 text-sm text-yellow-900 dark:text-yellow-100">
<p className="min-w-0 flex-1">
You left this project. It no longer appears in your sidebar.
</p>
@@ -754,7 +754,7 @@ export function ProjectDetail() {
/>
<button
type="button"
- className="h-6 w-6 shrink-0 text-yellow-100/70 hover:text-yellow-100"
+ className="h-6 w-6 shrink-0 text-yellow-900/70 hover:text-yellow-900 dark:text-yellow-100/70 dark:hover:text-yellow-100"
aria-label="Dismiss project membership notice"
onClick={() => setDismissedLeftProjectIds((current) => new Set(current).add(project.id))}
>
@@ -779,14 +779,14 @@ export function ProjectDetail() {
className="text-xl font-bold"
/>
{project.pauseReason === "budget" ? (
- <div className="inline-flex items-center gap-2 rounded-full border border-red-500/30 bg-red-500/10 px-3 py-1 text-[11px] font-medium uppercase tracking-[0.18em] text-red-200">
+ <div className="inline-flex items-center gap-2 rounded-full border border-red-500/30 bg-red-500/10 px-3 py-1 text-(length:--text-micro) font-medium uppercase tracking-(--tracking-caps) text-red-800 dark:text-red-200">
<span className="h-2 w-2 rounded-full bg-red-400" />
Paused by budget hard stop
</div>
) : null}
{project.managedByPlugin ? (
- <div className="inline-flex items-center gap-2 rounded-full border border-border bg-muted px-3 py-1 text-[11px] font-medium text-muted-foreground">
- <span className="h-2 w-2 rounded-full" style={{ backgroundColor: project.color ?? "#6366f1" }} />
+ <div className="inline-flex items-center gap-2 rounded-full border border-border bg-muted px-3 py-1 text-(length:--text-micro) font-medium text-muted-foreground">
+ <span className="h-2 w-2 rounded-full" style={{ backgroundColor: project.color ?? "var(--project-seed)" }} />
Managed by {project.managedByPlugin.pluginDisplayName}
</div>
) : null}
diff --git a/ui/src/pages/ProjectWorkspaceDetail.tsx b/ui/src/pages/ProjectWorkspaceDetail.tsx
index 3695f59b22..754ad5ee7e 100644
--- a/ui/src/pages/ProjectWorkspaceDetail.tsx
+++ b/ui/src/pages/ProjectWorkspaceDetail.tsx
@@ -226,8 +226,8 @@ function Field({
return (
<label className="space-y-1.5">
<div className="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between sm:gap-3">
- <span className="text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground">{label}</span>
- {hint ? <span className="text-[11px] leading-relaxed text-muted-foreground sm:text-right">{hint}</span> : null}
+ <span className="text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">{label}</span>
+ {hint ? <span className="text-(length:--text-micro) leading-relaxed text-muted-foreground sm:text-right">{hint}</span> : null}
</div>
{children}
</label>
@@ -445,7 +445,7 @@ export function ProjectWorkspaceDetail() {
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div className="min-w-0 space-y-2">
- <div className="text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground">
+ <div className="text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
Project workspace
</div>
<h1 className="truncate text-xl font-semibold sm:text-2xl">{workspace.name}</h1>
@@ -480,7 +480,7 @@ export function ProjectWorkspaceDetail() {
</Tabs>
{activeTab === "configuration" ? (
- <div className="grid gap-6 lg:grid-cols-[minmax(0,1.4fr)_minmax(18rem,0.9fr)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-53)">
<div className="space-y-6">
<div className="rounded-2xl border border-border bg-card p-5">
<p className="max-w-2xl text-sm text-muted-foreground">
@@ -531,7 +531,7 @@ export function ProjectWorkspaceDetail() {
</select>
</Field>
- <div className="grid gap-4 md:grid-cols-[minmax(0,1fr)_auto]">
+ <div className="grid gap-4 md:grid-cols-(--gtc-13)">
<Field label="Local path">
<input
className="w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm outline-none"
@@ -665,7 +665,7 @@ export function ProjectWorkspaceDetail() {
<div className="space-y-6">
<div className="rounded-2xl border border-border bg-card p-5">
<div className="space-y-1">
- <div className="text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground">Workspace facts</div>
+ <div className="text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Workspace facts</div>
<h2 className="text-lg font-semibold">Current state</h2>
</div>
<Separator className="my-4" />
@@ -695,7 +695,7 @@ export function ProjectWorkspaceDetail() {
<div className="rounded-2xl border border-border bg-card p-5">
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1">
- <div className="text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground">Workspace commands</div>
+ <div className="text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-muted-foreground">Workspace commands</div>
<h2 className="text-lg font-semibold">Services and jobs</h2>
<p className="text-sm text-muted-foreground">
Long-running services stay supervised here, while one-shot jobs run on demand against this workspace. Execution workspaces inherit this config unless they override it.
diff --git a/ui/src/pages/ResponsibleUserDenialUxLab.tsx b/ui/src/pages/ResponsibleUserDenialUxLab.tsx
index d30abb9671..aa1cbb884b 100644
--- a/ui/src/pages/ResponsibleUserDenialUxLab.tsx
+++ b/ui/src/pages/ResponsibleUserDenialUxLab.tsx
@@ -31,7 +31,7 @@ function LabSection({
function BeforeAfter({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="space-y-2">
- <div className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{label}
</div>
<div className="rounded-xl border border-border/60 bg-card p-3">{children}</div>
@@ -58,7 +58,7 @@ function RunLedgerRow({
on behalf of <span className="text-foreground">{onBehalfOf}</span>
</span>
) : null}
- <span className="rounded-md border border-border px-1.5 py-0.5 text-[11px] capitalize text-muted-foreground">
+ <span className="rounded-md border border-border px-1.5 py-0.5 text-(length:--text-micro) capitalize text-muted-foreground">
{denial ? "Failed" : "Succeeded"}
</span>
<span className="ml-auto shrink-0">2m ago</span>
@@ -85,12 +85,12 @@ function RunDetailHeader({ onBehalfOf, denial }: { onBehalfOf?: string | null; d
<div className="space-y-2">
<div className="flex items-center gap-2">
<span className="text-lg font-semibold text-foreground">Run a1b2c3d4</span>
- <span className="rounded-md border border-border px-1.5 py-0.5 text-[11px] capitalize text-muted-foreground">
+ <span className="rounded-md border border-border px-1.5 py-0.5 text-(length:--text-micro) capitalize text-muted-foreground">
{denial ? "failed" : "succeeded"}
</span>
</div>
- <div className="flex flex-wrap items-center gap-1.5 font-mono text-[11px] text-muted-foreground">
- <span className="rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide">
+ <div className="flex flex-wrap items-center gap-1.5 font-mono text-(length:--text-micro) text-muted-foreground">
+ <span className="rounded bg-muted px-1.5 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide">
codex local
</span>
<span>anthropic/claude-opus-4-8</span>
@@ -110,7 +110,7 @@ export function ResponsibleUserDenialUxLab() {
<div className="min-h-screen bg-muted/20 p-6">
<div className="mx-auto max-w-5xl space-y-6">
<header>
- <div className="text-[11px] font-semibold uppercase tracking-[0.2em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
PAP-12462 · P7
</div>
<h1 className="mt-1 text-xl font-semibold text-foreground">
@@ -226,7 +226,7 @@ export function ResponsibleUserDenialUxLab() {
</BeforeAfter>
</LabSection>
- <p className={cn("text-center text-[11px] text-muted-foreground")}>
+ <p className={cn("text-center text-(length:--text-micro) text-muted-foreground")}>
Copy is sourced from the shared <code>describeResponsibleUserDenial</code> contract.
</p>
</div>
diff --git a/ui/src/pages/RoutineDetail.tsx b/ui/src/pages/RoutineDetail.tsx
index f84286778c..7acfac9c7a 100644
--- a/ui/src/pages/RoutineDetail.tsx
+++ b/ui/src/pages/RoutineDetail.tsx
@@ -807,7 +807,7 @@ export function RoutineDetail() {
<Badge variant="outline" className="hidden shrink-0 gap-1.5 text-xs text-muted-foreground sm:inline-flex">
<Sparkles className="h-3 w-3" />
{routine.managedByPlugin.pluginDisplayName}
- <span className="font-mono text-[10px]">{routine.managedByPlugin.resourceKey}</span>
+ <span className="font-mono text-(length:--text-nano)">{routine.managedByPlugin.resourceKey}</span>
</Badge>
) : null}
</div>
diff --git a/ui/src/pages/Routines.tsx b/ui/src/pages/Routines.tsx
index edac74328e..5805384502 100644
--- a/ui/src/pages/Routines.tsx
+++ b/ui/src/pages/Routines.tsx
@@ -622,11 +622,11 @@ export function Routines() {
>
<DialogContent
showCloseButton={false}
- className="flex max-h-[calc(100dvh-2rem)] max-w-3xl flex-col gap-0 overflow-hidden p-0"
+ className="flex max-h-(--sz-calc-18) max-w-3xl flex-col gap-0 overflow-hidden p-0"
>
<div className="shrink-0 flex flex-wrap items-center justify-between gap-3 border-b border-border/60 px-5 py-3">
<div>
- <p className="text-xs font-medium uppercase tracking-[0.2em] text-muted-foreground">New routine</p>
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">New routine</p>
<p className="text-sm text-muted-foreground">
Define the recurring work first. Default project and agent are optional for draft routines.
</p>
@@ -748,7 +748,7 @@ export function Routines() {
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: currentProject.color ?? "#64748b" }}
+ style={{ backgroundColor: currentProject.color ?? "var(--project-none)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -763,7 +763,7 @@ export function Routines() {
<>
<span
className="h-3.5 w-3.5 shrink-0 rounded-sm"
- style={{ backgroundColor: project?.color ?? "#64748b" }}
+ style={{ backgroundColor: project?.color ?? "var(--project-none)" }}
/>
<span className="truncate">{option.label}</span>
</>
@@ -781,7 +781,7 @@ export function Routines() {
onChange={(description) => setDraft((current) => ({ ...current, description }))}
placeholder="Add instructions..."
bordered={false}
- contentClassName="min-h-[160px] text-sm text-muted-foreground"
+ contentClassName="min-h-(--sz-160px) text-sm text-muted-foreground"
mentions={mentionOptions}
onSubmit={() => {
if (!createRoutine.isPending && draft.title.trim() && draft.projectId && draft.assigneeAgentId) {
@@ -803,7 +803,7 @@ export function Routines() {
<CollapsibleContent className="pt-3">
<div className="grid gap-4 md:grid-cols-2">
<div className="space-y-2">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">Concurrency</p>
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">Concurrency</p>
<Select
value={draft.concurrencyPolicy}
onValueChange={(concurrencyPolicy) => setDraft((current) => ({ ...current, concurrencyPolicy }))}
@@ -820,7 +820,7 @@ export function Routines() {
<p className="text-xs text-muted-foreground">{concurrencyPolicyDescriptions[draft.concurrencyPolicy]}</p>
</div>
<div className="space-y-2">
- <p className="text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground">Catch-up</p>
+ <p className="text-xs font-medium uppercase tracking-(--tracking-caps) text-muted-foreground">Catch-up</p>
<Select
value={draft.catchUpPolicy}
onValueChange={(catchUpPolicy) => setDraft((current) => ({ ...current, catchUpPolicy }))}
diff --git a/ui/src/pages/RunTranscriptUxLab.tsx b/ui/src/pages/RunTranscriptUxLab.tsx
index 80759cf9da..8eca63a04b 100644
--- a/ui/src/pages/RunTranscriptUxLab.tsx
+++ b/ui/src/pages/RunTranscriptUxLab.tsx
@@ -1,3 +1,7 @@
+// token-extraction: allowlisted — intentional one-off decoration (DECISION-SHEET.md B1
+// user ruling). The bg-[...gradient...] / shadow-[...] literals in this demo/UX-lab page
+// are deliberate one-off decoration, reverted from --gradient-extract-*/--shadow-extract-*
+// tokens; the file is on the check-token-gates allowlist in ui/src/index.css.
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
@@ -63,7 +67,7 @@ function RunDetailPreview({
<div className="overflow-hidden rounded-xl border border-border/70 bg-background/80 shadow-[0_24px_60px_rgba(15,23,42,0.08)]">
<div className="border-b border-border/60 bg-background/90 px-5 py-4">
<div className="flex flex-wrap items-center gap-2">
- <Badge variant="outline" className="uppercase tracking-[0.18em] text-[10px]">
+ <Badge variant="outline" className="uppercase tracking-(--tracking-caps) text-(length:--text-nano)">
Run Detail
</Badge>
<StatusBadge status={streaming ? "running" : "succeeded"} />
@@ -75,7 +79,7 @@ function RunDetailPreview({
Transcript ({runTranscriptFixtureEntries.length})
</div>
</div>
- <div className="max-h-[720px] overflow-y-auto bg-[radial-gradient(circle_at_top_left,rgba(8,145,178,0.08),transparent_36%),radial-gradient(circle_at_bottom_right,rgba(245,158,11,0.10),transparent_28%)] p-5">
+ <div className="max-h-(--sz-720px) overflow-y-auto bg-[radial-gradient(circle_at_top_left,rgba(8,145,178,0.08),transparent_36%),radial-gradient(circle_at_bottom_right,rgba(245,158,11,0.10),transparent_28%)] p-5">
<RunTranscriptView
entries={runTranscriptFixtureEntries}
mode={mode}
@@ -99,7 +103,7 @@ function LiveWidgetPreview({
return (
<div className="overflow-hidden rounded-xl border border-cyan-500/25 bg-background/85 shadow-[0_20px_50px_rgba(6,182,212,0.10)]">
<div className="border-b border-border/60 bg-cyan-500/[0.05] px-5 py-4">
- <div className="text-xs font-semibold uppercase tracking-[0.2em] text-cyan-700 dark:text-cyan-300">
+ <div className="text-xs font-semibold uppercase tracking-(--tracking-caps) text-cyan-700 dark:text-cyan-300">
Live Runs
</div>
<div className="mt-1 text-xs text-muted-foreground">
@@ -118,12 +122,12 @@ function LiveWidgetPreview({
<span>{formatDateTime(runTranscriptFixtureMeta.startedAt)}</span>
</div>
</div>
- <span className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 text-[11px] text-muted-foreground">
+ <span className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 text-(length:--text-micro) text-muted-foreground">
Open run
<ExternalLink className="h-3 w-3" />
</span>
</div>
- <div className="max-h-[460px] overflow-y-auto pr-1">
+ <div className="max-h-(--sz-460px) overflow-y-auto pr-1">
<RunTranscriptView
entries={previewEntries("live")}
mode={mode}
@@ -149,7 +153,7 @@ function DashboardPreview({
return (
<div className="max-w-md">
<div className={cn(
- "flex h-[320px] flex-col overflow-hidden rounded-xl border shadow-[0_20px_40px_rgba(15,23,42,0.10)]",
+ "flex h-(--sz-320px) flex-col overflow-hidden rounded-xl border shadow-[0_20px_40px_rgba(15,23,42,0.10)]",
streaming
? "border-cyan-500/25 bg-cyan-500/[0.04]"
: "border-border bg-background/75",
@@ -164,11 +168,11 @@ function DashboardPreview({
)} />
<Identity name={runTranscriptFixtureMeta.agentName} size="sm" />
</div>
- <div className="mt-2 text-[11px] text-muted-foreground">
+ <div className="mt-2 text-(length:--text-micro) text-muted-foreground">
{streaming ? "Live now" : "Finished 2m ago"}
</div>
</div>
- <span className="rounded-full border border-border/70 bg-background/70 px-2 py-1 text-[10px] text-muted-foreground">
+ <span className="rounded-full border border-border/70 bg-background/70 px-2 py-1 text-(length:--text-nano) text-muted-foreground">
<ExternalLink className="h-2.5 w-2.5" />
</span>
</div>
@@ -201,10 +205,10 @@ export function RunTranscriptUxLab() {
return (
<div className="space-y-6">
<div className="overflow-hidden rounded-2xl border border-border/70 bg-[linear-gradient(135deg,rgba(8,145,178,0.08),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.08),transparent_40%),var(--background)] shadow-[0_28px_70px_rgba(15,23,42,0.10)]">
- <div className="grid gap-6 lg:grid-cols-[260px_minmax(0,1fr)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-19)">
<aside className="border-b border-border/60 bg-background/75 p-5 lg:border-b-0 lg:border-r">
<div className="mb-5">
- <div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] text-cyan-700 dark:text-cyan-300">
+ <div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-cyan-700 dark:text-cyan-300">
<FlaskConical className="h-3.5 w-3.5" />
UX Lab
</div>
@@ -234,7 +238,7 @@ export function RunTranscriptUxLab() {
<Icon className="h-4 w-4" />
</span>
<span className="min-w-0">
- <span className="block text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <span className="block text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{option.eyebrow}
</span>
<span className="mt-1 block text-sm font-medium">{option.label}</span>
@@ -252,7 +256,7 @@ export function RunTranscriptUxLab() {
<main className="min-w-0 p-5">
<div className="mb-5 flex flex-col gap-4 xl:flex-row xl:items-end xl:justify-between">
<div>
- <div className="text-[11px] font-semibold uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{selected.eyebrow}
</div>
<h2 className="mt-1 text-2xl font-semibold">{selected.label}</h2>
@@ -262,17 +266,17 @@ export function RunTranscriptUxLab() {
</div>
<div className="flex flex-wrap items-center gap-2">
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
Source run {runTranscriptFixtureMeta.sourceRunId.slice(0, 8)}
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
{runTranscriptFixtureMeta.issueIdentifier}
</Badge>
</div>
</div>
<div className="mb-5 flex flex-wrap items-center gap-2">
- <span className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <span className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
Controls
</span>
<div className="inline-flex rounded-full border border-border/70 bg-background/80 p-1">
diff --git a/ui/src/pages/Search.tsx b/ui/src/pages/Search.tsx
index 0d39a26add..c0da109b1e 100644
--- a/ui/src/pages/Search.tsx
+++ b/ui/src/pages/Search.tsx
@@ -271,7 +271,7 @@ export function Search() {
function pill(value: number) {
if (!data) return null;
return (
- <Badge variant="outline" className="ml-1.5 px-1.5 py-0 text-[10px] tabular-nums font-normal">
+ <Badge variant="outline" className="ml-1.5 px-1.5 py-0 text-(length:--text-nano) tabular-nums font-normal">
{value}
</Badge>
);
@@ -362,7 +362,7 @@ export function Search() {
) : null}
<kbd
aria-hidden
- className="pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"
+ className="pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 rounded border border-border bg-muted px-1.5 py-0.5 text-(length:--text-nano) font-medium text-muted-foreground"
>
⌘K
</kbd>
@@ -461,7 +461,7 @@ function SearchTabContent({
</div>
{recentSearches.length > 0 ? (
<div>
- <div className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="mb-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Recent searches
</div>
<ul className="flex flex-col divide-y divide-border rounded-md border border-border">
@@ -483,7 +483,7 @@ function SearchTabContent({
<ul className="space-y-1 text-xs text-muted-foreground">
<li>
<span className="font-medium text-foreground">Identifier lookup:</span> type{" "}
- <code className="rounded bg-muted px-1 py-0.5 text-[11px]">PAP-123</code> to jump straight to a task.
+ <code className="rounded bg-muted px-1 py-0.5 text-(length:--text-micro)">PAP-123</code> to jump straight to a task.
</li>
<li>
<span className="font-medium text-foreground">Quoted phrases:</span> wrap a phrase in quotes to match the
@@ -581,8 +581,8 @@ function SearchTabContent({
if (!hasResults) return null;
return (
- <div className="flex w-full max-w-[960px] flex-col px-2 sm:px-4" data-testid="search-results">
- <div className="flex items-center justify-between py-2 text-[11px] uppercase tracking-wide text-muted-foreground">
+ <div className="flex w-full max-w-(--sz-960px) flex-col px-2 sm:px-4" data-testid="search-results">
+ <div className="flex items-center justify-between py-2 text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">
<span>
{totalResults === 1 ? "1 result" : `${totalResults} results`} · sorted by relevance
</span>
@@ -603,7 +603,7 @@ function SearchTabContent({
{group.results.length}
</span>
}
- className="pt-2 pb-1 text-[11px] tracking-wider text-muted-foreground"
+ className="pt-2 pb-1 text-(length:--text-micro) tracking-wider text-muted-foreground"
/>
<div className="flex flex-col gap-y-1">
{group.results.map((result) => (
diff --git a/ui/src/pages/Secrets.render.test.tsx b/ui/src/pages/Secrets.render.test.tsx
index fedc48e4da..b21c96d7bb 100644
--- a/ui/src/pages/Secrets.render.test.tsx
+++ b/ui/src/pages/Secrets.render.test.tsx
@@ -625,7 +625,9 @@ describe("Secrets page layout", () => {
expect(listContainer?.className).toContain("@container");
expect(tableView?.className).toContain("@min-[40rem]:block");
expect(tableView?.className).not.toContain("md:block");
- expect(tableView?.querySelector("[role='row']")?.className).toContain("minmax(12rem,2.4fr)");
+ // Grid template lives in the token layer: --gtc-54 in ui/src/index.css
+ // carries the original minmax(12rem,2.4fr)... template verbatim.
+ expect(tableView?.querySelector("[role='row']")?.className).toContain("grid-cols-(--gtc-54)");
expect(cardView?.className).toContain("@min-[40rem]:hidden");
expect(cardView?.className).not.toContain("md:hidden");
diff --git a/ui/src/pages/Secrets.tsx b/ui/src/pages/Secrets.tsx
index 0a9cf3ce47..fd37743609 100644
--- a/ui/src/pages/Secrets.tsx
+++ b/ui/src/pages/Secrets.tsx
@@ -332,7 +332,7 @@ function StatusBadge({ status }: { status: SecretStatus }) {
function MetaChip({ children }: { children: React.ReactNode }) {
return (
- <span className="inline-flex min-w-0 items-center gap-1 rounded-md border border-border bg-background px-2 py-0.5 text-[11px] text-muted-foreground">
+ <span className="inline-flex min-w-0 items-center gap-1 rounded-md border border-border bg-background px-2 py-0.5 text-(length:--text-micro) text-muted-foreground">
{children}
</span>
);
@@ -1523,7 +1523,7 @@ export function Secrets() {
>
<div
role="row"
- className="grid grid-cols-[minmax(12rem,2.4fr)_minmax(5.25rem,0.75fr)_minmax(7rem,1fr)_minmax(5rem,0.7fr)_2.75rem] items-center gap-3 bg-muted/40 px-3 py-2 text-xs uppercase tracking-wide text-muted-foreground"
+ className="grid grid-cols-(--gtc-54) items-center gap-3 bg-muted/40 px-3 py-2 text-xs uppercase tracking-wide text-muted-foreground"
>
<div role="columnheader" className="font-medium">Secret</div>
<div role="columnheader" className="font-medium">Status</div>
@@ -1548,7 +1548,7 @@ export function Secrets() {
key={row.id}
role="row"
className={cn(
- "grid cursor-pointer grid-cols-[minmax(12rem,2.4fr)_minmax(5.25rem,0.75fr)_minmax(7rem,1fr)_minmax(5rem,0.7fr)_2.75rem] items-center gap-3 border-b border-border/60 px-3 py-3 hover:bg-accent/40",
+ "grid cursor-pointer grid-cols-(--gtc-54) items-center gap-3 border-b border-border/60 px-3 py-3 hover:bg-accent/40",
row.kind === "company" && selectedSecretId === row.secret.id && "bg-accent/60",
row.kind === "user" && selectedDefinitionId === row.definition.id && "bg-accent/60",
)}
@@ -1582,7 +1582,7 @@ export function Secrets() {
</Tooltip>
)}
</div>
- <code className="mt-0.5 block truncate text-[11px] text-muted-foreground">
+ <code className="mt-0.5 block truncate text-(length:--text-micro) text-muted-foreground">
{row.kind === "company" ? row.secret.key : row.definition.key}
</code>
<div className="mt-1">
@@ -1641,7 +1641,7 @@ export function Secrets() {
<div className="truncate font-medium text-foreground">
{row.kind === "company" ? row.secret.name : row.definition.name}
</div>
- <code className="mt-0.5 block truncate text-[11px] text-muted-foreground">
+ <code className="mt-0.5 block truncate text-(length:--text-micro) text-muted-foreground">
{row.kind === "company" ? row.secret.key : row.definition.key}
</code>
</div>
@@ -2038,7 +2038,7 @@ export function Secrets() {
)}
<Dialog open={createOpen} onOpenChange={setCreateOpen}>
- <DialogContent className="max-h-[calc(100dvh-2rem)] overflow-y-auto p-4 sm:max-w-lg sm:p-6">
+ <DialogContent className="max-h-(--sz-calc-18) overflow-y-auto p-4 sm:max-w-lg sm:p-6">
<DialogHeader>
<DialogTitle>{editingDefinition ? "Edit user-provided secret" : "Create secret"}</DialogTitle>
<DialogDescription>
@@ -2083,7 +2083,7 @@ export function Secrets() {
disabled={Boolean(editingDefinition)}
className={secretValueProvider === "user" ? "font-mono text-sm" : undefined}
/>
- <p className="mt-1 text-[11px] text-muted-foreground">
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground">
{secretValueProvider === "user"
? editingDefinition
? "Stable env binding key. Cannot be changed."
@@ -2129,7 +2129,7 @@ export function Secrets() {
<TabsTrigger value="user">Each user</TabsTrigger>
</TabsList>
</Tabs>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Company stores one shared value. Each user lets every member supply their own value under My secrets.
</p>
</div>
@@ -2194,12 +2194,12 @@ export function Secrets() {
))}
</select>
{createProviderBlockReason ? (
- <p className="mt-1 flex items-center gap-1 text-[11px] text-destructive">
+ <p className="mt-1 flex items-center gap-1 text-(length:--text-micro) text-destructive">
<AlertCircle className="h-3 w-3" />
{createProviderBlockReason}
</p>
) : createProviderHealthText ? (
- <p className="mt-1 text-[11px] text-muted-foreground">{createProviderHealthText}</p>
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground">{createProviderHealthText}</p>
) : null}
</div>
<div>
@@ -2227,14 +2227,14 @@ export function Secrets() {
{selectedCreateProviderConfig ? (
<ProviderVaultInlineWarning config={selectedCreateProviderConfig} />
) : (
- <p className="mt-1 text-[11px] text-muted-foreground">
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground">
Existing deployment-level provider settings stay available for backwards compatibility.
</p>
)}
</div>
{createMode === "managed" ? (
<>
- <div className="rounded-md border border-emerald-500/30 bg-emerald-500/5 p-2 text-[11px] text-emerald-700 dark:text-emerald-300">
+ <div className="rounded-md border border-emerald-500/30 bg-emerald-500/5 p-2 text-(length:--text-micro) text-emerald-700 dark:text-emerald-300">
Paperclip-managed secrets are created in the selected provider and future rotations
write a new provider version through Paperclip.
{awsManagedPathPreview ? (
@@ -2272,7 +2272,7 @@ export function Secrets() {
placeholder="arn:aws:secretsmanager:..."
className="font-mono text-xs"
/>
- <p className="text-[11px] text-muted-foreground mt-1">
+ <p className="text-(length:--text-micro) text-muted-foreground mt-1">
Existing provider secrets are resolve-only in Paperclip. Rotate the value in the provider,
then update this reference only if the path, ARN, or version changes.
</p>
@@ -2281,7 +2281,7 @@ export function Secrets() {
</>
) : (
<>
- <div className="rounded-md border border-violet-500/30 bg-violet-500/5 p-2 text-[11px] text-violet-800 dark:text-violet-200">
+ <div className="rounded-md border border-violet-500/30 bg-violet-500/5 p-2 text-(length:--text-micro) text-violet-800 dark:text-violet-200">
Every member supplies their own value under My secrets. Agents resolve the responsible
user&apos;s value at runtime.
</div>
@@ -2296,7 +2296,7 @@ export function Secrets() {
setCreateForm((current) => ({ ...current, usageGuidance: event.target.value }))
}
placeholder="Tell members how to create their token, required scopes, etc."
- className="min-h-[70px] text-sm"
+ className="min-h-(--sz-70px) text-sm"
/>
</div>
</>
@@ -2335,7 +2335,7 @@ export function Secrets() {
</Dialog>
<Dialog open={vaultDialogOpen} onOpenChange={setVaultDialogOpen}>
- <DialogContent className="max-h-[85vh] overflow-y-auto sm:max-w-2xl">
+ <DialogContent className="max-h-(--sz-85vh) overflow-y-auto sm:max-w-2xl">
<DialogHeader>
<DialogTitle>{editingVault ? "Edit provider vault" : "Create provider vault"}</DialogTitle>
<DialogDescription>
@@ -2498,7 +2498,7 @@ export function Secrets() {
{selectedRotateProviderConfig ? (
<ProviderVaultInlineWarning config={selectedRotateProviderConfig} />
) : (
- <p className="mt-1 text-[11px] text-muted-foreground">
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground">
Rotating with the deployment default preserves current fallback behavior.
</p>
)}
@@ -2513,7 +2513,7 @@ export function Secrets() {
placeholder={selectedSecret.externalRef ?? "Updated reference"}
className="font-mono text-xs"
/>
- <p className="mt-1 text-[11px] text-muted-foreground">
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground">
Rotate the actual value in the provider before changing this Paperclip reference.
</p>
</div>
@@ -2708,7 +2708,7 @@ function SecretsFiltersPopover({
>
<Filter className="h-3.5 w-3.5" />
{activeFilterCount > 0 ? (
- <span className="absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-[9px] font-bold text-white">
+ <span className="absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-(length:--text-nano) font-bold text-white">
{activeFilterCount}
</span>
) : null}
@@ -2716,7 +2716,7 @@ function SecretsFiltersPopover({
</PopoverTrigger>
<PopoverContent
align="end"
- className="w-[min(520px,calc(100vw-2rem))] max-h-[min(80vh,34rem)] overflow-y-auto overscroll-contain p-0"
+ className="w-(--sz-calc-41) max-h-(--sz-calc-42) overflow-y-auto overscroll-contain p-0"
>
<div className="space-y-3 p-3">
<div className="flex items-center justify-between">
@@ -2831,14 +2831,14 @@ function ProviderVaultInlineWarning({ config }: { config: CompanySecretProviderC
const message = blockReason ?? config.healthMessage;
if (!message) {
return (
- <p className="mt-1 text-[11px] text-muted-foreground">
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground">
{config.isDefault ? "Default vault" : "Vault"} · {config.status.replace("_", " ")}
</p>
);
}
const warning = config.status === "warning" || config.healthStatus === "warning";
return (
- <p className={cn("mt-1 flex items-center gap-1 text-[11px]", warning ? "text-amber-600 dark:text-amber-400" : "text-destructive")}>
+ <p className={cn("mt-1 flex items-center gap-1 text-(length:--text-micro)", warning ? "text-amber-600 dark:text-amber-400" : "text-destructive")}>
{warning ? <AlertTriangle className="h-3 w-3" /> : <AlertCircle className="h-3 w-3" />}
{message}
</p>
@@ -3374,7 +3374,7 @@ function AwsProviderVaultDiscoveryError({
Copy
</Button>
</div>
- <pre className="max-h-36 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed">
+ <pre className="max-h-36 overflow-auto whitespace-pre-wrap break-words font-mono text-(length:--text-micro) leading-relaxed">
{detailsText}
</pre>
</div>
@@ -3411,7 +3411,7 @@ function AwsProviderVaultDiscoveryCandidateRow({
{fieldSummary.length > 0 ? fieldSummary.join(" / ") : "No stable namespace or prefix detected"}
</p>
{candidate.samples[0] ? (
- <p className="mt-1 truncate font-mono text-[11px] text-muted-foreground">
+ <p className="mt-1 truncate font-mono text-(length:--text-micro) text-muted-foreground">
{candidate.samples[0].name}
</p>
) : null}
@@ -3527,7 +3527,7 @@ function UserSecretDetailsTab({
<DetailRow label="Usage guidance">
{definition.usageGuidance ?? <span className="text-muted-foreground">—</span>}
</DetailRow>
- <div className="mt-3 rounded-md border border-violet-500/30 bg-violet-500/5 p-2 text-[11px] text-violet-800 dark:text-violet-200">
+ <div className="mt-3 rounded-md border border-violet-500/30 bg-violet-500/5 p-2 text-(length:--text-micro) text-violet-800 dark:text-violet-200">
No value is stored on this admin row. Each member manages their own value under My secrets.
</div>
</dl>
@@ -3597,7 +3597,7 @@ function UserSecretUsageTab({ definition }: { definition: UserSecretDefinition }
</div>
{definition.usageGuidance ? (
<div>
- <p className="mb-1 text-[11px] uppercase tracking-wide text-muted-foreground">Member guidance</p>
+ <p className="mb-1 text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">Member guidance</p>
<p className="text-foreground">{definition.usageGuidance}</p>
</div>
) : null}
@@ -3659,7 +3659,7 @@ function SecretDetailsTab({
<DetailRow label="Updated">{formatRelative(secret.updatedAt)}</DetailRow>
<DetailRow label="Last rotated">{formatRelative(secret.lastRotatedAt)}</DetailRow>
<DetailRow label="Last resolved">{formatRelative(secret.lastResolvedAt)}</DetailRow>
- <div className="mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 p-2 text-[11px] text-amber-700 dark:text-amber-300">
+ <div className="mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 p-2 text-(length:--text-micro) text-amber-700 dark:text-amber-300">
{modeDescription(secret.managedMode)} Paperclip never re-displays stored values.
</div>
</dl>
@@ -3668,8 +3668,8 @@ function SecretDetailsTab({
function DetailRow({ label, children }: { label: string; children: React.ReactNode }) {
return (
- <div className="grid grid-cols-[8rem_minmax(0,1fr)] gap-3 py-2">
- <dt className="text-[11px] uppercase tracking-wide text-muted-foreground">{label}</dt>
+ <div className="grid grid-cols-(--gtc-55) gap-3 py-2">
+ <dt className="text-(length:--text-micro) uppercase tracking-wide text-muted-foreground">{label}</dt>
<dd className="min-w-0 text-foreground">{children}</dd>
</div>
);
@@ -3706,15 +3706,15 @@ function SecretUsageTab({ loading, bindings }: { loading: boolean; bindings: Com
<span className="truncate font-medium">{binding.target.label}</span>
)}
{binding.target.status ? (
- <Badge variant="outline" className="h-5 px-1.5 text-[10px] font-normal">
+ <Badge variant="outline" className="h-5 px-1.5 text-(length:--text-nano) font-normal">
{binding.target.status.replaceAll("_", " ")}
</Badge>
) : null}
</div>
- <div className="font-mono text-[11px] text-muted-foreground break-all">
+ <div className="font-mono text-(length:--text-micro) text-muted-foreground break-all">
{binding.targetId}
</div>
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
{binding.configPath} {binding.required ? "· required" : "· optional"}
</div>
</div>
@@ -3771,30 +3771,30 @@ function SecretEventsTab({
{event.secretScope === "user" ? (
<Badge
variant="outline"
- className="border-violet-500/30 bg-violet-500/10 text-[10px] text-violet-700 dark:text-violet-300"
+ className="border-violet-500/30 bg-violet-500/10 text-(length:--text-nano) text-violet-700 dark:text-violet-300"
>
User secret
</Badge>
) : null}
</span>
- <span className="text-[11px] text-muted-foreground">{formatRelative(event.createdAt)}</span>
+ <span className="text-(length:--text-micro) text-muted-foreground">{formatRelative(event.createdAt)}</span>
</div>
- <div className="font-mono text-[11px] text-muted-foreground break-all">
+ <div className="font-mono text-(length:--text-micro) text-muted-foreground break-all">
{event.consumerId}
</div>
{event.responsibleUserId ? (
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
Responsible user: <span className="text-foreground">{userLabel(event.responsibleUserId)}</span>
</div>
) : null}
{event.credentialOwnerUserId &&
event.credentialOwnerUserId !== event.responsibleUserId ? (
- <div className="text-[11px] text-muted-foreground">
+ <div className="text-(length:--text-micro) text-muted-foreground">
Credential owner: <span className="text-foreground">{userLabel(event.credentialOwnerUserId)}</span>
</div>
) : null}
{event.errorCode ? (
- <div className="text-[11px] text-destructive">{event.errorCode}</div>
+ <div className="text-(length:--text-micro) text-destructive">{event.errorCode}</div>
) : null}
</div>
))}
diff --git a/ui/src/pages/SystemNoticeUxLab.tsx b/ui/src/pages/SystemNoticeUxLab.tsx
index 5bfe0e206d..00297a780f 100644
--- a/ui/src/pages/SystemNoticeUxLab.tsx
+++ b/ui/src/pages/SystemNoticeUxLab.tsx
@@ -1,3 +1,7 @@
+// token-extraction: allowlisted — intentional one-off decoration (DECISION-SHEET.md B1
+// user ruling). The bg-[...gradient...] / shadow-[...] literals in this demo/UX-lab page
+// are deliberate one-off decoration, reverted from --gradient-extract-*/--shadow-extract-*
+// tokens; the file is on the check-token-gates allowlist in ui/src/index.css.
import type { ReactNode } from "react";
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
@@ -32,13 +36,13 @@ function LabSection({
<section
id={id}
className={cn(
- "rounded-[28px] border border-border/70 bg-background/85 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.08)] sm:p-5",
+ "rounded-(--rad-28) border border-border/70 bg-background/85 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.08)] sm:p-5",
accentClassName,
)}
>
<div className="mb-4 flex flex-wrap items-start justify-between gap-3">
<div className="min-w-0">
- <div className="text-[11px] font-semibold uppercase tracking-[0.22em] text-muted-foreground">
+ <div className="text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
{eyebrow}
</div>
<h2 className="mt-1 text-xl font-semibold tracking-tight">{title}</h2>
@@ -53,7 +57,7 @@ function LabSection({
function FixtureFrame({ caption, children }: { caption: string; children: ReactNode }) {
return (
<div className="space-y-2">
- <div className="flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground">
+ <div className="flex items-center gap-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow) text-muted-foreground">
<CircleDashed className="h-3.5 w-3.5" />
{caption}
</div>
@@ -78,7 +82,7 @@ function MockUserBubble({
<AvatarFallback>{authorName.slice(0, 2).toUpperCase()}</AvatarFallback>
</Avatar>
) : null}
- <div className={cn("flex min-w-0 max-w-[85%] flex-col", alignEnd && "items-end")}>
+ <div className={cn("flex min-w-0 max-w-(--pct-85) flex-col", alignEnd && "items-end")}>
<div
className={cn(
"mb-1 px-1 text-sm font-medium text-foreground",
@@ -106,7 +110,7 @@ function MockAgentBubble({ agentName, body }: { agentName: string; body: string
<Avatar size="sm" className="shrink-0">
<AvatarFallback>{agentName.slice(0, 2).toUpperCase()}</AvatarFallback>
</Avatar>
- <div className="flex min-w-0 max-w-[85%] flex-col">
+ <div className="flex min-w-0 max-w-(--pct-85) flex-col">
<div className="mb-1 px-1 text-sm font-medium text-foreground">{agentName}</div>
<div className="min-w-0 max-w-full rounded-2xl border border-border/70 bg-background px-4 py-2.5 text-sm leading-6 text-foreground">
{body}
@@ -137,10 +141,10 @@ export function SystemNoticeUxLab() {
return (
<div className="space-y-6">
- <div className="overflow-hidden rounded-[32px] border border-border/70 bg-[linear-gradient(135deg,rgba(245,158,11,0.10),transparent_28%),linear-gradient(180deg,rgba(8,145,178,0.08),transparent_44%),var(--background)] shadow-[0_30px_80px_rgba(15,23,42,0.10)]">
- <div className="grid gap-6 lg:grid-cols-[minmax(0,1.2fr)_320px]">
+ <div className="overflow-hidden rounded-(--rad-32) border border-border/70 bg-[linear-gradient(135deg,rgba(245,158,11,0.10),transparent_28%),linear-gradient(180deg,rgba(8,145,178,0.08),transparent_44%),var(--background)] shadow-[0_30px_80px_rgba(15,23,42,0.10)]">
+ <div className="grid gap-6 lg:grid-cols-(--gtc-39)">
<div className="p-6 sm:p-7">
- <div className="inline-flex items-center gap-2 rounded-full border border-amber-500/25 bg-amber-500/[0.08] px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] text-amber-700 dark:text-amber-300">
+ <div className="inline-flex items-center gap-2 rounded-full border border-amber-500/25 bg-amber-500/[0.08] px-3 py-1 text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-amber-700 dark:text-amber-300">
<FlaskConical className="h-3.5 w-3.5" />
System Notice Lab
</div>
@@ -154,20 +158,20 @@ export function SystemNoticeUxLab() {
</p>
<div className="mt-5 flex flex-wrap items-center gap-2">
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
PAP-3525 plan
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
phase 1 — UX
</Badge>
- <Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
+ <Badge variant="outline" className="rounded-full px-3 py-1 text-(length:--text-nano) uppercase tracking-(--tracking-caps)">
tones: warning · danger · neutral
</Badge>
</div>
</div>
<aside className="border-t border-border/60 bg-background/70 p-6 lg:border-l lg:border-t-0">
- <div className="mb-4 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.2em] text-muted-foreground">
+ <div className="mb-4 flex items-center gap-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
<ListChecks className="h-4 w-4 text-amber-700 dark:text-amber-300" />
What this lab proves
</div>
@@ -293,7 +297,7 @@ export function SystemNoticeUxLab() {
<Avatar size="sm" className="shrink-0">
<AvatarFallback>YO</AvatarFallback>
</Avatar>
- <div className="flex min-w-0 max-w-[85%] flex-col">
+ <div className="flex min-w-0 max-w-(--pct-85) flex-col">
<div className="mb-1 px-1 text-sm font-medium text-foreground">You</div>
<div className="min-w-0 max-w-full rounded-2xl bg-muted px-4 py-2.5 text-sm leading-6 text-foreground">
<div className="rounded-md border border-red-500/35 bg-red-500/10 px-3 py-2.5 text-sm text-red-950 dark:text-red-100">
@@ -301,7 +305,7 @@ export function SystemNoticeUxLab() {
<Sparkles className="mt-1 h-4 w-4 shrink-0 text-red-600 dark:text-red-300" />
<div className="min-w-0">
<p className="m-0 font-semibold">Successful run handoff missing</p>
- <ul className="mt-1.5 list-disc space-y-0.5 pl-4 text-[13px] leading-5">
+ <ul className="mt-1.5 list-disc space-y-0.5 pl-4 text-(length:--text-compact) leading-5">
<li>Source issue: PAP-3440</li>
<li>Source run: 9cdba892-c7ca-4d93-8604-4843873b127c</li>
<li>Recovery run: 61fdb79b-8012-4676-ac71-2971830e126a</li>
@@ -344,7 +348,7 @@ export function SystemNoticeUxLab() {
<Card className="gap-4 border-border/70 bg-background/85 py-0">
<CardHeader className="px-5 pt-5 pb-0">
- <div className="flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
+ <div className="flex items-center gap-2 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground">
<Layers className="h-4 w-4 text-amber-700 dark:text-amber-300" />
Implementation notes
</div>
@@ -356,42 +360,42 @@ export function SystemNoticeUxLab() {
<CardContent className="space-y-3 px-5 pb-5 pt-0 text-sm text-muted-foreground">
<div className="rounded-2xl border border-border/70 bg-background/80 px-4 py-3">
<div className="mb-1 font-medium text-foreground">Component</div>
- Use <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">{`<SystemNotice />`}</code>{" "}
- from <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">@/components/SystemNotice</code>.
- It accepts <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">tone</code>,{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">label</code>,{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">body</code>,{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">metadata</code>, and{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">detailsDefaultOpen</code>.
+ Use <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">{`<SystemNotice />`}</code>{" "}
+ from <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">@/components/SystemNotice</code>.
+ It accepts <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">tone</code>,{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">label</code>,{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">body</code>,{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">metadata</code>, and{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">detailsDefaultOpen</code>.
</div>
<div className="rounded-2xl border border-border/70 bg-background/80 px-4 py-3">
<div className="mb-1 font-medium text-foreground">Routing in IssueChatThread</div>
Comments where{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">authorType === &quot;system&quot;</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">authorType === &quot;system&quot;</code>{" "}
or{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">presentation.kind === &quot;system_notice&quot;</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">presentation.kind === &quot;system_notice&quot;</code>{" "}
should render as a SystemNotice row at full content width — never inside an{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">IssueChatUserMessage</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">IssueChatUserMessage</code>{" "}
or assistant bubble.
</div>
<div className="rounded-2xl border border-border/70 bg-background/80 px-4 py-3">
<div className="mb-1 font-medium text-foreground">Accessibility</div>
The Details button has{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">aria-expanded</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">aria-expanded</code>{" "}
and{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">aria-controls</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">aria-controls</code>{" "}
wired to the panel id. The container exposes{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">role=&quot;status&quot;</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">role=&quot;status&quot;</code>{" "}
and an{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">aria-label</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">aria-label</code>{" "}
equal to the visible tone label so screen readers announce tone with text.
</div>
<div className="rounded-2xl border border-border/70 bg-background/80 px-4 py-3">
<div className="mb-1 font-medium text-foreground">Legacy fallback</div>
Existing comments without{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">presentation</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">presentation</code>{" "}
keep rendering through the current{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-[12px]">SuccessfulRunHandoffCommentCallout</code>{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">SuccessfulRunHandoffCommentCallout</code>{" "}
string-detector. The new contract is opt-in for the system generators in Phase 5.
</div>
</CardContent>
diff --git a/ui/src/pages/TeamCatalog.tsx b/ui/src/pages/TeamCatalog.tsx
index 70e71dde1d..329420604a 100644
--- a/ui/src/pages/TeamCatalog.tsx
+++ b/ui/src/pages/TeamCatalog.tsx
@@ -245,7 +245,7 @@ function TrustChip({ level, iconOnly = false }: { level: CatalogTeamTrustLevel;
<TooltipTrigger asChild>
<span
className={cn(
- "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[11px] font-medium",
+ "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
meta.tone,
)}
>
@@ -272,7 +272,7 @@ function CompatChip({ compatibility }: { compatibility: CatalogTeamCompatibility
return (
<span
className={cn(
- "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[11px] font-medium",
+ "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-(length:--text-micro) font-medium",
meta.tone,
)}
>
@@ -286,7 +286,7 @@ function ProvenanceBadge({ team }: { team: CatalogTeam }) {
return (
<Tooltip>
<TooltipTrigger asChild>
- <span className="inline-flex items-center gap-1 rounded-full border border-border px-1.5 py-0.5 text-[11px] text-muted-foreground">
+ <span className="inline-flex items-center gap-1 rounded-full border border-border px-1.5 py-0.5 text-(length:--text-micro) text-muted-foreground">
<Package className="h-3 w-3" />
{team.packageName}
{team.packageVersion ? `@${team.packageVersion}` : ""}
@@ -537,15 +537,15 @@ export function RequiredSkillsList({ skills }: { skills: CatalogTeamSkillRequire
>
<Boxes className="h-3.5 w-3.5 text-muted-foreground" />
<span className="font-mono text-xs">{skill.ref}</span>
- <Badge variant="outline" className="ml-auto text-[10px]">
+ <Badge variant="outline" className="ml-auto text-(length:--text-nano)">
{skill.type}
</Badge>
{skill.resolved ? (
- <Badge variant="outline" className="text-[10px] text-emerald-600 dark:text-emerald-300 border-emerald-500/30">
+ <Badge variant="outline" className="text-(length:--text-nano) text-emerald-600 dark:text-emerald-300 border-emerald-500/30">
resolved
</Badge>
) : (
- <Badge variant="outline" className="text-[10px] text-amber-600 dark:text-amber-300 border-amber-500/30">
+ <Badge variant="outline" className="text-(length:--text-nano) text-amber-600 dark:text-amber-300 border-amber-500/30">
external
</Badge>
)}
@@ -571,7 +571,7 @@ export function EnvInputsList({ inputs }: { inputs: CatalogTeamEnvInputSummary[]
<Badge
variant="outline"
className={cn(
- "ml-auto text-[10px]",
+ "ml-auto text-(length:--text-nano)",
input.kind === "secret"
? "text-rose-600 dark:text-rose-300 border-rose-500/30"
: "text-muted-foreground",
@@ -580,7 +580,7 @@ export function EnvInputsList({ inputs }: { inputs: CatalogTeamEnvInputSummary[]
{input.kind}
</Badge>
{input.requirement === "required" && (
- <Badge variant="outline" className="text-[10px]">required</Badge>
+ <Badge variant="outline" className="text-(length:--text-nano)">required</Badge>
)}
</li>
))}
@@ -618,7 +618,7 @@ export function ExternalSourcesList({ sources }: { sources: CatalogTeamSourceRef
<li key={`${source.type}:${source.ref}`} className="flex items-center gap-2 px-3 py-2 text-sm">
<Icon className="h-3.5 w-3.5 text-muted-foreground" />
<span className="font-mono text-xs truncate">{source.ref}</span>
- <span className="ml-auto text-[11px]">
+ <span className="ml-auto text-(length:--text-micro)">
{code === "ok" && (
<span className="text-emerald-600 dark:text-emerald-300">Pinned</span>
)}
@@ -697,7 +697,7 @@ export function TeamDetailPane({
<div className="min-w-0 space-y-1.5">
<h2 className="text-base font-semibold">{team.name}</h2>
<div className="flex flex-wrap items-center gap-1.5">
- <Badge variant={team.kind === "bundled" ? "secondary" : "outline"} className="text-[10px] capitalize">
+ <Badge variant={team.kind === "bundled" ? "secondary" : "outline"} className="text-(length:--text-nano) capitalize">
{team.kind}
</Badge>
<span className="text-xs text-muted-foreground">{team.category}</span>
@@ -705,14 +705,14 @@ export function TeamDetailPane({
<CompatChip compatibility={team.compatibility} />
<ProvenanceBadge team={team} />
{isInstalled && !outOfDate && (
- <Badge variant="secondary" className="gap-1 text-[10px]">
+ <Badge variant="secondary" className="gap-1 text-(length:--text-nano)">
<CheckCircle2 className="h-3 w-3" /> Installed
</Badge>
)}
{outOfDate && (
<Badge
variant="outline"
- className="gap-1 border-amber-500/40 bg-amber-500/10 text-[10px] text-amber-600 dark:text-amber-300"
+ className="gap-1 border-amber-500/40 bg-amber-500/10 text-(length:--text-nano) text-amber-600 dark:text-amber-300"
>
<ChevronUp className="h-3 w-3" /> Update available
</Badge>
@@ -770,7 +770,7 @@ export function TeamDetailPane({
<li key={slug} className="flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm">
<FolderKanban className="h-3.5 w-3.5 text-muted-foreground" />
<span>{titleCase(slug)}</span>
- <span className="ml-auto font-mono text-[11px] text-muted-foreground">{slug}</span>
+ <span className="ml-auto font-mono text-(length:--text-micro) text-muted-foreground">{slug}</span>
</li>
))}
</ul>
@@ -1235,7 +1235,7 @@ function TeamInstallerDialog({
const body = (
<>
{phase === "form" && (
- <div className="space-y-4 overflow-auto pr-1 md:max-h-[60vh]">
+ <div className="space-y-4 overflow-auto pr-1 md:max-h-(--sz-60vh)">
{currentStep === "target_manager" && (
<StepTargetManager
team={team}
@@ -1357,7 +1357,7 @@ function TeamInstallerDialog({
if (isMobileSheet) {
return (
<Sheet open={open} onOpenChange={(next) => { if (!next && dismissable) onClose(); }}>
- <SheetContent side="bottom" className="flex h-[100dvh] flex-col gap-0 p-0">
+ <SheetContent side="bottom" className="flex h-(--sz-100dvh) flex-col gap-0 p-0">
<SheetHeader className="border-b border-border">
<SheetTitle>{headerTitle}</SheetTitle>
{headerDescription && <SheetDescription>{headerDescription}</SheetDescription>}
@@ -1417,7 +1417,7 @@ export function StepTargetManager({
<li key={slug} className="flex items-center gap-2 border-b border-border/60 px-3 py-2 text-sm last:border-b-0">
<Crown className="h-3.5 w-3.5 text-amber-500" />
<span className="font-medium">{titleCase(slug)}</span>
- <span className="ml-auto rounded-full bg-amber-500/15 px-2 py-0.5 text-[11px] text-amber-600 dark:text-amber-300">
+ <span className="ml-auto rounded-full bg-amber-500/15 px-2 py-0.5 text-(length:--text-micro) text-amber-600 dark:text-amber-300">
→ ?
</span>
</li>
@@ -1498,7 +1498,7 @@ export function StepSourcePolicy({
<Icon className="h-3.5 w-3.5 text-muted-foreground" />
<div className="min-w-0">
<p className="font-mono text-xs truncate">{source.ref}</p>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
{code === "ok" && "pinned"}
{code === "unpinned" && "unpinned reference"}
{code === "unsupported_in_ui" && "not installable from the browser"}
@@ -1507,7 +1507,7 @@ export function StepSourcePolicy({
<Badge
variant="outline"
className={cn(
- "ml-auto text-[10px]",
+ "ml-auto text-(length:--text-nano)",
code === "unsupported_in_ui"
? "text-rose-600 dark:text-rose-300 border-rose-500/30"
: code === "unpinned"
@@ -1609,9 +1609,9 @@ export function StepSkillPlan({
<Boxes className="h-3.5 w-3.5 text-muted-foreground" />
<div className="min-w-0">
<p className="font-mono text-xs truncate">{prep.ref}</p>
- {prep.reason && <p className="text-[11px] text-muted-foreground">{prep.reason}</p>}
+ {prep.reason && <p className="text-(length:--text-micro) text-muted-foreground">{prep.reason}</p>}
</div>
- <Badge variant="outline" className={cn("ml-auto text-[10px]", meta.tone)}>
+ <Badge variant="outline" className={cn("ml-auto text-(length:--text-nano)", meta.tone)}>
{meta.label}
</Badge>
</li>
@@ -1666,7 +1666,7 @@ function PlanRow({
}) {
return (
<li className="flex items-center gap-2 px-3 py-2 text-sm">
- <Badge variant="outline" className={cn("text-[10px] uppercase", PLAN_ACTION_TONE[action] ?? "border-border")}>
+ <Badge variant="outline" className={cn("text-(length:--text-nano) uppercase", PLAN_ACTION_TONE[action] ?? "border-border")}>
{action}
</Badge>
<span className={cn("font-mono text-xs", action === "skip" && "line-through opacity-60")}>{slug}</span>
@@ -1675,12 +1675,12 @@ function PlanRow({
<Input
value={override ?? plannedName}
onChange={(e) => onRename(slug, e.target.value)}
- className="h-7 max-w-[14rem] font-mono text-xs"
+ className="h-7 max-w-(--sz-14rem) font-mono text-xs"
/>
) : (
<span className="font-mono text-xs">{plannedName}</span>
)}
- {reason && <span className="ml-auto text-[11px] text-muted-foreground">{reason}</span>}
+ {reason && <span className="ml-auto text-(length:--text-micro) text-muted-foreground">{reason}</span>}
</li>
);
}
@@ -1843,7 +1843,7 @@ export function StepPreview({
<li key={agent.slug} className="flex items-center gap-2 px-3 py-2 text-sm">
<Cpu className="h-3.5 w-3.5 text-muted-foreground" />
<span className="min-w-0 truncate">{agent.name}</span>
- <span className="font-mono text-[11px] text-muted-foreground">{agent.slug}</span>
+ <span className="font-mono text-(length:--text-micro) text-muted-foreground">{agent.slug}</span>
<Select value={selected} onValueChange={(v) => onAdapterChange(agent.slug, v)}>
<SelectTrigger className="ml-auto h-8 w-48">
<SelectValue />
@@ -1857,7 +1857,7 @@ export function StepPreview({
</li>
);
})}
- <li className="px-3 py-1.5 text-[11px] text-muted-foreground">
+ <li className="px-3 py-1.5 text-(length:--text-micro) text-muted-foreground">
Each imported agent defaults to its package adapter; override here before install.
Deeper per-adapter model config is editable on the agent after install.
</li>
@@ -1872,17 +1872,17 @@ export function StepPreview({
const visible = Boolean(visibleSecretKeys[formKey]);
const missingRequired = input.requirement === "required" && (secretValues[formKey] ?? "").trim().length === 0;
return (
- <li key={formKey} className="grid gap-2 px-3 py-2 text-sm sm:grid-cols-[minmax(0,1fr)_minmax(14rem,18rem)] sm:items-center">
+ <li key={formKey} className="grid gap-2 px-3 py-2 text-sm sm:grid-cols-(--gtc-56) sm:items-center">
<div className="flex min-w-0 items-center gap-2">
<KeyRound className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
<span className="font-mono text-xs uppercase tracking-wide">{input.key}</span>
{input.description && <span className="truncate text-xs text-muted-foreground">{input.description}</span>}
{input.requirement === "required" && (
- <Badge variant="outline" className="text-[10px]">required</Badge>
+ <Badge variant="outline" className="text-(length:--text-nano)">required</Badge>
)}
<Badge
variant="outline"
- className={cn("ml-auto text-[10px]", input.kind === "secret" ? "text-rose-600 dark:text-rose-300 border-rose-500/30" : "text-muted-foreground")}
+ className={cn("ml-auto text-(length:--text-nano)", input.kind === "secret" ? "text-rose-600 dark:text-rose-300 border-rose-500/30" : "text-muted-foreground")}
>
{input.kind}
</Badge>
@@ -2054,7 +2054,7 @@ export function TeamRow({
>
<div className="flex items-center gap-2">
<Users2 className={cn("h-3.5 w-3.5 text-muted-foreground", team.kind === "optional" && "opacity-70")} />
- <span className={cn("line-clamp-2 text-[13px] font-medium", selected && "text-foreground")}>
+ <span className={cn("line-clamp-2 text-(length:--text-compact) font-medium", selected && "text-foreground")}>
{team.name}
</span>
{outOfDate && (
@@ -2079,7 +2079,7 @@ export function TeamRow({
</Tooltip>
)}
</div>
- <div className="flex items-center gap-1.5 text-[11px] text-muted-foreground">
+ <div className="flex items-center gap-1.5 text-(length:--text-micro) text-muted-foreground">
<span>
{team.counts.agents}a · {team.counts.projects}p · {team.counts.routines}r · {skillCount(team)}s
</span>
@@ -2138,7 +2138,7 @@ export function TeamCard({
{team.tags.length > 0 && (
<div className="mt-auto flex flex-wrap gap-1">
{team.tags.map((tag) => (
- <Badge key={tag} variant="outline" className="text-[10px]">
+ <Badge key={tag} variant="outline" className="text-(length:--text-nano)">
{tag}
</Badge>
))}
@@ -2396,7 +2396,7 @@ export function TeamCatalog() {
{/* List column — full width on < lg, fixed rail on >= lg (design §11) */}
<div
className={cn(
- "w-full overflow-auto border-r border-border lg:w-[28rem] lg:shrink-0",
+ "w-full overflow-auto border-r border-border lg:w-(--sz-28rem) lg:shrink-0",
!isDesktop && selectedTeam && "hidden",
)}
>
@@ -2428,7 +2428,7 @@ export function TeamCatalog() {
<div>
{grouped.bundled.length > 0 && (
<>
- <div className="px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Bundled · {grouped.bundled.length}
</div>
{grouped.bundled.map((team) => (
@@ -2443,7 +2443,7 @@ export function TeamCatalog() {
)}
{grouped.optional.length > 0 && (
<>
- <div className="px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Optional · {grouped.optional.length}
</div>
{grouped.optional.map((team) => (
@@ -2458,7 +2458,7 @@ export function TeamCatalog() {
)}
{grouped.installed.length > 0 && (
<>
- <div className="px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <div className="px-3 py-2 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground">
Installed · {grouped.installed.length}
</div>
{grouped.installed.map((team) => (
diff --git a/ui/src/pages/Timeline.tsx b/ui/src/pages/Timeline.tsx
index f244bedc09..8183a34fbc 100644
--- a/ui/src/pages/Timeline.tsx
+++ b/ui/src/pages/Timeline.tsx
@@ -215,7 +215,7 @@ export function Timeline() {
setRangePreset("custom");
setDateRange((prev) => ({ ...prev, fromDate: event.target.value }));
}}
- className="h-8 w-[150px] text-xs"
+ className="h-8 w-(--sz-150px) text-xs"
aria-label="Timeline start date"
/>
<span>to</span>
@@ -226,7 +226,7 @@ export function Timeline() {
setRangePreset("custom");
setDateRange((prev) => ({ ...prev, toDate: event.target.value }));
}}
- className="h-8 w-[150px] text-xs"
+ className="h-8 w-(--sz-150px) text-xs"
aria-label="Timeline end date"
/>
</label>
diff --git a/ui/src/pages/UserProfile.tsx b/ui/src/pages/UserProfile.tsx
index fc6f12906a..260ae6b4e2 100644
--- a/ui/src/pages/UserProfile.tsx
+++ b/ui/src/pages/UserProfile.tsx
@@ -44,7 +44,7 @@ function HeroStat({ label, value, hint }: { label: string; value: string; hint?:
return (
<div className="min-w-0">
<div className="text-2xl font-semibold tabular-nums sm:text-3xl">{value}</div>
- <div className="mt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">{label}</div>
+ <div className="mt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">{label}</div>
{hint ? <div className="mt-0.5 text-xs text-muted-foreground/70">{hint}</div> : null}
</div>
);
@@ -55,8 +55,8 @@ function WindowColumn({ stats }: { stats: UserProfileWindowStats }) {
return (
<div className="flex min-w-0 flex-col gap-4 border-l border-border pl-5 first:border-l-0 first:pl-0">
<div className="flex items-baseline justify-between gap-3">
- <h2 className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">{stats.label}</h2>
- <span className="text-[11px] text-muted-foreground tabular-nums">{completionRate(stats)} done</span>
+ <h2 className="text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground">{stats.label}</h2>
+ <span className="text-(length:--text-micro) text-muted-foreground tabular-nums">{completionRate(stats)} done</span>
</div>
<div className="grid grid-cols-2 gap-x-5 gap-y-3">
@@ -84,7 +84,7 @@ function Metric({ value, label }: { value: string; label: string }) {
return (
<div className="min-w-0">
<div className="truncate text-xl font-semibold tabular-nums">{value}</div>
- <div className="mt-0.5 text-[11px] text-muted-foreground">{label}</div>
+ <div className="mt-0.5 text-(length:--text-micro) text-muted-foreground">{label}</div>
</div>
);
}
@@ -104,7 +104,7 @@ function UsageChart({ points }: { points: UserProfileDailyPoint[] }) {
<span>tokens total</span>
</div>
</div>
- <div className="mt-6 grid grid-cols-[repeat(14,minmax(0,1fr))] items-end gap-1.5 sm:gap-2">
+ <div className="mt-6 grid grid-cols-(--gtc-57) items-end gap-1.5 sm:gap-2">
{points.map((point) => {
const tokens = totalTokens(point);
const heightPct = tokens === 0 ? 0 : Math.max(2, Math.round((tokens / maxTokens) * 100));
@@ -128,19 +128,19 @@ function UsageChart({ points }: { points: UserProfileDailyPoint[] }) {
);
})}
</div>
- <div className="mt-2 grid grid-cols-[repeat(14,minmax(0,1fr))] gap-1.5 text-[10px] tabular-nums text-muted-foreground sm:gap-2">
+ <div className="mt-2 grid grid-cols-(--gtc-57) gap-1.5 text-(length:--text-nano) tabular-nums text-muted-foreground sm:gap-2">
{points.map((point, index) => (
<div key={point.date} className="text-center">
{index === 0 || index === 6 || index === 13 ? formatShortDate(point.date) : null}
</div>
))}
</div>
- <div className="mt-4 flex flex-wrap items-center gap-4 text-[10px] uppercase tracking-wide text-muted-foreground">
+ <div className="mt-4 flex flex-wrap items-center gap-4 text-(length:--text-nano) uppercase tracking-wide text-muted-foreground">
<span className="inline-flex items-center gap-1.5">
<span className="h-2 w-2 bg-foreground/80" /> tokens / day
</span>
<span className="inline-flex items-center gap-1.5">
- <span className="h-[3px] w-4 rounded-full bg-emerald-500/80" /> completions
+ <span className="h-(--sz-3px) w-4 rounded-full bg-emerald-500/80" /> completions
</span>
</div>
</section>
@@ -177,7 +177,7 @@ function UsageList({
) : (
<ul className="divide-y divide-border">
{rows.map((row) => (
- <li key={row.key} className="grid gap-2 py-2.5 sm:grid-cols-[1fr_auto] sm:items-center">
+ <li key={row.key} className="grid gap-2 py-2.5 sm:grid-cols-(--gtc-17) sm:items-center">
<div className="min-w-0">
<div className="truncate text-sm font-medium">{row.label}</div>
<div className="truncate text-xs text-muted-foreground">{row.sublabel}</div>
@@ -310,7 +310,7 @@ export function UserProfile() {
<li key={issue.id}>
<Link
to={issueUrl(issue)}
- className="grid gap-2 py-2.5 transition-colors hover:bg-accent/40 sm:grid-cols-[auto_1fr_auto] sm:items-center"
+ className="grid gap-2 py-2.5 transition-colors hover:bg-accent/40 sm:grid-cols-(--gtc-58) sm:items-center"
>
<span className="font-mono text-xs text-muted-foreground">{issue.identifier ?? issue.id.slice(0, 8)}</span>
<span className="truncate text-sm">{issue.title}</span>
@@ -335,7 +335,7 @@ export function UserProfile() {
) : (
<ul className="divide-y divide-border">
{data.recentActivity.map((event) => (
- <li key={event.id} className="grid gap-2 py-2.5 sm:grid-cols-[1fr_auto] sm:items-center">
+ <li key={event.id} className="grid gap-2 py-2.5 sm:grid-cols-(--gtc-17) sm:items-center">
<div className="min-w-0">
<div className="truncate text-sm">{event.action.replaceAll("_", " ")}</div>
<div className="truncate text-xs text-muted-foreground">
diff --git a/ui/src/pages/secrets/ImportFromVaultDialog.tsx b/ui/src/pages/secrets/ImportFromVaultDialog.tsx
index d9e768827b..473148855c 100644
--- a/ui/src/pages/secrets/ImportFromVaultDialog.tsx
+++ b/ui/src/pages/secrets/ImportFromVaultDialog.tsx
@@ -649,7 +649,7 @@ export function ImportFromVaultDialog({
>
<DialogContent
showCloseButton={false}
- className="flex max-h-[85vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl"
+ className="flex max-h-(--sz-85vh) flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl"
data-testid="import-from-vault-dialog"
>
<header className="flex items-start justify-between gap-3 border-b border-border/60 px-5 py-4">
@@ -796,7 +796,7 @@ function Stepper({ step }: { step: Step }) {
<span key={s.id} className="flex items-center gap-2">
<span
className={cn(
- "inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px]",
+ "inline-flex h-4 w-4 items-center justify-center rounded-full border text-(length:--text-nano)",
index === activeIndex
? "border-primary bg-primary text-primary-foreground"
: index < activeIndex
@@ -923,13 +923,13 @@ function SelectStep(props: SelectStepProps) {
<span className="flex items-center gap-2">
<span>{vault.displayName}</span>
{vault.isDefault && (
- <Badge variant="outline" className="px-1 py-0 text-[10px]">default</Badge>
+ <Badge variant="outline" className="px-1 py-0 text-(length:--text-nano)">default</Badge>
)}
{vault.status === "warning" && (
- <Badge variant="outline" className="px-1 py-0 text-[10px] text-amber-500 border-amber-500/40">warning</Badge>
+ <Badge variant="outline" className="px-1 py-0 text-(length:--text-nano) text-amber-500 border-amber-500/40">warning</Badge>
)}
{blocked && (
- <Badge variant="outline" className="px-1 py-0 text-[10px] text-muted-foreground">
+ <Badge variant="outline" className="px-1 py-0 text-(length:--text-nano) text-muted-foreground">
{vault.status === "coming_soon" ? "coming soon" : vault.status}
</Badge>
)}
@@ -1061,13 +1061,13 @@ function SelectStep(props: SelectStepProps) {
<StatusBadge status={candidate.status} />
{candidate.status === "duplicate" &&
candidate.conflicts.find((c) => c.type === "exact_reference")?.existingSecretId && (
- <span className="text-[11px] text-muted-foreground">
+ <span className="text-(length:--text-micro) text-muted-foreground">
Already imported
</span>
)}
</div>
{candidate.status === "conflict" && candidate.conflicts.length > 0 && (
- <div className="mt-0.5 text-[11px] text-amber-600 dark:text-amber-400">
+ <div className="mt-0.5 text-(length:--text-micro) text-amber-600 dark:text-amber-400">
{candidate.conflicts[0].message}
</div>
)}
@@ -1417,7 +1417,7 @@ function ResultGroup({
{row.reason && (
<span
className={cn(
- "max-w-[24rem] truncate",
+ "max-w-(--sz-24rem) truncate",
row.status === "error"
? "text-destructive"
: "text-muted-foreground",
diff --git a/ui/src/pages/secrets/MissingUserSecretsBanner.tsx b/ui/src/pages/secrets/MissingUserSecretsBanner.tsx
index 68ebfe8521..c5052bc7c9 100644
--- a/ui/src/pages/secrets/MissingUserSecretsBanner.tsx
+++ b/ui/src/pages/secrets/MissingUserSecretsBanner.tsx
@@ -73,7 +73,7 @@ export function MissingUserSecretsBanner({
>
<span className="min-w-0 truncate">
<span className="font-medium text-foreground">{entry.definition.name}</span>{" "}
- <code className="text-[11px] text-muted-foreground">{entry.definition.key}</code>
+ <code className="text-(length:--text-micro) text-muted-foreground">{entry.definition.key}</code>
</span>
<Button size="sm" onClick={() => setDialogFor(entry)}>
Set value
@@ -84,7 +84,7 @@ export function MissingUserSecretsBanner({
{secretsPath ? (
<Link
to={secretsPath}
- className="mt-2 inline-block text-[11px] font-medium underline underline-offset-2"
+ className="mt-2 inline-block text-(length:--text-micro) font-medium underline underline-offset-2"
>
Manage all my secrets
</Link>
diff --git a/ui/src/pages/secrets/MyUserSecretsTab.tsx b/ui/src/pages/secrets/MyUserSecretsTab.tsx
index e18802231c..aa85fa76a4 100644
--- a/ui/src/pages/secrets/MyUserSecretsTab.tsx
+++ b/ui/src/pages/secrets/MyUserSecretsTab.tsx
@@ -137,11 +137,11 @@ function MyUserSecretRow({
<div className="min-w-0 flex-1">
<div className="flex min-w-0 flex-wrap items-center gap-2">
<span className="font-medium text-foreground">{definition.name}</span>
- <code className="rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground">
+ <code className="rounded bg-muted px-1.5 py-0.5 text-(length:--text-micro) text-muted-foreground">
{definition.key}
</code>
{disabledDefinition ? (
- <Badge variant="outline" className="text-[10px]">
+ <Badge variant="outline" className="text-(length:--text-nano)">
{definition.status}
</Badge>
) : null}
@@ -150,12 +150,12 @@ function MyUserSecretRow({
<p className="mt-1 text-xs text-muted-foreground">{definition.description}</p>
) : null}
{definition.usageGuidance ? (
- <p className="mt-1 text-[11px] text-muted-foreground/80">{definition.usageGuidance}</p>
+ <p className="mt-1 text-(length:--text-micro) text-muted-foreground/80">{definition.usageGuidance}</p>
) : null}
</div>
<div className="flex shrink-0 items-center gap-2">
- <Badge variant="outline" className={cn("text-[11px]", myValueTone(state))}>
+ <Badge variant="outline" className={cn("text-(length:--text-micro)", myValueTone(state))}>
{myValueLabel(state)}
</Badge>
{!disabledDefinition ? (
diff --git a/ui/src/pages/secrets/SetMyUserSecretDialog.tsx b/ui/src/pages/secrets/SetMyUserSecretDialog.tsx
index 77a98f5d96..4f20f16992 100644
--- a/ui/src/pages/secrets/SetMyUserSecretDialog.tsx
+++ b/ui/src/pages/secrets/SetMyUserSecretDialog.tsx
@@ -135,7 +135,7 @@ export function SetMyUserSecretDialog({
className="font-mono text-sm"
autoFocus
/>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Points at your own credential in the configured provider. Paperclip stores the
reference, not the value.
</p>
@@ -147,10 +147,10 @@ export function SetMyUserSecretDialog({
value={value}
onChange={(event) => setValue(event.target.value)}
placeholder="Paste your token or credential"
- className="font-mono text-sm min-h-[80px]"
+ className="font-mono text-sm min-h-(--sz-80px)"
autoFocus
/>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Stored encrypted. Never shown back to anyone, including admins.
</p>
</div>
diff --git a/ui/src/pages/secrets/UserSecretDefinitionsTab.tsx b/ui/src/pages/secrets/UserSecretDefinitionsTab.tsx
index 4012995882..6051f78e4a 100644
--- a/ui/src/pages/secrets/UserSecretDefinitionsTab.tsx
+++ b/ui/src/pages/secrets/UserSecretDefinitionsTab.tsx
@@ -194,13 +194,13 @@ export function UserSecretDefinitionsTab({ companyId }: { companyId: string }) {
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-2">
<span className="font-medium text-foreground">{definition.name}</span>
- <code className="rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground">
+ <code className="rounded bg-muted px-1.5 py-0.5 text-(length:--text-micro) text-muted-foreground">
{definition.key}
</code>
<UserSecretChip />
<Badge
variant="outline"
- className={cn("text-[11px]", secretStatusTone(definition.status))}
+ className={cn("text-(length:--text-micro)", secretStatusTone(definition.status))}
>
{definition.status}
</Badge>
@@ -271,7 +271,7 @@ export function UserSecretDefinitionsTab({ companyId }: { companyId: string }) {
className="font-mono text-sm"
disabled={Boolean(editing)}
/>
- <p className="text-[11px] text-muted-foreground">
+ <p className="text-(length:--text-micro) text-muted-foreground">
Stable identifier referenced by env bindings. {editing ? "Cannot be changed." : ""}
</p>
</div>
@@ -295,7 +295,7 @@ export function UserSecretDefinitionsTab({ companyId }: { companyId: string }) {
setForm((current) => ({ ...current, usageGuidance: event.target.value }))
}
placeholder="Tell members how to create their token, required scopes, etc."
- className="min-h-[70px] text-sm"
+ className="min-h-(--sz-70px) text-sm"
/>
</div>
{editing ? (
@@ -375,7 +375,7 @@ function CoverageBadge({
const summary = coverageQuery.data;
const missing = summary ? summary.missingCount : 0;
return (
- <p className="mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground">
+ <p className="mt-1 inline-flex items-center gap-1 text-(length:--text-micro) text-muted-foreground">
<Users className="h-3 w-3" />
Coverage: {coverageSummaryLabel(summary)}
{summary && missing > 0 ? (
diff --git a/ui/src/pages/secrets/user-secret-presentation.tsx b/ui/src/pages/secrets/user-secret-presentation.tsx
index 3b51daf479..d6076ebf53 100644
--- a/ui/src/pages/secrets/user-secret-presentation.tsx
+++ b/ui/src/pages/secrets/user-secret-presentation.tsx
@@ -16,7 +16,7 @@ export function UserSecretChip({ className, label = "User secret" }: { className
return (
<span
className={cn(
- "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium",
+ "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-(length:--text-micro) font-medium",
USER_SECRET_ACCENT_BORDER,
USER_SECRET_ACCENT_BG,
USER_SECRET_ACCENT_TEXT,
diff --git a/ui/storybook/stories/document-comments.stories.tsx b/ui/storybook/stories/document-comments.stories.tsx
index 1ec929c26d..0e03550df2 100644
--- a/ui/storybook/stories/document-comments.stories.tsx
+++ b/ui/storybook/stories/document-comments.stories.tsx
@@ -102,7 +102,7 @@ function PanelFrame({
const qc = new QueryClient({ defaultOptions: { queries: { retry: false } } });
qc.setQueryData(queryKeys.auth.session, {
session: { id: "sess-1", userId: currentUserId },
- user: { id: currentUserId, email: "[email protected]", name: "Dotta", image: null },
+ user: { id: currentUserId, email: "[email protected]", name: "Dotta", image: null },
});
return qc;
});
diff --git a/ui/storybook/stories/navigation-layout.stories.tsx b/ui/storybook/stories/navigation-layout.stories.tsx
index 3b9ac4c098..c78bdfb879 100644
--- a/ui/storybook/stories/navigation-layout.stories.tsx
+++ b/ui/storybook/stories/navigation-layout.stories.tsx
@@ -335,6 +335,17 @@ function NavigationLayoutStories() {
const meta = {
title: "Product/Navigation & Layout",
component: NavigationLayoutStories,
+ // Sidebar mounts PluginLauncherOutlet unconditionally once a company is
+ // selected; without this provider the story raced company selection and
+ // intermittently threw "usePluginLauncherRuntime must be used within
+ // PluginLauncherProvider".
+ decorators: [
+ (Story) => (
+ <PluginLauncherProvider>
+ <Story />
+ </PluginLauncherProvider>
+ ),
+ ],
parameters: {
docs: {
description: {
diff --git a/ui/storybook/stories/primitives-coverage.stories.tsx b/ui/storybook/stories/primitives-coverage.stories.tsx
new file mode 100644
index 0000000000..f703bc6f80
--- /dev/null
+++ b/ui/storybook/stories/primitives-coverage.stories.tsx
@@ -0,0 +1,324 @@
+import type { Meta, StoryObj } from "@storybook/react-vite";
+import { FileText, FolderOpen, Settings, Users } from "lucide-react";
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "@/components/ui/alert-dialog";
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarGroup,
+ AvatarGroupCount,
+} from "@/components/ui/avatar";
+import {
+ Breadcrumb,
+ BreadcrumbEllipsis,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from "@/components/ui/breadcrumb";
+import { Button } from "@/components/ui/button";
+import {
+ Collapsible,
+ CollapsibleContent,
+ CollapsibleTrigger,
+} from "@/components/ui/collapsible";
+import {
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ CommandSeparator,
+ CommandShortcut,
+} from "@/components/ui/command";
+import {
+ DropdownMenu,
+ DropdownMenuCheckboxItem,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import { RadioCard, RadioCardGroup } from "@/components/ui/radio-card";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import {
+ Sheet,
+ SheetContent,
+ SheetDescription,
+ SheetFooter,
+ SheetHeader,
+ SheetTitle,
+} from "@/components/ui/sheet";
+import { Skeleton } from "@/components/ui/skeleton";
+
+/**
+ * Minimal coverage stories for the shared primitives in ui/src/components/ui/
+ * that no existing story renders directly (or that existing stories only
+ * reach behind a user interaction). Each story renders the primitive in a
+ * static, deterministic state so the visual snapshot suite baselines it.
+ */
+const meta = {
+ title: "Foundations/Primitive Coverage",
+ parameters: {
+ docs: {
+ description: {
+ component:
+ "Static snapshot coverage for shared ui/ primitives not exercised by existing stories: alert-dialog, avatar, breadcrumb, collapsible, command, dropdown-menu, radio-card, scroll-area, sheet, skeleton.",
+ },
+ },
+ },
+} satisfies Meta;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+function StoryFrame({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="paperclip-story">
+ <main className="paperclip-story__inner">
+ <section className="paperclip-story__frame p-6">{children}</section>
+ </main>
+ </div>
+ );
+}
+
+export const AvatarStates: Story = {
+ render: () => (
+ <StoryFrame>
+ <div className="flex items-center gap-6">
+ <Avatar>
+ <AvatarFallback>BO</AvatarFallback>
+ </Avatar>
+ <Avatar>
+ <AvatarFallback>
+ <Users />
+ </AvatarFallback>
+ </Avatar>
+ <AvatarGroup>
+ <Avatar>
+ <AvatarFallback>PL</AvatarFallback>
+ </Avatar>
+ <Avatar>
+ <AvatarFallback>QA</AvatarFallback>
+ </Avatar>
+ <AvatarGroupCount>+3</AvatarGroupCount>
+ </AvatarGroup>
+ </div>
+ </StoryFrame>
+ ),
+};
+
+export const BreadcrumbTrail: Story = {
+ render: () => (
+ <StoryFrame>
+ <Breadcrumb>
+ <BreadcrumbList>
+ <BreadcrumbItem>
+ <BreadcrumbLink href="#">Paperclip</BreadcrumbLink>
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <BreadcrumbEllipsis />
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <BreadcrumbLink href="#">Projects</BreadcrumbLink>
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <BreadcrumbPage>Control plane</BreadcrumbPage>
+ </BreadcrumbItem>
+ </BreadcrumbList>
+ </Breadcrumb>
+ </StoryFrame>
+ ),
+};
+
+export const CollapsibleOpenClosed: Story = {
+ render: () => (
+ <StoryFrame>
+ <div className="space-y-6">
+ <Collapsible open className="rounded-md border border-border p-3">
+ <CollapsibleTrigger className="text-sm font-medium">
+ Open section
+ </CollapsibleTrigger>
+ <CollapsibleContent className="pt-2 text-sm text-muted-foreground">
+ Visible collapsible content used for snapshot coverage.
+ </CollapsibleContent>
+ </Collapsible>
+ <Collapsible className="rounded-md border border-border p-3">
+ <CollapsibleTrigger className="text-sm font-medium">
+ Closed section
+ </CollapsibleTrigger>
+ <CollapsibleContent className="pt-2 text-sm text-muted-foreground">
+ Hidden content.
+ </CollapsibleContent>
+ </Collapsible>
+ </div>
+ </StoryFrame>
+ ),
+};
+
+export const CommandPaletteInline: Story = {
+ render: () => (
+ <StoryFrame>
+ <Command className="max-w-md rounded-lg border border-border shadow-md">
+ <CommandInput placeholder="Type a command or search…" />
+ <CommandList>
+ <CommandEmpty>No results found.</CommandEmpty>
+ <CommandGroup heading="Navigate">
+ <CommandItem>
+ <FolderOpen />
+ <span>Open project</span>
+ <CommandShortcut>⌘O</CommandShortcut>
+ </CommandItem>
+ <CommandItem>
+ <FileText />
+ <span>View tasks</span>
+ <CommandShortcut>⌘T</CommandShortcut>
+ </CommandItem>
+ </CommandGroup>
+ <CommandSeparator />
+ <CommandGroup heading="Settings">
+ <CommandItem>
+ <Settings />
+ <span>Instance settings</span>
+ </CommandItem>
+ </CommandGroup>
+ </CommandList>
+ </Command>
+ </StoryFrame>
+ ),
+};
+
+export const RadioCards: Story = {
+ render: () => (
+ <StoryFrame>
+ <div className="max-w-md space-y-6">
+ <RadioCardGroup
+ ariaLabel="Delivery mode"
+ value="draft"
+ onValueChange={() => {}}
+ options={[
+ {
+ value: "draft",
+ title: "Draft for review",
+ description: "The agent proposes; you approve before it ships.",
+ },
+ {
+ value: "auto",
+ title: "Deliver automatically",
+ description: "Finished work is delivered without a review gate.",
+ },
+ ]}
+ />
+ <RadioCard selected={false} title="Standalone card" description="Unselected state." />
+ </div>
+ </StoryFrame>
+ ),
+};
+
+export const ScrollAreaList: Story = {
+ render: () => (
+ <StoryFrame>
+ <ScrollArea className="h-40 w-64 rounded-md border border-border">
+ <div className="p-3">
+ {Array.from({ length: 12 }, (_, i) => (
+ <div key={i} className="py-1.5 text-sm">
+ Heartbeat run #{1200 + i}
+ </div>
+ ))}
+ </div>
+ </ScrollArea>
+ </StoryFrame>
+ ),
+};
+
+export const SkeletonLoading: Story = {
+ render: () => (
+ <StoryFrame>
+ <div className="max-w-sm space-y-3">
+ <Skeleton className="h-10 w-10 rounded-full" />
+ <Skeleton className="h-4 w-3/4" />
+ <Skeleton className="h-4 w-1/2" />
+ <Skeleton className="h-24 w-full" />
+ </div>
+ </StoryFrame>
+ ),
+};
+
+export const AlertDialogOpen: Story = {
+ render: () => (
+ <StoryFrame>
+ <AlertDialog open>
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle>Cancel this run?</AlertDialogTitle>
+ <AlertDialogDescription>
+ The agent will stop immediately and the task returns to the queue.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Keep running</AlertDialogCancel>
+ <AlertDialogAction>Cancel run</AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ </StoryFrame>
+ ),
+};
+
+export const DropdownMenuOpen: Story = {
+ render: () => (
+ <StoryFrame>
+ <div className="flex min-h-72 items-start">
+ <DropdownMenu open>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline">Task actions</Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start">
+ <DropdownMenuLabel>Actions</DropdownMenuLabel>
+ <DropdownMenuItem>Assign agent</DropdownMenuItem>
+ <DropdownMenuItem>Move to project</DropdownMenuItem>
+ <DropdownMenuCheckboxItem checked>Watch updates</DropdownMenuCheckboxItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem variant="destructive">Delete task</DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ </StoryFrame>
+ ),
+};
+
+export const SheetOpen: Story = {
+ render: () => (
+ <StoryFrame>
+ <Sheet open>
+ <SheetContent side="right">
+ <SheetHeader>
+ <SheetTitle>Run details</SheetTitle>
+ <SheetDescription>Inspect the run without leaving the board.</SheetDescription>
+ </SheetHeader>
+ <div className="px-4 text-sm text-muted-foreground">
+ Sheet body content for snapshot coverage.
+ </div>
+ <SheetFooter>
+ <Button>Done</Button>
+ </SheetFooter>
+ </SheetContent>
+ </Sheet>
+ </StoryFrame>
+ ),
+};
diff --git a/ui/storybook/stories/user-secrets.stories.tsx b/ui/storybook/stories/user-secrets.stories.tsx
index 72d95eccb2..2244ba4a20 100644
--- a/ui/storybook/stories/user-secrets.stories.tsx
+++ b/ui/storybook/stories/user-secrets.stories.tsx
@@ -124,7 +124,10 @@ function SeedFixtures({ children }: { children: ReactNode }) {
}, [selectedCompanyId, setSelectedCompanyId]);
if (selectedCompanyId !== COMPANY_ID) return null;
- return <MemoryRouter>{children}</MemoryRouter>;
+ // The preview decorator already provides a MemoryRouter; nesting a second
+ // react-router Router here raced it and intermittently threw
+ // "You cannot render a <Router> inside another <Router>".
+ return <>{children}</>;
}
function Section({ title, children }: { title: string; children: ReactNode }) {