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
fix(ui): tell all-clear from not-yet, filtered and error on refactoring, impact, coupling, decisions and owners (#3310)
Raghav Chamadiya565791a90b86
diff --git a/packages/ui/__tests__/blast-radius/blast-radius.test.tsx b/packages/ui/__tests__/blast-radius/blast-radius.test.tsxindex 98cc4ef21..7980f5466 100644--- a/packages/ui/__tests__/blast-radius/blast-radius.test.tsx+++ b/packages/ui/__tests__/blast-radius/blast-radius.test.tsx@@ -248,7 +248,7 @@ describe("BlastRadiusResults", () => {overall_risk_score: 1.5,};render(<BlastRadiusResults result={empty} />);- expect(screen.getByText("No downstream impact found")).toBeTruthy();+ expect(screen.getByText("No downstream impact")).toBeTruthy();expect(screen.getByText("Localized structural impact")).toBeTruthy();});diff --git a/packages/ui/__tests__/coupling/coupling-graph.test.tsx b/packages/ui/__tests__/coupling/coupling-graph.test.tsxindex 111c2e806..0284ab404 100644--- a/packages/ui/__tests__/coupling/coupling-graph.test.tsx+++ b/packages/ui/__tests__/coupling/coupling-graph.test.tsx@@ -137,7 +137,12 @@ describe("CouplingTable", () => {});it("shows the empty state with no couplings", () => {- render(<CouplingTable edges={[]} />);+ render(<CouplingTable edges={[]} historyFiles={120} />);expect(screen.getByText(/no couplings detected/i)).toBeInTheDocument();});++ it("reads as not-yet without commit history", () => {+ render(<CouplingTable edges={[]} />);+ expect(screen.getByText(/no couplings yet/i)).toBeInTheDocument();+ });});diff --git a/packages/ui/__tests__/coupling/coupling-table.test.tsx b/packages/ui/__tests__/coupling/coupling-table.test.tsxindex 22dacce4d..4ea4c4496 100644--- a/packages/ui/__tests__/coupling/coupling-table.test.tsx+++ b/packages/ui/__tests__/coupling/coupling-table.test.tsx@@ -77,10 +77,16 @@ describe("CouplingTable (virtualized)", () => {});it("shows the empty state when there are no couplings", () => {- render(<CouplingTable edges={[]} />);+ render(<CouplingTable edges={[]} historyFiles={120} />);expect(screen.getByText(/no couplings detected/i)).toBeInTheDocument();});+ it("offers to clear filters when a filter emptied the list", () => {+ render(<CouplingTable edges={[]} filtered onClearFilters={() => {}} />);+ expect(screen.getByText(/no couplings match/i)).toBeInTheDocument();+ expect(screen.getByRole("button", { name: /clear filters/i })).toBeInTheDocument();+ });+it("keeps per-row actions out of the table", () => {// The AI prompt lives in the pair panel, where it can carry a label.render(<CouplingTable edges={[edge("a.py", "b.py")]} hasDetails />);@@ -181,6 +187,6 @@ describe("CouplingTable together column", () => {const { container } = render(<CouplingTable edges={[edge("a.py", "b.py", 4)]} pinnedPath="b.py" />,);- expect(container.querySelector("tr.bg-\\[var\\(--color-accent-muted\\)\\]\\/30")).not.toBeNull();+ expect(container.querySelector("tr.bg-\\[var\\(--color-bg-selected\\)\\]")).not.toBeNull();});});diff --git a/packages/ui/__tests__/decisions/decisions-table.test.tsx b/packages/ui/__tests__/decisions/decisions-table.test.tsxindex cff35ad00..a5e406935 100644--- a/packages/ui/__tests__/decisions/decisions-table.test.tsx+++ b/packages/ui/__tests__/decisions/decisions-table.test.tsx@@ -281,6 +281,6 @@ describe("DecisionsTable", () => {it("renders an empty-state message when there are no decisions and no error", () => {render(<DecisionsTable {...baseProps} decisions={[]} />);- expect(screen.getByText("No decisions found")).toBeInTheDocument();+ expect(screen.getByText("No decisions yet")).toBeInTheDocument();});});diff --git a/packages/ui/__tests__/refactoring/refactoring-board-scope.test.tsx b/packages/ui/__tests__/refactoring/refactoring-board-scope.test.tsxindex 260fca5c4..b5ab5c9a2 100644--- a/packages/ui/__tests__/refactoring/refactoring-board-scope.test.tsx+++ b/packages/ui/__tests__/refactoring/refactoring-board-scope.test.tsx@@ -114,3 +114,36 @@ describe("RefactoringBoard without a host scope", () => {expect(screen.queryByText(/more in the full inventory/)).toBeNull();});});++describe("RefactoringBoard empty states", () => {+ const clear = { ...state, scope: "all" as const, appliedScope: "all" as const, hidden: null, total: 0 };++ it("reads as an all-clear when the analysis ran and found nothing", () => {+ render(+ <RefactoringBoard+ opportunities={[]}+ showLede={false}+ summary={{ status: "available", opportunities_total: 0 } as never}+ serverState={clear}+ onServerStateChange={vi.fn()}+ />,+ );+ expect(screen.getByText("No refactoring targets")).toBeTruthy();+ });++ it("offers Clear filters when a search hides everything", () => {+ const onChange = vi.fn();+ render(+ <RefactoringBoard+ opportunities={[]}+ showLede={false}+ summary={{ status: "available", opportunities_total: 5 } as never}+ serverState={{ ...clear, query: "zzz" }}+ onServerStateChange={onChange}+ />,+ );+ expect(screen.getByText("No opportunities match these filters")).toBeTruthy();+ fireEvent.click(screen.getAllByRole("button", { name: "Clear filters" })[0]!);+ expect(onChange).toHaveBeenCalled();+ });+});diff --git a/packages/ui/src/blast-radius/blast-radius-results.tsx b/packages/ui/src/blast-radius/blast-radius-results.tsxindex 85ca1eab9..65889a970 100644--- a/packages/ui/src/blast-radius/blast-radius-results.tsx+++ b/packages/ui/src/blast-radius/blast-radius-results.tsx@@ -47,54 +47,63 @@ export function BlastRadiusResults({? "Test analysis is partial; available recommendations do not cover every evidence input.": null;+ const noDownstream =+ result.direct_risks.length === 0 && result.transitive_affected.length === 0;+return (<div className="space-y-6"><BlastRadiusHeader result={result} changedFiles={changedFiles} />- {/* One picture: changed files → direct → transitive. */}- <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4">- <p className="mb-2 text-xs font-medium uppercase tracking-wider text-[var(--color-text-tertiary)]">- Impact map- </p>- {result.direct_risks.length === 0 &&- result.transitive_affected.length === 0 ? (- <EmptyState- title="No downstream impact found"- description="No files depend on the changed paths within the selected depth."- />- ) : (+ {noDownstream ? (+ <EmptyState+ tone="positive"+ title="No downstream impact"+ description="No other file depends on the changed paths within the selected depth."+ />+ ) : (+ /* One picture: changed files → direct → transitive. */+ <div>+ <p className="mb-2 text-xs font-medium uppercase tracking-wider text-[var(--color-text-tertiary)]">+ Impact map+ </p><ImpactGraph result={result} changedFiles={changedFiles} />- )}- </div>+ </div>+ )}+ {!noDownstream && (<CollapsibleSection- title="Direct risks"- hint={result.direct_risks.length || undefined}- defaultOpen={result.direct_risks.length > 0}- >- {result.direct_risks.length > 0 ? (- <DirectRisksTable rows={result.direct_risks} />- ) : (- <EmptyState- title="No direct risks"- description="Nothing depends directly on the changed files."- />- )}- </CollapsibleSection>+ title="Direct risks"+ hint={result.direct_risks.length || undefined}+ defaultOpen={result.direct_risks.length > 0}+ >+ {result.direct_risks.length > 0 ? (+ <DirectRisksTable rows={result.direct_risks} />+ ) : (+ <EmptyState+ size="compact"+ title="No direct risks"+ description="Nothing depends directly on the changed files."+ />+ )}+ </CollapsibleSection>+ )}+ {!noDownstream && (<CollapsibleSection- title="Transitive affected files"- hint={result.transitive_affected.length || undefined}- >- {result.transitive_affected.length > 0 ? (- <TransitiveTable rows={result.transitive_affected} />- ) : (- <EmptyState- title="No transitive impact"- description="No deeper dependents within the selected depth."- />- )}- </CollapsibleSection>+ title="Transitive affected files"+ hint={result.transitive_affected.length || undefined}+ >+ {result.transitive_affected.length > 0 ? (+ <TransitiveTable rows={result.transitive_affected} />+ ) : (+ <EmptyState+ size="compact"+ title="No transitive impact"+ description="No deeper dependents within the selected depth."+ />+ )}+ </CollapsibleSection>+ )}<CollapsibleSectiontitle="Co-change warnings"@@ -104,6 +113,7 @@ export function BlastRadiusResults({<CochangeTable rows={result.cochange_warnings} />) : (<EmptyState+ size="compact"title="No co-change warnings"description="No historical co-change partners are missing from this change."/>@@ -119,6 +129,7 @@ export function BlastRadiusResults({<ReviewersTable rows={result.recommended_reviewers} />) : (<EmptyState+ size="compact"title="No reviewer suggestions"description="No owners matched the changed files."/>@@ -164,6 +175,7 @@ export function BlastRadiusResults({</div>) : (<EmptyState+ size="compact"title={testAnalysisLimited? "Test analysis limited"@@ -186,6 +198,7 @@ export function BlastRadiusResults({<TestGapsList gaps={result.test_gaps} />) : (<EmptyState+ size="compact"title="No file-level gaps identified"description={testAnalysisLimiteddiff --git a/packages/ui/src/coupling/coupling-explorer.tsx b/packages/ui/src/coupling/coupling-explorer.tsxindex 4521d2cda..deab7e89a 100644--- a/packages/ui/src/coupling/coupling-explorer.tsx+++ b/packages/ui/src/coupling/coupling-explorer.tsx@@ -379,7 +379,7 @@ export function CouplingExplorer({className={cn("h-8 shrink-0 whitespace-nowrap border-r border-[var(--color-border-default)] px-2.5 text-xs last:border-r-0",selected- ? "bg-[var(--color-accent-muted)]/40 font-medium text-[var(--color-text-primary)]"+ ? "bg-[var(--color-bg-selected)] font-medium text-[var(--color-text-primary)] shadow-[inset_0_-2px_0_var(--color-accent-primary)]": "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)]",)}>@@ -459,6 +459,12 @@ export function CouplingExplorer({}moduleFor={moduleFor}hasDetails+ historyFiles={data.total_files}+ filtered={edges.length > 0}+ onClearFilters={() => {+ setQuery("");+ setSegment("all");+ }}linkForPath={linkForPath}LinkComponent={LinkComponent}/>diff --git a/packages/ui/src/coupling/coupling-table.tsx b/packages/ui/src/coupling/coupling-table.tsxindex f64ce61f4..857de610b 100644--- a/packages/ui/src/coupling/coupling-table.tsx+++ b/packages/ui/src/coupling/coupling-table.tsx@@ -54,6 +54,11 @@ interface CouplingTableProps {LinkComponent?: LinkLike | undefined;/** DOM id for the table wrapper, so the diagram can name it as its equivalent. */id?: string;+ /** Files with commit history. Zero or absent reads as not-yet, not as an all-clear. */+ historyFiles?: number | undefined;+ /** The empty list comes from a search or segment, not from the repo. */+ filtered?: boolean;+ onClearFilters?: () => void;}type SortKey = "strength" | "last" | "together";@@ -103,6 +108,9 @@ export function CouplingTable({linkForPath,LinkComponent,id,+ historyFiles,+ filtered,+ onClearFilters,}: CouplingTableProps) {const [sortKey, setSortKey] = useState<SortKey>("together");const [sortDir, setSortDir] = useState<SortDir>("desc");@@ -185,10 +193,28 @@ export function CouplingTable({};if (edges.length === 0) {+ if (filtered) {+ return (+ <EmptyState+ tone="filtered"+ title="No couplings match these filters"+ {...(onClearFilters ? { action: { label: "Clear filters", onClick: onClearFilters } } : {})}+ />+ );+ }+ if (historyFiles && historyFiles > 0) {+ return (+ <EmptyState+ tone="positive"+ title="No couplings detected"+ description={`No files change together often enough to flag, across ${historyFiles.toLocaleString()} files with commit history.`}+ />+ );+ }return (<EmptyState- title="No couplings detected"- description="No files in this repository have a history of changing together yet."+ title="No couplings yet"+ description="Couplings come from commit history. Index a repository with git history to see which files change together."/>);}@@ -206,7 +232,7 @@ export function CouplingTable({{fileCell(e.target, e, "↔ ")}{/* Lead with the claim, not the score: what the two shares actuallysay about this pair, and whether the graph explains it. */}- <p className="mt-0.5 text-[11px] leading-snug text-[var(--color-text-tertiary)]">+ <p className="mt-0.5 text-xs leading-snug text-[var(--color-text-tertiary)]">{couplingClaim(e, labelFor)}</p></div>@@ -357,7 +383,7 @@ export function CouplingTable({rowClassName={(e) =>isSamePair(e, pinnedPair) ||(pinnedPath != null && (pinnedPath === e.source || pinnedPath === e.target))- ? "bg-[var(--color-accent-muted)]/30"+ ? "bg-[var(--color-bg-selected)]": undefined}{...(rowClick ? { onRowClick: rowClick } : {})}diff --git a/packages/ui/src/decisions/checkout-facts.tsx b/packages/ui/src/decisions/checkout-facts.tsxindex 52caf0e56..27da4f113 100644--- a/packages/ui/src/decisions/checkout-facts.tsx+++ b/packages/ui/src/decisions/checkout-facts.tsx@@ -1,4 +1,5 @@import type { EpisodeSummary } from "@repowise-dev/types/episodes";+import { EmptyState } from "../shared/empty-state";/*** Facts about the checkout itself, as opposed to claims somebody made about@@ -61,11 +62,17 @@ export interface CheckoutFactsProps {export function CheckoutFacts({ facts, available, total }: CheckoutFactsProps) {if (facts.length === 0) {- return (+ return available ? (+ <EmptyState+ tone="positive"+ title="Nothing unusual about this checkout"+ description="Facts appear here when the tree drifts from what its own tooling expects, such as an unformatted tree or an editable install shadowing an installed command."+ />+ ) : (<p className="text-sm text-[var(--color-text-secondary)]">- {available- ? "Nothing unusual about this checkout. Facts appear here when the tree drifts from what its own tooling expects, such as an unformatted tree or an editable install shadowing an installed command."- : "Nothing to show for this checkout right now. Facts land here once an index has looked: an unformatted tree, an editable install shadowing an installed command, or a walk that stops at a nested repository."}+ Nothing to show for this checkout right now. Facts land here once an index has looked: an+ unformatted tree, an editable install shadowing an installed command, or a walk that stops+ at a nested repository.</p>);}@@ -110,7 +117,7 @@ export function CheckoutFacts({ facts, available, total }: CheckoutFactsProps) {))}</ul>{shared && (- <p className="mt-1.5 text-[11px] text-[var(--color-text-tertiary)]">+ <p className="mt-1.5 text-xs text-[var(--color-text-tertiary)]">{shared}</p>)}@@ -146,7 +153,7 @@ function FactRow({{fact.evidence}</p>{shown > 0 && (- <p className="mt-0.5 font-mono text-[11px] text-[var(--color-text-tertiary)] break-all">+ <p className="mt-0.5 font-mono text-xs text-[var(--color-text-tertiary)] break-all">{fact.nodes.join(", ")}{hidden > 0 && (<span className="tabular-nums"> and {hidden} more</span>@@ -158,7 +165,7 @@ function FactRow({for free would read as a doubt about the fact rather than about thecheck. */}{fact.still_true && !hideVerdict && (- <p className="mt-0.5 text-[11px] text-[var(--color-text-tertiary)]">+ <p className="mt-0.5 text-xs text-[var(--color-text-tertiary)]">{fact.still_true}</p>)}diff --git a/packages/ui/src/decisions/decision-evidence-drawer.tsx b/packages/ui/src/decisions/decision-evidence-drawer.tsxindex c74501ab4..dc6bc8383 100644--- a/packages/ui/src/decisions/decision-evidence-drawer.tsx+++ b/packages/ui/src/decisions/decision-evidence-drawer.tsx@@ -59,7 +59,7 @@ export function DecisionEvidenceDrawer({><header className="flex items-start justify-between gap-3 border-b border-[var(--color-border-default)] px-4 py-3"><div className="min-w-0">- <p className="text-[10px] uppercase tracking-wider text-[var(--color-text-tertiary)]">+ <p className="text-caption uppercase tracking-wider text-[var(--color-text-tertiary)]">Evidence</p><DialogPrimitive.Title className="mt-0.5 break-words text-sm font-medium leading-snug text-[var(--color-text-primary)]">@@ -114,20 +114,20 @@ function EvidenceRow({ row, isPrimary }: { row: DecisionEvidence; isPrimary?: bo</span>{isPrimary ? (<span- className="rounded bg-[var(--color-accent-muted)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--color-accent-primary)]"+ className="text-xs font-medium text-[var(--color-text-primary)]"title="The most-trusted source backing this decision — its quote provides the headline fields. Higher rank = more trusted source type.">primary source</span>) : (<span- className="text-[10px] text-[var(--color-text-tertiary)]"+ className="text-caption text-[var(--color-text-tertiary)]"title="Source-type trust rank. Higher ranks are more trusted; the top-ranked row is the primary source.">rank {row.source_rank}</span>)}- <span className="ml-auto text-[10px] tabular-nums text-[var(--color-text-tertiary)]">+ <span className="ml-auto text-caption tabular-nums text-[var(--color-text-tertiary)]">{Math.round(row.confidence * 100)}% confidence</span></div>diff --git a/packages/ui/src/decisions/decision-review-lanes.tsx b/packages/ui/src/decisions/decision-review-lanes.tsxindex fae29b7ed..c50b5871d 100644--- a/packages/ui/src/decisions/decision-review-lanes.tsx+++ b/packages/ui/src/decisions/decision-review-lanes.tsx@@ -211,6 +211,13 @@ export function DecisionReviewLanes({) : rows.length === 0 ? (isLoading ? null : (<EmptyState+ tone={+ source !== "all"+ ? "filtered"+ : lane === "needs_review" || lane === "uncheckable"+ ? "positive"+ : "neutral"+ }title={`Nothing in ${LANE_LABEL[lane].toLowerCase()}`}description={source === "all"@@ -260,7 +267,7 @@ interface RowProps {}const MICRO_LABEL =- "font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]";+ "font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]";function DecisionLaneRow({decision: d,@@ -395,7 +402,7 @@ function DecisionLaneRow({{onAccept && blockers.length > 0 && (<p className="max-w-[28ch] text-right text-xs text-[var(--color-text-tertiary)]">Cannot accept: {blockers.join("; ")}. Fill it in with{" "}- <code className="font-mono text-[11px]">+ <code className="font-mono text-xs">repowise decision confirm {d.id.slice(0, 8)}</code>.@@ -425,7 +432,7 @@ function SignatureMark({ decision }: { decision: DecisionRecord }) {.join(", session ");return (<span- className="inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border border-[var(--color-border-default)] px-1.5 text-[11px] text-[var(--color-text-tertiary)]"+ className="inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border border-[var(--color-border-default)] px-1.5 text-xs text-[var(--color-text-tertiary)]"title={who ? `${label}: ${who}` : label}>{label}@@ -445,7 +452,7 @@ function SignatureMark({ decision }: { decision: DecisionRecord }) {function CurrencyMark({ currency }: { currency: DecisionCurrency }) {return (<span- className="inline-flex items-center gap-1.5 whitespace-nowrap text-[11px] text-[var(--color-text-tertiary)]"+ className="inline-flex items-center gap-1.5 whitespace-nowrap text-xs text-[var(--color-text-tertiary)]"title={DECISION_CURRENCY_DESCRIPTIONS[currency]}><spandiff --git a/packages/ui/src/decisions/decisions-table.tsx b/packages/ui/src/decisions/decisions-table.tsxindex b60d758e1..30f04fb70 100644--- a/packages/ui/src/decisions/decisions-table.tsx+++ b/packages/ui/src/decisions/decisions-table.tsx@@ -186,14 +186,14 @@ export function DecisionsTable({{d.tags.slice(0, 3).map((tag) => (<spankey={tag}- className="font-mono text-[11px] text-[var(--color-text-tertiary)]"+ className="font-mono text-xs text-[var(--color-text-tertiary)]">{tag}</span>))}{d.tags.length > 3 && (<span- className="font-mono text-[11px] tabular-nums text-[var(--color-text-tertiary)]"+ className="font-mono text-xs tabular-nums text-[var(--color-text-tertiary)]"title={d.tags.slice(3).join(", ")}>+{d.tags.length - 3}@@ -237,6 +237,11 @@ export function DecisionsTable({},];+ const filtersActive =+ filters.status !== "all" ||+ filters.source !== "all" ||+ (filters.scope ?? "all") !== "all";+const empty =isLoading ? undefined : error ? (<ApiError@@ -244,10 +249,20 @@ export function DecisionsTable({message="An error occurred while fetching decisions."{...(onRetry ? { onRetry } : {})}/>+ ) : filtersActive ? (+ <EmptyState+ tone="filtered"+ title="No decisions match these filters"+ action={{+ label: "Clear filters",+ onClick: () =>+ onFiltersChange({ ...filters, status: "all", source: "all", scope: "all" }),+ }}+ />) : (<EmptyState- title="No decisions found"- description="No architectural decisions match the current filters."+ title="No decisions yet"+ description="Decisions are inferred from pull requests, commits and agent sessions, or you can record one yourself."/>);diff --git a/packages/ui/src/doc-drift/doc-drift-view.tsx b/packages/ui/src/doc-drift/doc-drift-view.tsxindex 7dd23a1ff..a756a4047 100644--- a/packages/ui/src/doc-drift/doc-drift-view.tsx+++ b/packages/ui/src/doc-drift/doc-drift-view.tsx@@ -25,7 +25,6 @@import { useState } from "react";import useSWR, { useSWRConfig } from "swr";-import { FileCheck2 } from "lucide-react";import {DOC_DRIFT_CONFIDENCE,docDriftKindLabel,@@ -211,7 +210,7 @@ export function DocDriftView({{summary.findings_total === 0 && !filtered ? (<div className="flex flex-col items-center gap-2"><EmptyState- icon={<FileCheck2 className="h-6 w-6" />}+ tone="positive"title="No documentation drift found"description="Every reference this detector could resolve still resolves. It re-checks on each update, so this is worth a second look after a rename or a move."/>@@ -263,6 +262,11 @@ export function DocDriftView({onSelect={setSelected}onPrompt={(finding) => setPromptFindings([finding])}selectedId={selected?.id ?? null}+ onClearFilters={() => {+ setMinConfidence(DOC_DRIFT_CONFIDENCE.MEDIUM);+ setKind("");+ setDocument("");+ }}/></OverviewSection>)}diff --git a/packages/ui/src/doc-drift/drift-findings-table.tsx b/packages/ui/src/doc-drift/drift-findings-table.tsxindex e33c9eb26..88aabe8b9 100644--- a/packages/ui/src/doc-drift/drift-findings-table.tsx+++ b/packages/ui/src/doc-drift/drift-findings-table.tsx@@ -18,7 +18,6 @@* table per section because the shared table has no group-header rows.*/-import { FileText } from "lucide-react";import { Badge } from "../ui/badge";import {docDriftConfidenceTier,@@ -42,6 +41,8 @@ export interface DriftFindingsTableProps {onPrompt: (finding: DocDriftFinding) => void;/** Which row the open panel is describing. */selectedId?: string | null | undefined;+ /** Reset the confidence floor and reference filters. */+ onClearFilters?: () => void;}/**@@ -66,6 +67,7 @@ export function DriftFindingsTable({onSelect,onPrompt,selectedId,+ onClearFilters,}: DriftFindingsTableProps) {const columns: ResponsiveColumn<DocDriftFinding>[] = [{@@ -83,7 +85,7 @@ export function DriftFindingsTable({>line {f.line_number}{f.is_new ? (- <Badge variant="accent" className="ml-1.5 h-4 px-1 text-[10px]">+ <Badge variant="accent" className="ml-1.5 h-4 px-1 text-caption">new</Badge>) : null}@@ -161,9 +163,10 @@ export function DriftFindingsTable({if (findings.length === 0) {return (<EmptyState- icon={<FileText className="h-6 w-6" />}- title="No findings in this slice"+ tone="filtered"+ title="No findings match these filters"description="Widen the confidence floor or clear the reference filter to see the rest."+ {...(onClearFilters ? { action: { label: "Clear filters", onClick: onClearFilters } } : {})}/>);}diff --git a/packages/ui/src/owners/owner-avatar.tsx b/packages/ui/src/owners/owner-avatar.tsxindex 5a9f7e5ea..bf847f7b5 100644--- a/packages/ui/src/owners/owner-avatar.tsx+++ b/packages/ui/src/owners/owner-avatar.tsx@@ -56,7 +56,7 @@ export function OwnerAvatar({ name, email, size = "md", className }: OwnerAvatar<spanclassName={cn("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full",- "border border-[var(--color-border-default)] bg-[var(--color-accent-muted)]",+ "border border-[var(--color-border-default)] bg-[var(--color-bg-inset)]",className,)}style={{ width: px, height: px }}@@ -64,7 +64,7 @@ export function OwnerAvatar({ name, email, size = "md", className }: OwnerAvatartitle={label}><span- className="font-semibold leading-none tracking-wide text-[var(--color-accent-primary)]"+ className="font-semibold leading-none tracking-wide text-[var(--color-text-secondary)]"style={{ fontSize: Math.max(9, Math.floor(px / 2.9)) }}>{initials(name, email ?? null)}diff --git a/packages/ui/src/owners/owner-directory.tsx b/packages/ui/src/owners/owner-directory.tsxindex c9c0c875b..fe2bcdaa2 100644--- a/packages/ui/src/owners/owner-directory.tsx+++ b/packages/ui/src/owners/owner-directory.tsx@@ -40,6 +40,8 @@ export interface OwnerDirectoryProps {/** Base path for the section jump links, e.g. `/repos/42`. */base?: string;LinkComponent?: React.ElementType | undefined;+ /** Rendered in place of the table when the list could not load. */+ error?: React.ReactNode;}const INACTIVE_DAYS = 90;@@ -75,6 +77,7 @@ export function OwnerDirectory({hrefFor,base,LinkComponent,+ error,}: OwnerDirectoryProps) {// The lede is a claim about the whole repo, so it is computed off the full// set when the caller has one. Computed off the loaded page instead, "68% of@@ -277,7 +280,7 @@ export function OwnerDirectory({title="Everyone"description="A dot marks sole-owned files held by someone who has stopped committing, so a clean column means nothing to chase."action={- <span className="font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">+ <span className="font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">{total.toLocaleString()} {total === 1 ? "contributor" : "contributors"}</span>}@@ -293,7 +296,9 @@ export function OwnerDirectory({/></div>- {isLoading && owners.length === 0 ? (+ {error ? (+ error+ ) : isLoading && owners.length === 0 ? (// Row-height skeletons, not tiles: a skeleton whose shape misses the// real layout reflows when content lands, which reads as slower than// showing nothing.@@ -303,15 +308,19 @@ export function OwnerDirectory({))}</div>) : owners.length === 0 ? (- <EmptyState- icon={<Users className="h-6 w-6" />}- title="No contributors match"- description={- filters.q- ? "Nothing matches that filter. Clear it to see everyone."- : "Contributors land with the first git index."- }- />+ filters.q ? (+ <EmptyState+ tone="filtered"+ title="No contributors match this search"+ action={{ label: "Clear search", onClick: () => onFiltersChange({ ...filters, q: "" }) }}+ />+ ) : (+ <EmptyState+ icon={<Users />}+ title="No contributors yet"+ description="Contributors land with the first git index."+ />+ )) : (<OwnerTableowners={owners}diff --git a/packages/ui/src/refactoring/diff-view.tsx b/packages/ui/src/refactoring/diff-view.tsxindex eb1a73cca..991294c6e 100644--- a/packages/ui/src/refactoring/diff-view.tsx+++ b/packages/ui/src/refactoring/diff-view.tsx@@ -93,7 +93,7 @@ export function parseUnifiedDiff(diff: string): DiffFile[] {const LINE_CLASS: Record<DiffLineKind, string> = {add: "bg-[var(--color-success)]/10 text-[var(--color-text-primary)]",del: "bg-[var(--color-error)]/10 text-[var(--color-text-primary)]",- hunk: "bg-[var(--color-accent-muted)] text-[var(--color-accent-primary)]",+ hunk: "bg-[var(--color-bg-inset)] text-[var(--color-text-tertiary)]",meta: "text-[var(--color-text-tertiary)]",context: "text-[var(--color-text-secondary)]",};@@ -122,12 +122,12 @@ export function DiffView({ diff, emptyFallback }: DiffViewProps) {<span className="truncate font-mono text-xs text-[var(--color-text-primary)]" title={file.path}>{file.path || "(diff)"}</span>- <span className="shrink-0 font-mono text-[11px] tabular-nums">+ <span className="shrink-0 font-mono text-xs tabular-nums"><span className="text-[var(--color-success)]">+{file.added}</span>{" "}<span className="text-[var(--color-error)]">-{file.removed}</span></span></div>- <pre className="overflow-x-auto px-0 py-1 text-[12px] leading-[1.5]">+ <pre className="overflow-x-auto px-0 py-1 text-xs leading-[1.5]"><code className="block">{file.lines.map((line, j) => (<span key={j} className={`block px-3 ${LINE_CLASS[line.kind]}`}>diff --git a/packages/ui/src/refactoring/opportunity-drawer.tsx b/packages/ui/src/refactoring/opportunity-drawer.tsxindex 37017a547..02b50a290 100644--- a/packages/ui/src/refactoring/opportunity-drawer.tsx+++ b/packages/ui/src/refactoring/opportunity-drawer.tsx@@ -126,7 +126,7 @@ export function OpportunityDrawer({/>) : loading ? (<>- <SheetTitle className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12 text-[15px]">+ <SheetTitle className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12 text-sm">Loading refactoring plan</SheetTitle><SkeletonRegion className="space-y-4 px-5 py-5" label="Loading refactoring plan">@@ -136,7 +136,7 @@ export function OpportunityDrawer({</>) : detail && !detail.found ? (<>- <SheetTitle className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12 text-[15px]">+ <SheetTitle className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12 text-sm">Refactoring plan unavailable</SheetTitle><div className="space-y-2 px-5 py-5 text-sm text-[var(--color-text-secondary)]">@@ -156,7 +156,7 @@ export function OpportunityDrawer({</>) : error ? (<>- <SheetTitle className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12 text-[15px]">+ <SheetTitle className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12 text-sm">Refactoring plan unavailable</SheetTitle><p className="px-5 py-5 text-sm text-[var(--color-text-secondary)]">{error}</p>@@ -243,19 +243,19 @@ function DrawerBody({return (<><div className="border-b border-[var(--color-border-default)] px-5 py-4 pr-12">- <div className="text-[11px] text-[var(--color-text-secondary)]">+ <div className="text-xs text-[var(--color-text-secondary)]">{meta.label}{detail.lead_biomarker ? ` · against ${humanizeBiomarker(detail.lead_biomarker)}` : ""}</div>- <SheetTitle className="mt-0.5 break-words font-mono text-[15px] font-semibold text-[var(--color-text-primary)]">+ <SheetTitle className="mt-0.5 break-words font-mono text-sm font-semibold text-[var(--color-text-primary)]">{name}</SheetTitle>- <p className="mt-1 break-all font-mono text-[11.5px] text-[var(--color-text-tertiary)]">+ <p className="mt-1 break-all font-mono text-xs text-[var(--color-text-tertiary)]">{detail.file_path}</p></div>- <div className="flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-[var(--color-border-default)] px-5 py-2.5 text-[12.5px] text-[var(--color-text-secondary)]">+ <div className="flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-[var(--color-border-default)] px-5 py-2.5 text-xs text-[var(--color-text-secondary)]">{facts.map((f) => (<span key={f}>{f}</span>))}@@ -268,7 +268,7 @@ function DrawerBody({)}</div>- <p className="border-b border-[var(--color-border-default)] px-5 py-2 text-[12px] text-[var(--color-text-secondary)]">+ <p className="border-b border-[var(--color-border-default)] px-5 py-2 text-xs text-[var(--color-text-secondary)]">{blastRadiusLine(detail)}{" "}{guardingTests > 0? `${guarding.atLeast ? "At least " : ""}${formatNumber(guardingTests)} guarding test${guardingTests === 1 ? "" : "s"} reach it.`@@ -288,7 +288,7 @@ function DrawerBody({{onStatusChange ? (<section>- <h4 className="mb-2 font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">+ <h4 className="mb-2 font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">Triage</h4><div role="radiogroup" aria-label="Triage this refactoring plan" className="flex flex-wrap gap-1.5">@@ -304,7 +304,7 @@ function DrawerBody({onClick={() => void setStatus(option.value)}className={`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${current- ? "bg-[var(--color-accent-muted)] text-[var(--color-accent-primary)]"+ ? "bg-[var(--color-bg-selected)] text-[var(--color-text-primary)] shadow-[inset_0_-2px_0_var(--color-accent-primary)]": "text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"}`}>@@ -313,7 +313,7 @@ function DrawerBody({);})}</div>- <p className="mt-1.5 text-[11.5px] text-[var(--color-text-tertiary)]">+ <p className="mt-1.5 text-xs text-[var(--color-text-tertiary)]">Applies to all {detail.step_count} step{detail.step_count === 1 ? "" : "s"}.{" "}{status === "false_positive"? "A false positive is suppressed on every later analysis."@@ -322,7 +322,7 @@ function DrawerBody({<prole="status"className={- failed ? "mt-1 text-[11.5px] text-[var(--color-error)]" : "sr-only"+ failed ? "mt-1 text-xs text-[var(--color-error)]" : "sr-only"}>{failed ? "Could not save that. The refactoring plan is unchanged." : ""}@@ -331,16 +331,16 @@ function DrawerBody({) : null}<section>- <h4 className="mb-1 font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">+ <h4 className="mb-1 font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">The steps, in order</h4>{anyRelocated ? (- <p className="mb-3 rounded-md border border-[var(--color-caution)]/40 bg-[var(--color-caution)]/10 px-3 py-2 text-[12.5px] text-[var(--color-text-secondary)]">+ <p className="mb-3 rounded-md border border-[var(--color-caution)]/40 bg-[var(--color-caution)]/10 px-3 py-2 text-xs text-[var(--color-text-secondary)]">{detail.ordering_note ?? ORDERING_NOTE}</p>) : null}{stepsUnavailable ? (- <p className="text-[12.5px] text-[var(--color-text-secondary)]">+ <p className="text-xs text-[var(--color-text-secondary)]">The {detail.step_count} step{detail.step_count === 1 ? "" : "s"} for this refactoringplan could not be loaded. Try again shortly, or ask for it by id below.</p>@@ -360,7 +360,7 @@ function DrawerBody({))}</ol>{detail.steps_total != null && detail.steps_emitted < detail.steps_total ? (- <p className="mt-2 text-[11.5px] text-[var(--color-text-tertiary)]">+ <p className="mt-2 text-xs text-[var(--color-text-tertiary)]">Showing {detail.steps_emitted} of {detail.steps_total} steps.</p>) : null}@@ -384,7 +384,7 @@ function DrawerBody({))}</div>) : (- <p className="text-[12.5px] text-[var(--color-text-secondary)]">+ <p className="text-xs text-[var(--color-text-secondary)]">No guarding tests found. Write one that pins the current behaviour before applyingthese steps.</p>@@ -404,7 +404,7 @@ function DrawerBody({{/* Named as observation, not instruction. These are mostly demotedclone groups: real duplication, not a change worth making on itsown account. */}- <p className="mb-2.5 text-[12.5px] text-[var(--color-text-secondary)]">+ <p className="mb-2.5 text-xs text-[var(--color-text-secondary)]">Supporting observations on this file. They are why the diagnosis reads the way itdoes, not extra work to do.</p>@@ -412,13 +412,13 @@ function DrawerBody({{detail.evidence.map((item) => (<likey={item.plan_id}- className="border-t border-[var(--color-border-default)] pt-1.5 text-[12.5px] text-[var(--color-text-secondary)]"+ className="border-t border-[var(--color-border-default)] pt-1.5 text-xs text-[var(--color-text-secondary)]"><span className="text-[var(--color-text-tertiary)]">{typeMeta(item.refactoring_type).label}</span>{item.target_symbol ? (- <span className="ml-2 break-all font-mono text-[12px] text-[var(--color-text-primary)]">+ <span className="ml-2 break-all font-mono text-xs text-[var(--color-text-primary)]">{item.target_symbol}</span>) : null}@@ -426,7 +426,7 @@ function DrawerBody({))}</ul>{detail.evidence_truncated ? (- <p className="mt-2 text-[11.5px] text-[var(--color-text-tertiary)]">+ <p className="mt-2 text-xs text-[var(--color-text-tertiary)]">Showing {detail.evidence_emitted} of {detail.evidence_total} observations.</p>) : null}@@ -475,7 +475,7 @@ function DrawerBody({</span>}>- <p className="text-[12.5px] text-[var(--color-text-secondary)]">+ <p className="text-xs text-[var(--color-text-secondary)]">Copy the prompt with the Claude + MCP flavor and it carries this call, so the agentcan pull the same record itself rather than working from the pasted copy. The otherflavors inline the whole plan instead, because they have no tool that resolves an id.@@ -538,11 +538,11 @@ function StepCard({<span className="font-mono text-xs tabular-nums text-[var(--color-text-tertiary)]">{String(index + 1).padStart(2, "0")}</span>- <span className="text-[12.5px] text-[var(--color-text-secondary)]">{meta.label}</span>+ <span className="text-xs text-[var(--color-text-secondary)]">{meta.label}</span>{/* Not a colour-only mark: the word is the signal, and the tint onlyreinforces it. */}<span- className={`rounded px-1.5 py-0.5 text-[11px] font-medium ${+ className={`rounded px-1.5 py-0.5 text-xs font-medium ${mechanical? "bg-[var(--color-success)]/12 text-[var(--color-success)]": "bg-[var(--color-bg-inset)] text-[var(--color-text-secondary)]"@@ -551,7 +551,7 @@ function StepCard({{mechanical ? "Mechanical" : "Judgment"}</span>{isRelocated(step) ? (- <span className="rounded bg-[var(--color-caution)]/15 px-1.5 py-0.5 text-[11px] font-medium text-[var(--color-caution)]">+ <span className="rounded bg-[var(--color-caution)]/15 px-1.5 py-0.5 text-xs font-medium text-[var(--color-caution)]">Moved by an earlier step</span>) : null}@@ -561,12 +561,12 @@ function StepCard({type="button"onClick={onOpenStep ? () => onOpenStep(step.plan_id) : undefined}disabled={!onOpenStep}- className="mt-1 block break-all text-left font-mono text-[13px] font-medium text-[var(--color-text-primary)] enabled:hover:text-[var(--color-accent-primary)]"+ className="mt-1 block break-all text-left font-mono text-sm font-medium text-[var(--color-text-primary)] enabled:hover:text-[var(--color-accent-primary)]">{step.target_symbol || meta.label}</button>- <p className="mt-0.5 break-all font-mono text-[11px] text-[var(--color-text-tertiary)]">+ <p className="mt-0.5 break-all font-mono text-xs text-[var(--color-text-tertiary)]">{href ? (<a href={href} className="underline-offset-2 hover:underline">{step.file_path}@@ -581,14 +581,14 @@ function StepCard({</p>{isRelocated(step) ? (- <p className="mt-1.5 text-[12px] text-[var(--color-text-secondary)]">+ <p className="mt-1.5 text-xs text-[var(--color-text-secondary)]">An earlier step moves this symbol out of that file, so the path and lines above say whereit was. Find it again before applying this one.</p>) : null}{step.applicability.reasons.length > 0 ? (- <p className="mt-1.5 text-[12px] text-[var(--color-text-secondary)]">+ <p className="mt-1.5 text-xs text-[var(--color-text-secondary)]">{step.applicability.reasons.map(humanizeBiomarker).join("; ")}.</p>) : null}@@ -596,7 +596,7 @@ function StepCard({{step.applicability.unknowns.length > 0 ? (// An unknown is first-class. Leaving it out would let a check the layer// never ran read as a check that passed.- <p className="mt-1 text-[12px] text-[var(--color-text-tertiary)]">+ <p className="mt-1 text-xs text-[var(--color-text-tertiary)]">Not established: {step.applicability.unknowns.map(humanizeBiomarker).join(", ")}.</p>) : null}@@ -640,7 +640,7 @@ function StepCode({type="button"aria-expanded={open}onClick={() => setOpen((o) => !o)}- className="rounded text-[12px] font-medium text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"+ className="rounded text-xs font-medium text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">{open ? "Hide the code" : "Show the code"}</button>@@ -667,7 +667,7 @@ function StepCode({{plan && onGenerateCode ? (<GenerateCodePanel plan={plan} onGenerate={onGenerateCode} />) : plan ? (- <p className="text-[11.5px] text-[var(--color-text-tertiary)]">+ <p className="text-xs text-[var(--color-text-tertiary)]">A diff preview is drafted by a model on request. Code generation is off here.</p>) : null}diff --git a/packages/ui/src/refactoring/opportunity-rows.tsx b/packages/ui/src/refactoring/opportunity-rows.tsxindex 0f43dc157..b72abe17d 100644--- a/packages/ui/src/refactoring/opportunity-rows.tsx+++ b/packages/ui/src/refactoring/opportunity-rows.tsx@@ -96,7 +96,7 @@ export function OpportunityRows({the values they label. */}<divaria-hidden- className={`${GRID} hidden border-b border-[var(--color-border-default)] pb-2 pt-1 font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)] lg:grid`}+ className={`${GRID} hidden border-b border-[var(--color-border-default)] pb-2 pt-1 font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)] lg:grid`}><span>Type</span><span>File</span>@@ -183,7 +183,7 @@ function OpportunityRow({onMouseEnter={() => onHighlight?.(opportunity.opportunity_id)}onMouseLeave={() => onHighlight?.(null)}className={`${GRID} items-start border-t border-[var(--color-border-default)] py-3 ${- lit ? "bg-[var(--color-accent-muted)]" : "hover:bg-[var(--color-bg-elevated)]"+ lit ? "bg-[var(--color-bg-selected)]" : "hover:bg-[var(--color-bg-elevated)]"}`}><div className="order-2 text-xs text-[var(--color-text-secondary)] lg:order-none lg:pt-px">@@ -198,37 +198,37 @@ function OpportunityRow({onBlur={() => onHighlight?.(null)}className="group order-1 col-span-2 min-w-0 text-left lg:order-none lg:col-span-1">- <span className="block break-words font-mono text-[13.5px] font-medium text-[var(--color-text-primary)] group-hover:text-[var(--color-accent-primary)]">+ <span className="block break-words font-mono text-sm font-medium text-[var(--color-text-primary)] group-hover:text-[var(--color-accent-primary)]">{name}</span>{/* Full path, no ellipsis: a truncated title reports a layout decisionto the reader as missing content. */}- <span className="mt-0.5 block break-all font-mono text-[11.5px] text-[var(--color-text-tertiary)]">+ <span className="mt-0.5 block break-all font-mono text-xs text-[var(--color-text-tertiary)]">{opportunity.file_path}</span>- <span className="mt-1 block text-[12px] text-[var(--color-text-secondary)]">+ <span className="mt-1 block text-xs text-[var(--color-text-secondary)]">{opportunityLede(opportunity)}</span></button>- <div className="order-3 text-[12.5px] text-[var(--color-text-secondary)] lg:order-none lg:pt-px">+ <div className="order-3 text-xs text-[var(--color-text-secondary)] lg:order-none lg:pt-px">{stepSummary(opportunity)}<br />- <span className="text-[11.5px] text-[var(--color-text-tertiary)]">+ <span className="text-xs text-[var(--color-text-tertiary)]">{effort} effort{opportunity.affected_files_total > 1? `, ${formatNumber(opportunity.affected_files_total)} files`: ""}</span>{opportunity.confidence !== "high" ? (- <span className="ml-2 inline-flex items-center gap-1.5 text-[11.5px] text-[var(--color-caution)]">+ <span className="ml-2 inline-flex items-center gap-1.5 text-xs text-[var(--color-caution)]"><span aria-hidden className="h-1.5 w-1.5 rounded-full bg-current" />{opportunity.confidence} confidence</span>) : null}</div>- <div className="order-4 space-y-1 text-[12.5px] tabular-nums lg:order-none lg:pt-px">+ <div className="order-4 space-y-1 text-xs tabular-nums lg:order-none lg:pt-px">{gain > 0 ? (<span className="block font-medium text-[var(--color-success)]">+{gain.toFixed(1)} health@@ -242,8 +242,8 @@ function OpportunityRow({title={addressesPrimaryLabel(opportunity.addresses_primary_problem)}className={opportunity.addresses_primary_problem === true- ? "block text-[11.5px] text-[var(--color-text-secondary)]"- : "block text-[11.5px] text-[var(--color-text-tertiary)]"+ ? "block text-xs text-[var(--color-text-secondary)]"+ : "block text-xs text-[var(--color-text-tertiary)]"}>{addressesPrimaryShort(opportunity.addresses_primary_problem)}@@ -254,7 +254,7 @@ function OpportunityRow({only once a row left `open`, so the list had no column a reader couldscan down to see what they had already dealt with - and the row'sheight changed when they marked one. */}- <div className="order-5 text-[12.5px] lg:order-none lg:pt-px">+ <div className="order-5 text-xs lg:order-none lg:pt-px"><spanclassName={status === "open"@@ -270,7 +270,7 @@ function OpportunityRow({<spanrole="status"className={- failed ? "mt-0.5 block text-[11.5px] text-[var(--color-error)]" : "sr-only"+ failed ? "mt-0.5 block text-xs text-[var(--color-error)]" : "sr-only"}>{failed ? "Could not save" : ""}@@ -369,7 +369,7 @@ function RowOverflow({close();onAiPrompt(opportunity);}}- className="block w-full px-3 py-2 text-left text-[13px] text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"+ className="block w-full px-3 py-2 text-left text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]">Copy prompt for an agent</button>@@ -378,7 +378,7 @@ function RowOverflow({<ahref={href}role="menuitem"- className="block px-3 py-2 text-[13px] text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"+ className="block px-3 py-2 text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]">Open file</a>@@ -389,7 +389,7 @@ function RowOverflow({aria-label="Triage this opportunity"className="mt-1 border-t border-[var(--color-border-default)] pt-1">- <p className="px-3 pb-1 pt-1 text-[11px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]">+ <p className="px-3 pb-1 pt-1 text-xs uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]">Triage</p>{TRIAGE_STATUSES.map((option) => {@@ -405,7 +405,7 @@ function RowOverflow({close();onStatusChange(option.value);}}- className={`block w-full px-3 py-2 text-left text-[13px] ${+ className={`block w-full px-3 py-2 text-left text-sm ${current? "font-medium text-[var(--color-accent-primary)]": "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"diff --git a/packages/ui/src/refactoring/plan-before.tsx b/packages/ui/src/refactoring/plan-before.tsxindex ecdecf7ea..5247aa35e 100644--- a/packages/ui/src/refactoring/plan-before.tsx+++ b/packages/ui/src/refactoring/plan-before.tsx@@ -89,7 +89,7 @@ export function PlanBefore({ plan }: PlanBeforeProps) {{plan.target_symbol || baseName(plan.file_path)}</code>{lcom4 > 0 ? (- <span className="shrink-0 rounded-full bg-[var(--color-error)]/10 px-2 py-0.5 text-caption font-semibold tabular-nums text-[var(--color-error)]">+ <span className="shrink-0 text-caption font-semibold tabular-nums text-[var(--color-text-secondary)]">LCOM4 {lcom4}</span>) : null}@@ -207,7 +207,7 @@ export function PlanBefore({ plan }: PlanBeforeProps) {{baseName(plan.file_path)}</code>{nloc > 0 ? (- <span className="shrink-0 rounded-full bg-[var(--color-error)]/10 px-2 py-0.5 text-caption font-semibold tabular-nums text-[var(--color-error)]">+ <span className="shrink-0 text-caption font-semibold tabular-nums text-[var(--color-text-secondary)]">{nloc} NLOC</span>) : null}diff --git a/packages/ui/src/refactoring/plan-comparison.tsx b/packages/ui/src/refactoring/plan-comparison.tsxindex a3eeaca37..547ac83f5 100644--- a/packages/ui/src/refactoring/plan-comparison.tsx+++ b/packages/ui/src/refactoring/plan-comparison.tsx@@ -25,9 +25,9 @@ export function PlanComparison({ plan, fileHref }: PlanComparisonProps) {return (<div className="relative grid gap-3 md:grid-cols-2">{/* before */}- <div className="rounded-2xl border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/40 p-4">+ <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/40 p-4"><div className="mb-3">- <span className="font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">+ <span className="font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">Today</span></div>@@ -58,9 +58,9 @@ export function PlanComparison({ plan, fileHref }: PlanComparisonProps) {</div>{/* after */}- <div className="rounded-2xl border border-[var(--color-border-default)] p-4">+ <div className="rounded-lg border border-[var(--color-border-default)] p-4"><div className="mb-3">- <span className="font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-secondary)]">+ <span className="font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-secondary)]">After</span></div>diff --git a/packages/ui/src/refactoring/refactoring-board.tsx b/packages/ui/src/refactoring/refactoring-board.tsxindex 1e18a9533..6ad18cacd 100644--- a/packages/ui/src/refactoring/refactoring-board.tsx+++ b/packages/ui/src/refactoring/refactoring-board.tsx@@ -36,6 +36,8 @@import * as React from "react";import { Search } from "lucide-react";+import { EmptyState } from "../shared/empty-state";+import { Input } from "../ui/input";import { FilterSelect } from "../health/code-health-controls";import { PaginationControls } from "../shared/pagination-controls";@@ -105,6 +107,7 @@ export interface RefactoringBoardProps {structuralOpportunities?: RefactoringOpportunity[] | undefined;serverState: RefactoringBoardServerState;onServerStateChange: (change: Partial<RefactoringBoardServerState>) => void;+ indexedFileCount?: number | undefined;onOpen?: ((opportunity: RefactoringOpportunity) => void) | undefined;onAiPrompt?: ((opportunity: RefactoringOpportunity) => void) | undefined;onStatusChange?:@@ -121,6 +124,8 @@ export interface RefactoringBoardProps {sectionTitle?: string;emptyTitle?: string;emptyHint?: string;+ /** Shown with the all-clear when the analysis ran and found nothing. */+ emptyClearHint?: string;}export function RefactoringBoard({@@ -130,6 +135,7 @@ export function RefactoringBoard({structuralOpportunities,serverState,onServerStateChange,+ indexedFileCount,onOpen,onAiPrompt,onStatusChange,@@ -137,8 +143,9 @@ export function RefactoringBoard({onSeeStructural,showLede = true,sectionTitle = "All opportunities",- emptyTitle = "No refactoring opportunities",+ emptyTitle = "No refactoring opportunities yet",emptyHint = "Opportunities appear here when a file is worth splitting, a cycle worth cutting, a class worth extracting, or a long function worth breaking up.",+ emptyClearHint = "No file is worth splitting, no cycle worth cutting and no class worth extracting across this repository.",}: RefactoringBoardProps) {const [highlighted, setHighlighted] = React.useState<string | null>(null);@@ -154,23 +161,35 @@ export function RefactoringBoard({summary && summary.status === "available" ? summary.opportunities_total : null;// Empty only when the inventory is: the default scope can list none of it.const inventory = rollupTotal ?? serverState.total + (serverState.hidden?.total ?? 0);- if (inventory === 0 && serverState.status === "open") {- return (- <div className="border-t border-[var(--color-border-default)] pt-10 text-center">- <h3 className="text-sm font-semibold text-[var(--color-text-primary)]">{emptyTitle}</h3>- <p className="mx-auto mt-1.5 max-w-[56ch] text-sm text-[var(--color-text-tertiary)]">- {emptyHint}- </p>- </div>- );- }-const filtersActive =serverState.query.trim() !== "" ||serverState.effort !== null ||serverState.confidence !== null ||serverState.mechanicalOnly ||serverState.status !== "open";+ if (inventory === 0 && !filtersActive) {+ const analysed = summary?.status === "available";+ return (+ <div className="space-y-10">+ {showLede ? <RefactoringLede summary={summary} indexedFileCount={indexedFileCount} /> : null}+ <EmptyState+ tone={analysed ? "positive" : "neutral"}+ title={analysed ? "No refactoring targets" : emptyTitle}+ description={analysed ? emptyClearHint : emptyHint}+ />+ </div>+ );+ }++ const clearFilters = () =>+ onServerStateChange({+ query: "",+ status: "open",+ effort: null,+ confidence: null,+ mechanicalOnly: false,+ offset: 0,+ });const resultTotal = serverState.total;const worthOnly = serverState.appliedScope === "fix_first";const hiddenTotal = serverState.hidden?.total ?? 0;@@ -185,6 +204,7 @@ export function RefactoringBoard({{showLede ? (<RefactoringLedesummary={summary}+ indexedFileCount={indexedFileCount}facets={facets}quickWinsActive={quickWinsActive}onToggleQuickWins={toggleQuickWins}@@ -249,7 +269,7 @@ export function RefactoringBoard({<div className="flex items-center gap-2"><labelhtmlFor="refactoring-sort"- className="font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]"+ className="font-mono text-caption uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">Sort</label>@@ -346,16 +366,7 @@ export function RefactoringBoard({{filtersActive ? (<buttontype="button"- onClick={() =>- onServerStateChange({- query: "",- status: "open",- effort: null,- confidence: null,- mechanicalOnly: false,- offset: 0,- })- }+ onClick={clearFilters}className="text-xs text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline">Clear filters@@ -364,13 +375,17 @@ export function RefactoringBoard({</div>{opportunities.length === 0 ? (- <p className="border-t border-[var(--color-border-default)] py-10 text-center text-sm text-[var(--color-text-tertiary)]">- {worthOnly && hiddenTotal > 0- ? `None of these is worth doing first. ${formatNumber(hiddenTotal)} more are in the full inventory.`- : serverState.status === "open"- ? "No opportunities match these filters."- : `Nothing has been marked ${STATUS_LABEL[serverState.status].toLowerCase()} yet.`}- </p>+ <EmptyState+ tone="filtered"+ title={+ worthOnly && hiddenTotal > 0+ ? `None of these is worth doing first. ${formatNumber(hiddenTotal)} more are in the full inventory.`+ : serverState.status === "open"+ ? "No opportunities match these filters"+ : `Nothing has been marked ${STATUS_LABEL[serverState.status].toLowerCase()} yet`+ }+ {...(filtersActive ? { action: { label: "Clear filters", onClick: clearFilters } } : {})}+ />) : (<><OpportunityRows@@ -424,7 +439,7 @@ function FilterChip({aria-pressed={active}className={`rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors ${active- ? "border-[var(--color-accent-primary)] bg-[var(--color-accent-muted)] text-[var(--color-accent-primary)]"+ ? "border-[var(--color-border-hover)] bg-[var(--color-bg-selected)] text-[var(--color-text-primary)]": "border-[var(--color-border-default)] text-[var(--color-text-secondary)] hover:border-[var(--color-border-hover)] hover:text-[var(--color-text-primary)]"}`}>diff --git a/packages/ui/src/refactoring/refactoring-lede.tsx b/packages/ui/src/refactoring/refactoring-lede.tsxindex fc9726eea..e38857b16 100644--- a/packages/ui/src/refactoring/refactoring-lede.tsx+++ b/packages/ui/src/refactoring/refactoring-lede.tsx@@ -25,6 +25,8 @@ export type RefactoringFacets = RefactoringOpportunityPage["facets"];export interface RefactoringLedeProps {/** The repository rollup. Absent or unavailable and the lede does not render. */summary?: RefactoringOpportunityRollup | null | undefined;+ /** Files indexed, for the all-clear line. */+ indexedFileCount?: number | undefined;/** The page's facet counts. Absent and the chips do not render. */facets?: RefactoringFacets | null | undefined;/** Whether the list is narrowed to small effort, which the Quick wins chip toggles. */@@ -47,6 +49,7 @@ function plural(n: number, one: string, many: string): string {export function RefactoringLede({summary,+ indexedFileCount,facets,quickWinsActive = false,onToggleQuickWins,@@ -58,6 +61,26 @@ export function RefactoringLede({const total = summary.opportunities_total;const files = summary.files_total;+ if (total === 0) {+ return (+ <PageLede+ label="Open opportunities"+ value="0"+ unit={+ indexedFileCount ? `across ${formatNumber(indexedFileCount)} indexed files` : undefined+ }+ layout="beside"+ action={action}+ >+ <p>+ <span className="font-medium text-[var(--color-text-primary)]">+ Nothing is worth splitting, cutting or extracting right now.+ </span>{" "}+ New opportunities appear here as files grow or cycles form.+ </p>+ </PageLede>+ );+ }const steps = summary.steps_total;const mechanical = summary.mechanical_steps_total;const judgment = summary.judgment_steps_total;diff --git a/packages/ui/src/refactoring/start-here.tsx b/packages/ui/src/refactoring/start-here.tsxindex bda548fbe..71dedf913 100644--- a/packages/ui/src/refactoring/start-here.tsx+++ b/packages/ui/src/refactoring/start-here.tsx@@ -135,22 +135,22 @@ export function StartHere({onFocus={() => setHighlighted(item.opportunity_id)}onBlur={() => setHighlighted(null)}className={`group grid w-full grid-cols-[28px_minmax(0,1fr)] items-start gap-4 border-t border-[var(--color-border-default)] px-3 py-4 text-left transition-colors first:border-t-0 md:grid-cols-[28px_minmax(0,1fr)_170px] md:items-center ${- lit ? "bg-[var(--color-accent-muted)]" : "hover:bg-[var(--color-bg-elevated)]"+ lit ? "bg-[var(--color-bg-selected)]" : "hover:bg-[var(--color-bg-elevated)]"}`}><span className="pt-0.5 font-mono text-xs tabular-nums text-[var(--color-text-tertiary)]">{String(i + 1).padStart(2, "0")}</span><span className="min-w-0">- <span className="block text-[15px] font-semibold text-[var(--color-text-primary)] group-hover:text-[var(--color-accent-primary)]">+ <span className="block text-sm font-semibold text-[var(--color-text-primary)] group-hover:text-[var(--color-accent-primary)]">{meta.label} · {item.file_path.split("/").pop()}</span>{/* Full path, no ellipsis: a truncated title reports a layoutdecision to the reader as missing content. */}- <span className="mt-0.5 block break-all font-mono text-[11px] text-[var(--color-text-tertiary)]">+ <span className="mt-0.5 block break-all font-mono text-xs text-[var(--color-text-tertiary)]">{item.file_path}</span>- <span className="mt-1.5 block max-w-[70ch] text-[13px] text-[var(--color-text-secondary)]">+ <span className="mt-1.5 block max-w-[70ch] text-sm text-[var(--color-text-secondary)]">{stepSummary(item)} ·{" "}{addressesPrimaryShort(item.addresses_primary_problem).toLowerCase()}</span>diff --git a/packages/web/messages/en.json b/packages/web/messages/en.jsonindex d33c0abb4..2e8380f83 100644--- a/packages/web/messages/en.json+++ b/packages/web/messages/en.json@@ -282,6 +282,9 @@"promptDescription": "A ready-to-paste plan that hands your AI coding agent the ordered steps, which of them are mechanical, the evidence behind the diagnosis, and the id to query it back.","loading": "Loading refactoring opportunities","loadFailed": "Couldn't load refactoring opportunities. The repo may not be indexed yet, or the API is unreachable.",+ "loadFailedTitle": "Couldn't load refactoring",+ "unavailableTitle": "Refactoring analysis has not run yet",+ "unavailableDescription": "Run repowise update in this repository to analyse it. Opportunities appear here once the health pass has finished.","tabAll": "All","tabStructural": "Structural","sectionTitleAll": "All opportunities",@@ -310,6 +313,9 @@"profileTitle": "Contributor","profileEmptyTitle": "No profile for this contributor","profileEmptyDescription": "Nobody by this name or address appears in the indexed git history. They may have committed under a different address, or the history may not have been synced yet.",+ "profileBack": "All contributors",+ "loadFailedTitle": "Couldn't load contributors",+ "loadFailed": "The contributor list could not be loaded. Check that the API is reachable and try again.","tenureSince": "Committing here since {date}","tenureLastTouched": "last touched {time}","unknownName": "unknown"diff --git a/packages/web/messages/zh-CN.json b/packages/web/messages/zh-CN.jsonindex fc5f63a92..8a0677513 100644--- a/packages/web/messages/zh-CN.json+++ b/packages/web/messages/zh-CN.json@@ -282,6 +282,9 @@"promptDescription": "一份可直接粘贴的计划,把有序步骤、其中哪些是机械改动、诊断背后的证据,以及用于回查的 id 一并交给你的 AI 编码智能体。","loading": "正在加载重构机会","loadFailed": "无法加载重构机会。该仓库可能尚未索引,或者接口不可达。",+ "loadFailedTitle": "无法加载重构",+ "unavailableTitle": "重构分析尚未运行",+ "unavailableDescription": "在此仓库中运行 repowise update 进行分析。健康度检查完成后,重构机会会显示在这里。","tabAll": "全部","tabStructural": "结构性","sectionTitleAll": "全部重构机会",@@ -310,6 +313,9 @@"profileTitle": "贡献者","profileEmptyTitle": "该贡献者没有可展示的资料","profileEmptyDescription": "已索引的 git 历史中没有这个名字或地址。对方可能用了别的地址提交,或者历史尚未同步。",+ "profileBack": "全部贡献者",+ "loadFailedTitle": "无法加载贡献者",+ "loadFailed": "无法加载贡献者列表。请确认接口可访问后重试。","tenureSince": "自 {date} 起在此提交","tenureLastTouched": "最近提交于 {time}","unknownName": "未知"diff --git a/packages/web/src/app/repos/[id]/owners/[owner]/page.tsx b/packages/web/src/app/repos/[id]/owners/[owner]/page.tsxindex c5b2a16ba..2ba97c27e 100644--- a/packages/web/src/app/repos/[id]/owners/[owner]/page.tsx+++ b/packages/web/src/app/repos/[id]/owners/[owner]/page.tsx@@ -8,6 +8,7 @@ import { OwnerProfileView } from "@repowise-dev/ui/owners/owner-profile";import { EmptyState } from "@repowise-dev/ui/shared/empty-state";import { fileEntityPath } from "@repowise-dev/ui/shared/entity";import { formatDate, formatRelativeTimeOrNull } from "@repowise-dev/ui/lib/format";+import { ApiClientError } from "@/lib/api/client";import { getOwnerProfile } from "@/lib/api/owners";export async function generateMetadata(): Promise<Metadata> {@@ -34,7 +35,12 @@ export default async function OwnerProfilePage({const base = `/repos/${id}`;const ownerKey = decodeURIComponent(owner);- const profile = await getOwnerProfile(id, ownerKey).catch(() => null);+ // Only a 404 means "no such contributor"; anything else is a failed+ // request and goes to the route error boundary.+ const profile = await getOwnerProfile(id, ownerKey).catch((e: unknown) => {+ if (e instanceof ApiClientError && e.status === 404) return null;+ throw e;+ });if (!profile) {return (@@ -43,9 +49,9 @@ export default async function OwnerProfilePage({title={t("profileTitle")}><EmptyState- icon={<Users className="h-6 w-6" />}title={t("profileEmptyTitle")}description={t("profileEmptyDescription")}+ action={{ label: t("profileBack"), href: `${base}/owners` }}/></PageShell>);diff --git a/packages/web/src/app/repos/[id]/owners/page.tsx b/packages/web/src/app/repos/[id]/owners/page.tsxindex 034f018c3..6e6ac419a 100644--- a/packages/web/src/app/repos/[id]/owners/page.tsx+++ b/packages/web/src/app/repos/[id]/owners/page.tsx@@ -11,6 +11,7 @@ import {OwnerDirectory,type OwnerDirectoryFilters,} from "@repowise-dev/ui/owners/owner-directory";+import { ApiError } from "@repowise-dev/ui/shared/api-error";import { PageShell } from "@repowise-dev/ui/shared/page-shell";import { useDebounce } from "@/lib/hooks/use-debounce";import { listAllOwners, listOwnersPage } from "@/lib/api/owners";@@ -23,6 +24,7 @@ const DISTRIBUTION_PREFETCH_CAP = 120;export default function OwnersDirectoryPage() {const t = useTranslations("views.contributors");+ const tCommon = useTranslations("common");const { id } = useParams<{ id: string }>();const router = useRouter();const [filters, setFilters] = useState<OwnerDirectoryFilters>({@@ -36,7 +38,7 @@ export default function OwnersDirectoryPage() {[debouncedQ, filters.sort],);- const { data, size, setSize, isLoading, isValidating } = useSWRInfinite<+ const { data, error, mutate, size, setSize, isLoading, isValidating } = useSWRInfinite<Paginated<OwnerListEntry>>((pageIndex, previous) => {@@ -93,6 +95,16 @@ export default function OwnersDirectoryPage() {base={`/repos/${id}`}hrefFor={(o) => `/repos/${id}/owners/${encodeURIComponent(o.key)}`}LinkComponent={Link}+ error={+ error ? (+ <ApiError+ title={t("loadFailedTitle")}+ message={t("loadFailed")}+ retryLabel={tCommon("retry")}+ onRetry={() => void mutate()}+ />+ ) : undefined+ }onSelect={(o) =>router.push(`/repos/${id}/owners/${encodeURIComponent(o.key)}`)}diff --git a/packages/web/src/app/repos/[id]/refactoring/page.tsx b/packages/web/src/app/repos/[id]/refactoring/page.tsxindex e9c72db8c..c928356d7 100644--- a/packages/web/src/app/repos/[id]/refactoring/page.tsx+++ b/packages/web/src/app/repos/[id]/refactoring/page.tsx@@ -19,6 +19,8 @@ import { useRouter } from "next/navigation";import { parseAsString, parseAsStringLiteral, useQueryState } from "nuqs";import { useTranslations } from "next-intl";import { Wrench, RotateCw } from "lucide-react";+import { ApiError } from "@repowise-dev/ui/shared/api-error";+import { EmptyState } from "@repowise-dev/ui/shared/empty-state";import { PageShell } from "@repowise-dev/ui/shared/page-shell";import { ViewTabs } from "@repowise-dev/ui/shared/view-tabs";@@ -294,13 +296,21 @@ export default function RefactoringPage({ params }: { params: Promise<{ id: stritabIndex={0}>{error ? (- <div className="rounded-2xl border border-[var(--color-error)]/30 bg-[var(--color-error)]/5 p-6 text-sm text-[var(--color-text-secondary)]">- {t("loadFailed")}- </div>+ <ApiError+ title={t("loadFailedTitle")}+ message={t("loadFailed")}+ retryLabel={tCommon("retry")}+ onRetry={() => void mutate()}+ />) : data?.summary?.status === "unavailable" ? (- <div className="rounded-2xl border border-[var(--color-border-default)] p-6 text-sm text-[var(--color-text-secondary)]">- {data.summary.detail}- </div>+ <EmptyState+ title={t("unavailableTitle")}+ description={t("unavailableDescription")}+ >+ {data.summary.detail ? (+ <p className="mt-2 text-xs text-[var(--color-text-tertiary)]">{data.summary.detail}</p>+ ) : null}+ </EmptyState>) : isLoading ? (// Matches the real layout's shapes: a lede block, a ribbon, a field.<SkeletonRegion className="space-y-8" label={t("loading")}>