Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
feat(ui): give model work its own accent instead of borrowing orange and green (#2016)
Raghav Chamadiyaf503f2b8baa9
diff --git a/packages/ui/src/chat/message-actions.tsx b/packages/ui/src/chat/message-actions.tsxindex a91f5c627..253f41ec5 100644--- a/packages/ui/src/chat/message-actions.tsx+++ b/packages/ui/src/chat/message-actions.tsx@@ -18,7 +18,7 @@ export function MessageActions({ message, onRetry, onEditAndResend, onFollowUp }if (message.isStreaming || !message.text) return null;if (editing) {- return <form className="mt-2 flex gap-2" onSubmit={(event) => { event.preventDefault(); const text = draft.trim(); if (text) void onEditAndResend?.(text); setEditing(false); }}><textarea autoFocus value={draft} onChange={(event) => setDraft(event.target.value)} aria-label="Edit message" className="min-h-20 flex-1 resize-y rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-2 text-sm text-[var(--color-text-primary)] outline-none focus:border-[var(--color-accent-primary)]" /><button type="submit" className="flex h-10 w-10 items-center justify-center rounded-md bg-[var(--color-accent-fill)] text-[var(--color-text-on-accent)]" aria-label="Fork and resend"><Send className="h-4 w-4" /></button></form>;+ return <form className="mt-2 flex gap-2" onSubmit={(event) => { event.preventDefault(); const text = draft.trim(); if (text) void onEditAndResend?.(text); setEditing(false); }}><textarea autoFocus value={draft} onChange={(event) => setDraft(event.target.value)} aria-label="Edit message" className="min-h-20 flex-1 resize-y rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-2 text-sm text-[var(--color-text-primary)] outline-none focus:border-[var(--color-accent-primary)]" /><button type="submit" className="flex h-10 w-10 items-center justify-center rounded-md bg-[var(--color-model)] text-[var(--color-text-on-model)]" aria-label="Fork and resend"><Send className="h-4 w-4" /></button></form>;}const actionClass = "inline-flex min-h-8 items-center gap-1 rounded-md px-1.5 text-[11px] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";diff --git a/packages/ui/src/health/ai-prompt-button.tsx b/packages/ui/src/health/ai-prompt-button.tsxindex 6680b7b5f..4f7c87e37 100644--- a/packages/ui/src/health/ai-prompt-button.tsx+++ b/packages/ui/src/health/ai-prompt-button.tsx@@ -29,7 +29,7 @@ export function AiPromptButton({className,}: AiPromptButtonProps) {const base =- "group/ai inline-flex items-center gap-1.5 rounded-md border border-[var(--color-success)]/40 bg-[var(--color-success)]/10 font-semibold text-[var(--color-success)] transition-colors hover:bg-[var(--color-success)]/20 hover:border-[var(--color-success)]/60";+ "group/ai inline-flex items-center gap-1.5 rounded-md border border-[var(--color-model)]/40 bg-[var(--color-model-muted)] font-semibold text-[var(--color-model)] transition-colors hover:bg-[var(--color-model)]/20 hover:border-[var(--color-model)]/60";if (variant === "icon") {return (<buttondiff --git a/packages/ui/src/health/ai-prompt-modal.tsx b/packages/ui/src/health/ai-prompt-modal.tsxindex d6ca656e5..4f248a945 100644--- a/packages/ui/src/health/ai-prompt-modal.tsx+++ b/packages/ui/src/health/ai-prompt-modal.tsx@@ -98,7 +98,7 @@ export function AiPromptModal({<DialogContent className="max-w-3xl"><DialogHeader><DialogTitle className="flex items-center gap-2">- <Sparkles className="h-4 w-4 text-[var(--color-accent-primary)]" />+ <Sparkles className="h-4 w-4 text-[var(--color-model)]" />{title}{filePath ? (<span className="ml-2 text-xs font-mono font-normal text-[var(--color-text-tertiary)] truncate max-w-[260px]">@@ -154,7 +154,7 @@ export function AiPromptModal({"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-semibold transition-colors " +(copied? "bg-[var(--color-success)] text-[var(--color-text-inverse)]"- : "bg-[var(--color-accent-primary)] text-[var(--color-bg-surface)] hover:opacity-90")+ : "bg-[var(--color-model)] text-[var(--color-text-on-model)] hover:bg-[var(--color-model-hover)]")}>{copied ? (diff --git a/packages/ui/src/health/coverage-view.tsx b/packages/ui/src/health/coverage-view.tsxindex 9c2985703..f9bcd5676 100644--- a/packages/ui/src/health/coverage-view.tsx+++ b/packages/ui/src/health/coverage-view.tsx@@ -365,7 +365,7 @@ function CoverageBody({});}}title="Generate AI test prompt for this file"- className="inline-flex items-center justify-center rounded-md p-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-success)] hover:bg-[var(--color-success)]/10 transition-colors"+ className="inline-flex items-center justify-center rounded-md p-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-model)] hover:bg-[var(--color-model-muted)] transition-colors"><Sparkles className="h-3.5 w-3.5" /></button>diff --git a/packages/ui/src/health/performance/drawer.tsx b/packages/ui/src/health/performance/drawer.tsxindex 2b8551a02..8b32bb012 100644--- a/packages/ui/src/health/performance/drawer.tsx+++ b/packages/ui/src/health/performance/drawer.tsx@@ -363,7 +363,7 @@ export function OpportunityDrawer({<buttontype="button"onClick={() => onAgentHandoff(current, plan.verified)}- className="inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-accent-fill)] px-3.5 py-2 text-sm font-semibold text-[var(--color-text-on-accent)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"+ className="inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-model)] px-3.5 py-2 text-sm font-semibold text-[var(--color-text-on-model)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><Sparkles className="h-4 w-4" aria-hidden="true" />{plan.verified ? "Copy the plan for an agent" : "Copy an agent handoff"}diff --git a/packages/ui/src/health/refactoring-card.tsx b/packages/ui/src/health/refactoring-card.tsxindex dfcec1045..ce38cd7d4 100644--- a/packages/ui/src/health/refactoring-card.tsx+++ b/packages/ui/src/health/refactoring-card.tsx@@ -216,7 +216,7 @@ export function HealthWorkItemCard({e.stopPropagation();onGeneratePrompt(target);}}- className="group/ai inline-flex items-center gap-1.5 rounded-md border border-[var(--color-success)]/40 bg-[var(--color-success)]/10 px-2.5 py-1 text-xs font-semibold text-[var(--color-success)] hover:bg-[var(--color-success)]/20 hover:border-[var(--color-success)]/60 transition-colors"+ className="group/ai inline-flex items-center gap-1.5 rounded-md border border-[var(--color-model)]/40 bg-[var(--color-model-muted)] px-2.5 py-1 text-xs font-semibold text-[var(--color-model)] hover:bg-[var(--color-model)]/20 hover:border-[var(--color-model)]/60 transition-colors"title="Generate a ready-to-paste prompt for an AI coding agent"><Sparkles className="h-3.5 w-3.5 transition-transform group-hover/ai:rotate-12" />diff --git a/packages/ui/src/jobs/generation-progress.tsx b/packages/ui/src/jobs/generation-progress.tsxindex f25303a90..079bf22d6 100644--- a/packages/ui/src/jobs/generation-progress.tsx+++ b/packages/ui/src/jobs/generation-progress.tsx@@ -88,7 +88,7 @@ export function GenerationProgress({return (<div className="space-y-3"><div className="flex items-center gap-2">- {isInflight && <Spinner className="text-[var(--color-accent-primary)]" />}+ {isInflight && <Spinner className="text-[var(--color-model)]" />}{isDone && <CheckCircle className="h-4 w-4 text-[var(--color-fresh)] shrink-0" />}{isFailed && <XCircle className="h-4 w-4 text-[var(--color-outdated)] shrink-0" />}{isCancelled && <Ban className="h-4 w-4 text-[var(--color-text-tertiary)] shrink-0" />}@@ -157,7 +157,7 @@ export function GenerationProgress({<div className="flex items-center gap-1.5 text-xs text-[var(--color-text-tertiary)]"><span>Cost: ${actualCost.toFixed(4)}</span>{isRunning && (- <span className="inline-flex items-center gap-0.5 rounded bg-[var(--color-accent-primary)]/15 px-1 py-px text-[10px] font-medium text-[var(--color-accent-primary)]">+ <span className="inline-flex items-center gap-0.5 rounded bg-[var(--color-model)]/15 px-1 py-px text-[10px] font-medium text-[var(--color-model)]"><ActivityDot className="h-1.5 w-1.5" />live</span>diff --git a/packages/ui/src/refactoring/generate-code-panel.tsx b/packages/ui/src/refactoring/generate-code-panel.tsxindex dd1fc3c73..a4ecfabe4 100644--- a/packages/ui/src/refactoring/generate-code-panel.tsx+++ b/packages/ui/src/refactoring/generate-code-panel.tsx@@ -66,7 +66,7 @@ export function GenerateCodePanel({ plan, onGenerate }: GenerateCodePanelProps)<buttontype="button"onClick={run}- className="inline-flex items-center gap-2 rounded-lg border border-[var(--color-accent-primary)]/40 bg-[var(--color-accent-muted)] px-3.5 py-2 text-sm font-semibold text-[var(--color-accent-primary)] transition-colors hover:bg-[var(--color-accent-primary)] hover:text-[var(--color-bg-surface)]"+ className="inline-flex items-center gap-2 rounded-lg border border-[var(--color-model)]/40 bg-[var(--color-model-muted)] px-3.5 py-2 text-sm font-semibold text-[var(--color-model)] transition-colors hover:bg-[var(--color-model)] hover:text-[var(--color-text-on-model)]"><Wand2 className="h-4 w-4" />Generate code@@ -77,7 +77,7 @@ export function GenerateCodePanel({ plan, onGenerate }: GenerateCodePanelProps)if (state.status === "loading") {return (<div className="flex items-center gap-2 text-sm text-[var(--color-text-secondary)]">- <Spinner className="text-[var(--color-accent-primary)]" />+ <Spinner className="text-[var(--color-model)]" />Generating the refactored code…</div>);@@ -93,7 +93,7 @@ export function GenerateCodePanel({ plan, onGenerate }: GenerateCodePanelProps)<buttontype="button"onClick={run}- className="inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs font-semibold text-[var(--color-accent-primary)] transition-colors hover:bg-[var(--color-accent-muted)]"+ className="inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs font-semibold text-[var(--color-model)] transition-colors hover:bg-[var(--color-model-muted)]"><RotateCw className="h-3.5 w-3.5" />Try again@@ -120,7 +120,7 @@ function GeneratedResult({{/* meta row — provider/model, cache, tokens, self-check verdict */}<div className="flex flex-wrap items-center gap-2"><span className="inline-flex items-center gap-1.5 rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 py-1 text-xs text-[var(--color-text-secondary)]">- <Sparkles className="h-3.5 w-3.5 text-[var(--color-accent-primary)]" />+ <Sparkles className="h-3.5 w-3.5 text-[var(--color-model)]" />{result.provider}{result.model ? <span className="text-[var(--color-text-tertiary)]">· {result.model}</span> : null}</span>diff --git a/packages/ui/src/refactoring/opportunity-drawer.tsx b/packages/ui/src/refactoring/opportunity-drawer.tsxindex 57c6315a2..3544634b9 100644--- a/packages/ui/src/refactoring/opportunity-drawer.tsx+++ b/packages/ui/src/refactoring/opportunity-drawer.tsx@@ -413,7 +413,7 @@ function DrawerBody({<buttontype="button"onClick={() => onAiPrompt(detail)}- className="inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-accent-fill)] px-3.5 py-2 text-sm font-semibold text-[var(--color-text-on-accent)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"+ className="inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-model)] px-3.5 py-2 text-sm font-semibold text-[var(--color-text-on-model)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><Sparkles className="h-4 w-4" aria-hidden="true" />Copy prompt for an agentdiff --git a/packages/ui/src/refactoring/refactoring-drawer.tsx b/packages/ui/src/refactoring/refactoring-drawer.tsxindex 6353906c6..6a6701f9c 100644--- a/packages/ui/src/refactoring/refactoring-drawer.tsx+++ b/packages/ui/src/refactoring/refactoring-drawer.tsx@@ -302,7 +302,7 @@ function DrawerBody({<buttontype="button"onClick={() => onAiPrompt(plan)}- className="inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-accent-fill)] px-3.5 py-2 text-sm font-semibold text-[var(--color-text-on-accent)] transition-opacity hover:opacity-90"+ className="inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--color-model)] px-3.5 py-2 text-sm font-semibold text-[var(--color-text-on-model)] transition-opacity hover:opacity-90"><Sparkles className="h-4 w-4" />Copy prompt for an agentdiff --git a/packages/ui/src/wiki/regenerate-button.tsx b/packages/ui/src/wiki/regenerate-button.tsxindex 98f3043b2..62f2628b2 100644--- a/packages/ui/src/wiki/regenerate-button.tsx+++ b/packages/ui/src/wiki/regenerate-button.tsx@@ -60,7 +60,7 @@ export function RegenerateButton({type="button"onClick={onRegenerate}disabled={isLoading || isInProgress}- className="inline-flex items-center gap-1 rounded-full border border-[var(--color-accent-primary)]/40 bg-[var(--color-accent-muted)] px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-[var(--color-accent-primary)] transition-colors hover:bg-[var(--color-accent-muted)] hover:text-[var(--color-accent-hover)] disabled:opacity-60"+ className="inline-flex items-center gap-1 rounded-full border border-[var(--color-model)]/40 bg-[var(--color-model-muted)] px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-[var(--color-model)] transition-colors hover:bg-[var(--color-model-muted)] hover:text-[var(--color-model-hover)] disabled:opacity-60"aria-label={isWrite ? "Write this page with AI" : "Regenerate this page"}>{isLoading ? (@@ -79,7 +79,7 @@ export function RegenerateButton({className={cn("h-7 gap-1.5 text-xs",isWrite &&- "border-[var(--color-accent-primary)]/40 bg-[var(--color-accent-muted)] text-[var(--color-accent-primary)] hover:bg-[var(--color-accent-muted)] hover:text-[var(--color-accent-hover)]",+ "border-[var(--color-model)]/40 bg-[var(--color-model-muted)] text-[var(--color-model)] hover:bg-[var(--color-model-muted)] hover:text-[var(--color-model-hover)]",)}aria-label={isWrite ? "Write this page with AI" : "Regenerate this page"}>@@ -89,7 +89,7 @@ export function RegenerateButton({<IconclassName={cn("h-3.5 w-3.5",- isWrite && "text-[var(--color-accent-primary)]",+ isWrite && "text-[var(--color-model)]",)}/>)}@@ -220,7 +220,7 @@ export function GenerateConfirmDialog({<DialogHeader><DialogTitle className="flex items-center gap-2">{isWrite && (- <Sparkles className="h-4 w-4 text-[var(--color-accent-primary)]" />+ <Sparkles className="h-4 w-4 text-[var(--color-model)]" />)}{heading}</DialogTitle>@@ -271,7 +271,7 @@ export function GenerateConfirmDialog({className={cn("flex cursor-pointer items-start gap-2.5 rounded-md border p-2.5 transition-colors",cascade === opt.value- ? "border-[var(--color-border-active)] bg-[var(--color-accent-muted)]"+ ? "border-[var(--color-model)]/70 bg-[var(--color-model-muted)]": "border-[var(--color-border-default)] hover:bg-[var(--color-bg-inset)]",)}>@@ -281,7 +281,7 @@ export function GenerateConfirmDialog({value={opt.value}checked={cascade === opt.value}onChange={() => onCascadeChange(opt.value)}- className="mt-0.5 accent-[var(--color-accent-fill)]"+ className="mt-0.5 accent-[var(--color-model)]"/><span className="min-w-0"><span className="block text-sm text-[var(--color-text-primary)]">diff --git a/packages/ui/styles/globals.css b/packages/ui/styles/globals.cssindex d07baa911..69b943821 100644--- a/packages/ui/styles/globals.css+++ b/packages/ui/styles/globals.css@@ -98,6 +98,22 @@--color-accent-muted: rgba(245, 149, 32, 0.12);--color-accent-secondary: #58436c;+ /* Model work — the plum accent doing one named job.+ `--color-accent-secondary` is also a qualitative chart slot (donut wedges,+ sigma edge kinds, the category ramp), so it is aliased here rather than+ used directly: a Generate button and a donut wedge should not be the same+ token even while they are the same hue, and this is the seam to split them+ at if the two ever need to diverge.++ Foreground is `--color-text-inverse`, NOT `--color-text-on-accent`. The+ latter is dark in both themes because it was tuned for the orange fill;+ on light-mode plum it lands at 1.92:1, a hard AA failure. `text-inverse`+ flips with the theme and clears AA on both (8.63:1 light, 6.81:1 dark). */+ --color-model: var(--color-accent-secondary);+ --color-text-on-model: var(--color-text-inverse);+ --color-model-hover: var(--color-plum-600);+ --color-model-muted: color-mix(in srgb, var(--color-accent-secondary) 14%, transparent);+/* Accent ramp — the one sanctioned way to colour a proportion: orderedshares of a whole (a stacked bar, a histogram, an area chart), steppedfrom the accent toward the page ground. Sequential, so position in the@@ -447,6 +463,10 @@--color-accent-hover: #f7a94d;--color-accent-muted: rgba(245, 149, 32, 0.16);--color-accent-secondary: #a98fc4;+ /* Plum is dark in light mode and light in dark mode, so its hover step has+ to move the opposite way. `model` and `model-muted` derive through var()+ and need no override; see the light block for the family. */+ --color-model-hover: var(--color-plum-200);/* Accent ramp — see the light block. Steeper here: mixing toward #0a0a0bloses luminance fast, so the same percentages would bottom out invisible. */diff --git a/packages/web/src/components/jobs/live-job-progress.tsx b/packages/web/src/components/jobs/live-job-progress.tsxindex 9c274e489..d19c6403d 100644--- a/packages/web/src/components/jobs/live-job-progress.tsx+++ b/packages/web/src/components/jobs/live-job-progress.tsx@@ -23,13 +23,13 @@ export function LiveJobProgress({const pct = total > 0 ? Math.round((completed / total) * 100) : 0;return (- <span className="inline-flex items-center gap-2 text-[var(--color-accent-primary)]">+ <span className="inline-flex items-center gap-2 text-[var(--color-model)]"><span className="tabular-nums">{completed}/{total} pages</span><span className="h-1 w-16 overflow-hidden rounded-full bg-[var(--color-bg-inset)]"><span- className="block h-full rounded-full bg-[var(--color-accent-primary)] transition-[width] duration-500"+ className="block h-full rounded-full bg-[var(--color-model)] transition-[width] duration-500"style={{ width: `${pct}%` }}/></span>diff --git a/packages/web/src/components/overview/ask-anything-row.tsx b/packages/web/src/components/overview/ask-anything-row.tsxindex d2d445cae..31ff0fbf4 100644--- a/packages/web/src/components/overview/ask-anything-row.tsx+++ b/packages/web/src/components/overview/ask-anything-row.tsx@@ -46,17 +46,19 @@ export function AskAnythingRow({ repoId }: { repoId: string }) {}}className="group relative flex items-center gap-2.5 overflow-hidden rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] py-2 pl-3.5 pr-2 transition-colors focus-within:border-[var(--color-border-hover)]">- {/* Ember rail on the leading edge — the same accent the Code Health- hero uses, at a quarter the width, so the two read as related- without competing. */}+ {/* Plum rail on the leading edge. This was the Code Health hero's+ ember, borrowed so the two read as related; the row is now on the+ model accent, and a warm rail under a plum icon and a plum submit+ would read as two systems arguing over one control. Same device,+ same quarter width, following the row's own meaning. */}<spanaria-hiddenclassName="absolute inset-y-0 left-0 w-[3px]"- style={{ background: "var(--gradient-ember)" }}+ style={{ background: "var(--gradient-plum)" }}/><Sparklesaria-hidden- className="h-3.5 w-3.5 shrink-0 text-[var(--color-accent-primary)] transition-transform group-focus-within:scale-110"+ className="h-3.5 w-3.5 shrink-0 text-[var(--color-model)] transition-transform group-focus-within:scale-110"/><label htmlFor="overview-ask" className="sr-only">Ask a question about this codebase@@ -71,7 +73,7 @@ export function AskAnythingRow({ repoId }: { repoId: string }) {<buttontype="submit"disabled={!question.trim()}- className="inline-flex shrink-0 items-center gap-1 rounded-md bg-[var(--color-accent-fill)] px-2.5 py-1 text-xs font-medium text-[var(--color-text-on-accent)] transition hover:bg-[var(--color-accent-fill-hover)] disabled:opacity-40"+ className="inline-flex shrink-0 items-center gap-1 rounded-md bg-[var(--color-model)] px-2.5 py-1 text-xs font-medium text-[var(--color-text-on-model)] transition hover:bg-[var(--color-model-hover)] disabled:opacity-40">Ask<ArrowRight className="h-3 w-3" />@@ -84,7 +86,7 @@ export function AskAnythingRow({ repoId }: { repoId: string }) {key={s}type="button"onClick={() => ask(s)}- className="rounded-full border border-[var(--color-border-default)] px-2.5 py-1 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-accent-primary)] hover:text-[var(--color-accent-primary)]"+ className="rounded-full border border-[var(--color-border-default)] px-2.5 py-1 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-model)] hover:text-[var(--color-model)]">{s}</button>