mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 20:46:28 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Its UI is the operator's daily surface: task lists, boards, budgets, agent status — all built on shadcn components and Tailwind > - Visual values (colors, spacing, type sizes, radii) were hardcoded at ~1,600 call sites: the same "small gray label" was 9/10/11px depending on the file, charts disagreed with chips about status colors, two toggle-switch implementations coexisted in two greens, and there was no visual regression coverage > - This made the UI drift-prone and made any restyle a hundreds-of-files project, which discourages design iteration > - This pull request extracts visual values into a single token layer in `ui/src/index.css`, adds a Storybook visual regression suite backed by external immutable baseline archives, and then applies a deliberate retune reviewed change-by-change on screenshot diffs > - The benefit is that Paperclip's look becomes a config surface: retheming is a token edit reviewed as a snapshot diff, drift is blocked by a token gate, and future UI PRs can prove exactly what changed visually without committing hundreds of PNGs ## Linked Issues or Issue Description No existing public issue covers this work (searched "design tokens", "visual regression", "design system" across issues and PRs). Related in spirit: Refs #8982 (theming a hardcoded panel — a one-off instance of the same problem class this PR addresses systematically). **Problem (feature-request form):** UI visual values are hardcoded per call site with no source of truth and no regression coverage; consistency depends on reviewer memory, and restyling requires mass file edits. **Proposed solution (this PR):** a single token layer + enforcement gate + externally stored visual snapshot suite, then an intentional restyle on top of that foundation. ## What Changed - **Token extraction (zero visual change, machine-verified during development):** committed codemods (`scripts/codemod-*.mjs`) moved ~1,600 hardcoded color/type/spacing/radius/shadow/misc values into named tokens in a non-inline `:root` block of `ui/src/index.css`. - **Visual regression suite:** `pnpm test:storybook-visual` covers 255 stories × light/dark = 510 Playwright screenshots at `maxDiffPixels: 0`, plus new primitive-coverage stories and deterministic-render fixes. - **External visual baselines:** committed PNG snapshots were removed. `tests/storybook-visual/baseline-manifest.json` pins an immutable archive URL/hash/size/count, and `scripts/storybook-visual-baseline.mjs` handles `download`, `verify`, `pack`, and trusted maintainer `upload` flows. - **Opt-in visual CI artifacts:** added a `Storybook Visual` workflow that runs on manual dispatch or PRs labeled `storybook-visual`, downloads/verifies the baseline, runs Playwright, and uploads Playwright report/test-result artifacts for review. Normal PR runs do not mutate baseline objects. - **Token gate:** `pnpm check:token-gates` — zero hex literals, zero arbitrary bracket values, zero raw font-sizes in `ui/src/components/**` and `ui/src/pages/**`, with a documented inline allowlist for legitimate opt-outs. - **Theme retune (intentional, snapshot-reviewed):** new base theme values; radius ladder derived from a single `--radius` knob; micro-type cluster collapsed to a named ladder (`--text-nano/micro/compact` + Tailwind `text-xs`/`text-sm`); letter-spacing collapsed to named steps. - **One status-color vocabulary:** charts, quota/budget bar fills, RUNNING/live chips, and liveness indicators all use the canonical `--status-*` hues. Light-mode legibility fixes for red alert surfaces that used dark-tuned text classes. - **One switch:** `ToggleSwitch` restyled to the registry capsule form, second hand-rolled implementation removed, and all call sites unified. - **Docs:** `DESIGN.md` is the design contract; `doc/design/` holds audit reports, decision logs, and updated guidance for external baseline review/update workflows. - Dead code removed (`agentStatusBadge` duplicate map), byte-identical contrast constants consolidated, semantic renames (`--project-seed`/`--project-none`, `--liveness-blue`). ## Verification - `pnpm check:token-gates` — 3/3 gates CLEAN during the design-system run - `pnpm typecheck` && `pnpm --filter @paperclipai/ui build` — green during the design-system run - `node --test scripts/__tests__/storybook-visual-baseline.test.mjs` — pass after external-baseline rework - `pnpm exec tsc --noEmit --pretty false --module NodeNext --moduleResolution NodeNext --target ES2022 --types node,@playwright/test tests/storybook-visual/playwright.config.ts tests/storybook-visual/storybook-visual.spec.ts` — pass after external-baseline rework - `git diff --check origin/pr/9134..HEAD` — pass after external-baseline rework - `find tests/storybook-visual -type f -name '*.png' -print | wc -l` — `0` - `node scripts/storybook-visual-baseline.mjs verify` — intentionally fails closed until the first trusted maintainer publishes the baseline archive and updates `baseline-manifest.json` ## Risks - **Large but shallow:** the PR still touches many UI files due to mechanical token extraction and retune work, but committed PNG snapshot churn has been removed from the branch. - **Baseline publication required before the visual suite can pass in clean clones:** the manifest currently has placeholder archive metadata. A trusted maintainer must publish the first immutable archive, then update `baseline-manifest.json`. - **Rendering platform variance:** the external baseline should be captured in the documented Linux/Chromium environment. Future CI runs verify against the pinned archive and fail closed on checksum/count mismatch. - **Visual CI is opt-in while stabilizing:** add the `storybook-visual` label or dispatch the workflow manually to produce downloadable Playwright report/test-result artifacts. - **Scheduled follow-ups, deliberately out of scope:** Tailwind palette classes map to semantic tokens in a dedicated pass; card/pill component consolidation; ESLint ratchet. Tracked in `doc/design/DECISION-SHEET.md`. ## Model Used Claude Fable 5 (Anthropic, `claude-fable-5`, Mythos-class tier) with extended thinking, running in Claude Code with tool use; mechanical phases delegated to Claude Sonnet subagents. Follow-up external-baseline rework assisted by OpenAI Codex (`gpt-5` coding agent with repository, terminal, and GitHub tool use). All bulk rewrites executed via deterministic, idempotent scripts committed in `scripts/`; intentional visual changes were human-reviewed on screenshot contact sheets. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run targeted local verification and documented the intentional baseline-publication failure above - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green *(pending new CI run after this rework)* - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups *(pending review)* - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) and OpenAI Codex --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Dotta <bippadotta@protonmail.com> Co-authored-by: Paperclip <noreply@paperclip.ing>
408 lines
19 KiB
TypeScript
408 lines
19 KiB
TypeScript
// 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";
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
|
import { SystemNotice } from "@/components/SystemNotice";
|
|
import { systemNoticeFixtures } from "@/fixtures/systemNoticeFixtures";
|
|
import { cn } from "@/lib/utils";
|
|
import {
|
|
CircleDashed,
|
|
FlaskConical,
|
|
Layers,
|
|
ListChecks,
|
|
Sparkles,
|
|
} from "lucide-react";
|
|
|
|
function LabSection({
|
|
id,
|
|
eyebrow,
|
|
title,
|
|
description,
|
|
accentClassName,
|
|
children,
|
|
}: {
|
|
id?: string;
|
|
eyebrow: string;
|
|
title: string;
|
|
description: string;
|
|
accentClassName?: string;
|
|
children: ReactNode;
|
|
}) {
|
|
return (
|
|
<section
|
|
id={id}
|
|
className={cn(
|
|
"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-(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>
|
|
<p className="mt-2 max-w-3xl text-sm text-muted-foreground">{description}</p>
|
|
</div>
|
|
</div>
|
|
{children}
|
|
</section>
|
|
);
|
|
}
|
|
|
|
function FixtureFrame({ caption, children }: { caption: string; children: ReactNode }) {
|
|
return (
|
|
<div className="space-y-2">
|
|
<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>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function MockUserBubble({
|
|
authorName,
|
|
body,
|
|
alignEnd,
|
|
}: {
|
|
authorName: string;
|
|
body: string;
|
|
alignEnd?: boolean;
|
|
}) {
|
|
return (
|
|
<div className={cn("flex items-start gap-2.5", alignEnd && "justify-end")}>
|
|
{!alignEnd ? (
|
|
<Avatar size="sm" className="shrink-0">
|
|
<AvatarFallback>{authorName.slice(0, 2).toUpperCase()}</AvatarFallback>
|
|
</Avatar>
|
|
) : null}
|
|
<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",
|
|
alignEnd ? "text-right" : "text-left",
|
|
)}
|
|
>
|
|
{authorName}
|
|
</div>
|
|
<div className="min-w-0 max-w-full rounded-2xl bg-muted px-4 py-2.5 text-sm leading-6 text-foreground">
|
|
{body}
|
|
</div>
|
|
</div>
|
|
{alignEnd ? (
|
|
<Avatar size="sm" className="shrink-0">
|
|
<AvatarFallback>{authorName.slice(0, 2).toUpperCase()}</AvatarFallback>
|
|
</Avatar>
|
|
) : null}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function MockAgentBubble({ agentName, body }: { agentName: string; body: string }) {
|
|
return (
|
|
<div className="flex items-start gap-2.5">
|
|
<Avatar size="sm" className="shrink-0">
|
|
<AvatarFallback>{agentName.slice(0, 2).toUpperCase()}</AvatarFallback>
|
|
</Avatar>
|
|
<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}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const checklist = [
|
|
"One container per system notice — no nested chat bubble",
|
|
"Tone communicated by icon + label, never color alone",
|
|
"Operational evidence hidden behind Details, expanded only on demand",
|
|
"Issue, agent, and run metadata render as typed link rows, not raw markdown",
|
|
"Hierarchy visibly distinct from user (right-aligned) and agent (left-aligned) bubbles",
|
|
];
|
|
|
|
export function SystemNoticeUxLab() {
|
|
const fixtureById = new Map(systemNoticeFixtures.map((f) => [f.id, f] as const));
|
|
|
|
const warningCollapsed = fixtureById.get("warning-collapsed")!;
|
|
const warningExpanded = fixtureById.get("warning-expanded")!;
|
|
const dangerCollapsed = fixtureById.get("danger-collapsed")!;
|
|
const dangerExpanded = fixtureById.get("danger-expanded")!;
|
|
const neutralCollapsed = fixtureById.get("neutral-collapsed")!;
|
|
const neutralExpanded = fixtureById.get("neutral-expanded")!;
|
|
const warningNoDetails = fixtureById.get("warning-no-details")!;
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
<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-(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>
|
|
<h1 className="mt-4 text-3xl font-semibold tracking-tight">
|
|
First-class system notice treatment
|
|
</h1>
|
|
<p className="mt-3 max-w-3xl text-sm leading-6 text-muted-foreground">
|
|
Replaces the current pattern where a Paperclip-authored warning renders inside a user-style
|
|
chat bubble. The notice is one container, system-styled, with hidden-by-default operational
|
|
metadata. Tone is conveyed by icon, label, and color together so it stays accessible.
|
|
</p>
|
|
|
|
<div className="mt-5 flex flex-wrap items-center gap-2">
|
|
<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-(length:--text-nano) uppercase tracking-(--tracking-caps)">
|
|
phase 1 — UX
|
|
</Badge>
|
|
<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-(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>
|
|
<div className="space-y-3">
|
|
{checklist.map((line) => (
|
|
<div
|
|
key={line}
|
|
className="rounded-2xl border border-border/70 bg-background/85 px-4 py-3 text-sm text-muted-foreground"
|
|
>
|
|
{line}
|
|
</div>
|
|
))}
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
</div>
|
|
|
|
<LabSection
|
|
id="tones"
|
|
eyebrow="Tone matrix"
|
|
title="Three tones, two states"
|
|
description="Each tone pairs a unique icon and tone label so the notice is recognizable without color. Collapsed is the default; the Details affordance reveals operational metadata only when reviewers ask for it."
|
|
accentClassName="bg-[linear-gradient(180deg,rgba(245,158,11,0.05),transparent_28%),var(--background)]"
|
|
>
|
|
<div className="space-y-5">
|
|
<FixtureFrame caption={warningCollapsed.caption}>
|
|
<SystemNotice {...warningCollapsed} />
|
|
</FixtureFrame>
|
|
<FixtureFrame caption={warningExpanded.caption}>
|
|
<SystemNotice {...warningExpanded} />
|
|
</FixtureFrame>
|
|
<FixtureFrame caption={dangerCollapsed.caption}>
|
|
<SystemNotice {...dangerCollapsed} />
|
|
</FixtureFrame>
|
|
<FixtureFrame caption={dangerExpanded.caption}>
|
|
<SystemNotice {...dangerExpanded} />
|
|
</FixtureFrame>
|
|
<FixtureFrame caption={neutralCollapsed.caption}>
|
|
<SystemNotice {...neutralCollapsed} />
|
|
</FixtureFrame>
|
|
<FixtureFrame caption={neutralExpanded.caption}>
|
|
<SystemNotice {...neutralExpanded} />
|
|
</FixtureFrame>
|
|
<FixtureFrame caption={warningNoDetails.caption}>
|
|
<SystemNotice {...warningNoDetails} />
|
|
</FixtureFrame>
|
|
</div>
|
|
</LabSection>
|
|
|
|
<LabSection
|
|
id="hierarchy"
|
|
eyebrow="Hierarchy in thread"
|
|
title="Distinct from user and agent comments"
|
|
description="Side-by-side with adjacent comment types so reviewers can confirm the system row reads as a system row — full width, no avatar gutter, no chat bubble — while user and agent comments keep their existing rounded bubbles."
|
|
accentClassName="bg-[linear-gradient(180deg,rgba(8,145,178,0.05),transparent_28%),var(--background)]"
|
|
>
|
|
<div className="space-y-4 rounded-2xl border border-border/70 bg-background/70 p-4">
|
|
<MockUserBubble
|
|
authorName="Riley Board"
|
|
body="Why does this issue keep waking back up without a clear next step?"
|
|
alignEnd
|
|
/>
|
|
<MockAgentBubble
|
|
agentName="CodexCoder"
|
|
body="The previous run completed without picking a disposition. I'll wait for the new system notice to surface so the recovery owner is unambiguous."
|
|
/>
|
|
<SystemNotice
|
|
tone="danger"
|
|
label="System alert"
|
|
source={{ label: "Paperclip", href: "/PAP/agents" }}
|
|
timestamp="2026-05-04T16:48:00.000Z"
|
|
body="Paperclip could not resolve this issue's missing disposition automatically. The issue is blocked on a recovery owner."
|
|
metadata={[
|
|
{
|
|
title: "Recovery owner",
|
|
rows: [
|
|
{
|
|
kind: "issue",
|
|
label: "Recovery issue",
|
|
identifier: "PAP-3440",
|
|
href: "/PAP/issues/PAP-3440",
|
|
title: "Successful run handoff missing disposition",
|
|
},
|
|
{
|
|
kind: "agent",
|
|
label: "Owner",
|
|
name: "CTO",
|
|
href: "/PAP/agents/cto",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: "Run evidence",
|
|
rows: [
|
|
{
|
|
kind: "run",
|
|
label: "Source run",
|
|
runId: "9cdba892-c7ca-4d93-8604-4843873b127c",
|
|
href: "/PAP/agents/codexcoder/runs/9cdba892-c7ca-4d93-8604-4843873b127c",
|
|
status: "succeeded",
|
|
},
|
|
],
|
|
},
|
|
]}
|
|
/>
|
|
<MockUserBubble
|
|
authorName="Riley Board"
|
|
body="Thanks — assigning the recovery owner now."
|
|
alignEnd
|
|
/>
|
|
</div>
|
|
</LabSection>
|
|
|
|
<div className="grid gap-5 xl:grid-cols-2">
|
|
<LabSection
|
|
eyebrow="Before"
|
|
title="Today's nested treatment"
|
|
description="The same content rendered through the existing user-bubble + warning-callout path. Two containers, same gray background as user comments, and the warning icon is forced inside a chat row."
|
|
accentClassName="bg-[linear-gradient(180deg,rgba(244,63,94,0.05),transparent_28%),var(--background)]"
|
|
>
|
|
<div className="space-y-3 rounded-2xl border border-border/70 bg-background/70 p-4">
|
|
<div className="flex items-start gap-2.5">
|
|
<Avatar size="sm" className="shrink-0">
|
|
<AvatarFallback>YO</AvatarFallback>
|
|
</Avatar>
|
|
<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">
|
|
<div className="flex items-start gap-2">
|
|
<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-(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>
|
|
<li>Status before: in_progress</li>
|
|
<li>Normalized cause: Run completed without disposition</li>
|
|
<li>Recovery owner: CTO</li>
|
|
<li>Suggested action: Reassign to recovery agent</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p className="px-1 text-xs text-muted-foreground">
|
|
Author reads as <span className="font-medium text-foreground">You</span> even though the
|
|
author is the Paperclip system. Two containers stack the warning inside a user-style
|
|
bubble, and operational evidence is always visible.
|
|
</p>
|
|
</div>
|
|
</LabSection>
|
|
|
|
<LabSection
|
|
eyebrow="After"
|
|
title="System notice replacement"
|
|
description="One container, system-authored label, hidden details. The chat surface keeps user and agent bubbles unchanged."
|
|
accentClassName="bg-[linear-gradient(180deg,rgba(16,185,129,0.05),transparent_28%),var(--background)]"
|
|
>
|
|
<div className="space-y-3 rounded-2xl border border-border/70 bg-background/70 p-4">
|
|
<SystemNotice {...dangerCollapsed} />
|
|
<p className="px-1 text-xs text-muted-foreground">
|
|
Same content. The visible body is one short system sentence; reviewers expand{" "}
|
|
<span className="font-medium text-foreground">Details</span> only when they need run
|
|
evidence. Tone is reinforced by the octagon icon and the "System alert" label,
|
|
not just red.
|
|
</p>
|
|
</div>
|
|
</LabSection>
|
|
</div>
|
|
|
|
<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-(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>
|
|
<CardTitle className="text-lg">Handoff to engineering</CardTitle>
|
|
<CardDescription>
|
|
What the Phase 4 UI implementation should preserve from this design.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<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-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-xs">authorType === "system"</code>{" "}
|
|
or{" "}
|
|
<code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">presentation.kind === "system_notice"</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-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-xs">aria-expanded</code>{" "}
|
|
and{" "}
|
|
<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-xs">role="status"</code>{" "}
|
|
and an{" "}
|
|
<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-xs">presentation</code>{" "}
|
|
keep rendering through the current{" "}
|
|
<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>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default SystemNoticeUxLab;
|