Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

feat(web): calmer Setup rows, one copy-prompt button, neutral focus ring and recessed fields (#4692)

Raghav Chamadiya8c7e92be8bb4
diff --git a/packages/ui/__tests__/coupling/area-coupling.test.tsx b/packages/ui/__tests__/coupling/area-coupling.test.tsx
index 6b1328a5c..0fc60baca 100644
--- a/packages/ui/__tests__/coupling/area-coupling.test.tsx
+++ b/packages/ui/__tests__/coupling/area-coupling.test.tsx
@@ -85,7 +85,7 @@ describe("CouplingAreaPairList", () => {
expect(screen.getAllByText("No import link between the areas")).toHaveLength(1);
expect(screen.getByText("9 file pairs with no direct import (90%)")).toBeTruthy();
expect(screen.getByText("All explained")).toBeTruthy();
- expect(screen.getAllByRole("button", { name: /^Copy prompt for your agent/ })).toHaveLength(1);
+ expect(screen.getAllByRole("button", { name: /^Copy prompt: / })).toHaveLength(1);
expect(screen.getByText(/Showing the top 3 of 6 area pairs/)).toBeTruthy();
fireEvent.click(screen.getByText("packages/server/ ↔ packages/ui/"));
diff --git a/packages/ui/__tests__/dead-code/findings-table.test.tsx b/packages/ui/__tests__/dead-code/findings-table.test.tsx
index 84f090964..b4fc5e20f 100644
--- a/packages/ui/__tests__/dead-code/findings-table.test.tsx
+++ b/packages/ui/__tests__/dead-code/findings-table.test.tsx
@@ -289,7 +289,7 @@ describe("FindingsTable row affordances", () => {
renderTable([finding({ id: "a" }), finding({ id: "b" })], { onGeneratePrompt });
// Per-row: the prompt leads the row, named for the file it is about.
- fireEvent.click(inTable().getByRole("button", { name: "Copy prompt for your agent: src/a.ts" }));
+ fireEvent.click(inTable().getByRole("button", { name: "Copy prompt: src/a.ts" }));
expect(onGeneratePrompt).toHaveBeenCalledWith(["a"]);
// Header: every row the filters show, until there is a selection.
diff --git a/packages/ui/__tests__/health/ai-prompt-button.test.tsx b/packages/ui/__tests__/health/ai-prompt-button.test.tsx
new file mode 100644
index 000000000..c7063ca6a
--- /dev/null
+++ b/packages/ui/__tests__/health/ai-prompt-button.test.tsx
@@ -0,0 +1,60 @@
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { act, fireEvent, render, screen } from "@testing-library/react";
+
+import { AiPromptButton, promptPeek } from "../../src/health/ai-prompt-button";
+
+afterEach(() => {
+ vi.useRealTimers();
+});
+
+describe("AiPromptButton", () => {
+ it("is a soft ink button with a copy icon, never plum", () => {
+ const onClick = vi.fn();
+ render(<AiPromptButton onClick={onClick} />);
+ const button = screen.getByRole("button", { name: "Agent prompt" });
+ expect(button.className).not.toMatch(/color-model/);
+ expect(button.className).toContain("border-[var(--color-border-default)]");
+ expect(button.className).toContain("bg-[var(--color-action-soft)]");
+ expect(button.className).toContain("hover:bg-[var(--color-action-soft-hover)]");
+ expect(button.className).toContain("text-[var(--color-text-primary)]");
+ fireEvent.click(button);
+ expect(onClick).toHaveBeenCalledOnce();
+ });
+
+ it("copies the prompt, says Copied for a moment, then reverts", async () => {
+ vi.useFakeTimers();
+ const writeText = vi.fn().mockResolvedValue(undefined);
+ Object.assign(navigator, { clipboard: { writeText } });
+ render(<AiPromptButton label="Copy prompt" ariaLabel="Copy prompt: Index" copyText={() => "line one\nline two"} />);
+
+ await act(async () => {
+ fireEvent.click(screen.getByRole("button", { name: "Copy prompt: Index" }));
+ });
+ expect(writeText).toHaveBeenCalledWith("line one\nline two");
+ expect(screen.getByRole("button", { name: "Copy prompt: Index" })).toHaveTextContent("Copied");
+ expect(screen.getByText("Copied", { selector: "[aria-live='polite']" })).toBeTruthy();
+
+ act(() => {
+ vi.advanceTimersByTime(1600);
+ });
+ expect(screen.getByRole("button", { name: "Copy prompt: Index" })).toHaveTextContent("Copy prompt");
+ });
+
+ it("says the copy failed, never Copied, when the clipboard is blocked", async () => {
+ Object.assign(navigator, { clipboard: { writeText: vi.fn().mockRejectedValue(new Error("denied")) } });
+ render(<AiPromptButton ariaLabel="Copy prompt: Index" copyText={() => "x"} />);
+ await act(async () => {
+ fireEvent.click(screen.getByRole("button", { name: "Copy prompt: Index" }));
+ });
+ expect(screen.queryByText("Copied")).toBeNull();
+ expect(screen.getByRole("button", { name: "Copy prompt: Index" })).toHaveTextContent("Couldn't copy");
+ expect(screen.getByText("Couldn't copy", { selector: "[aria-live='polite']" })).toBeTruthy();
+ });
+});
+
+describe("promptPeek", () => {
+ it("keeps the first non-empty lines and marks the rest", () => {
+ expect(promptPeek("a\n\nb\nc\nd\ne")).toBe("a\nb\nc\nd\n...");
+ expect(promptPeek("a\nb")).toBe("a\nb");
+ });
+});
diff --git a/packages/ui/__tests__/health/file-health-prompt.test.tsx b/packages/ui/__tests__/health/file-health-prompt.test.tsx
index 2d112e3b5..8f802ef2b 100644
--- a/packages/ui/__tests__/health/file-health-prompt.test.tsx
+++ b/packages/ui/__tests__/health/file-health-prompt.test.tsx
@@ -175,7 +175,7 @@ describe("the drawer's prompt affordance", () => {
reason: "Oversized function.",
};
render(<HealthFileDrawer open onClose={() => {}} metric={m} findings={[f]} />);
- fireEvent.click(screen.getByRole("button", { name: /AI prompt/i }));
+ fireEvent.click(screen.getByRole("button", { name: "Agent prompt" }));
expect(screen.getByText(/AI prompt for this file/i)).toBeInTheDocument();
});
diff --git a/packages/ui/__tests__/health/health-file-drawer-flow.test.tsx b/packages/ui/__tests__/health/health-file-drawer-flow.test.tsx
index 2c1fd6958..78e541a71 100644
--- a/packages/ui/__tests__/health/health-file-drawer-flow.test.tsx
+++ b/packages/ui/__tests__/health/health-file-drawer-flow.test.tsx
@@ -189,7 +189,7 @@ describe("HealthFileDrawer verdict", () => {
// Ink, not accent: the accent is the primary action's alone (focus rings aside).
expect(plan.className).toContain("text-[var(--color-text-secondary)]");
expect(plan.className).not.toMatch(/(^|\s)text-\[var\(--color-accent/);
- expect(screen.getAllByRole("button", { name: /Fix with AI prompt/ })).toHaveLength(1);
+ expect(screen.getAllByRole("button", { name: "Agent prompt" })).toHaveLength(1);
});
});
@@ -434,7 +434,7 @@ describe("HealthFileDrawer honest states", () => {
it("keeps the prompt and makes no all-clear for a low score with nothing loaded", () => {
render(<HealthFileDrawer open onClose={() => {}} metric={metric({ score: 3.2 })} />);
expect(screen.queryByText(/Nothing needs fixing/)).not.toBeInTheDocument();
- expect(screen.getByRole("button", { name: /Fix with AI prompt/ })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Agent prompt" })).toBeInTheDocument();
});
it("does not call the file clean after its last issue is resolved here", async () => {
diff --git a/packages/ui/__tests__/health/performance-view.test.tsx b/packages/ui/__tests__/health/performance-view.test.tsx
index 6b431e9a1..f88cd3da9 100644
--- a/packages/ui/__tests__/health/performance-view.test.tsx
+++ b/packages/ui/__tests__/health/performance-view.test.tsx
@@ -220,7 +220,7 @@ describe("PerformanceView queue", () => {
expect(within(first!).getByText(/2 call sites across 2 files/)).toBeTruthy();
expect(within(first!).getByText("Plan ready")).toBeTruthy();
expect(
- within(first!).getByRole("button", { name: /^Copy prompt for your agent: Database call/ }),
+ within(first!).getByRole("button", { name: /^Copy prompt: Database call/ }),
).toBeTruthy();
expect(within(first!).getByRole("link", { name: "Open plan" })).toBeTruthy();
// The file is one verb among the row's others, behind its menu.
@@ -621,7 +621,7 @@ describe("PerformanceView drawer", () => {
render(<PerformanceView adapter={adapter({ getRefactoringPlan: async () => exact })} />);
await openFirstRow();
const panel = await screen.findByRole("dialog");
- fireEvent.click(within(panel).getByRole("button", { name: "Copy prompt for your agent" }));
+ fireEvent.click(within(panel).getByRole("button", { name: "Copy prompt" }));
expect(await screen.findByText("Prompt for your agent")).toBeTruthy();
expect(await screen.findByText(/chars, approx/)).toBeTruthy();
expect(document.body.textContent).not.toContain("Causal performance opportunity");
@@ -652,7 +652,7 @@ describe("PerformanceView drawer", () => {
);
await openFirstRow();
const panel = await screen.findByRole("dialog");
- fireEvent.click(within(panel).getByRole("button", { name: "Copy prompt for your agent" }));
+ fireEvent.click(within(panel).getByRole("button", { name: "Copy prompt" }));
expect(await screen.findByText(/served plan-1 generic/)).toBeTruthy();
expect(served).toHaveBeenCalledWith("plan-1", "generic");
});
@@ -661,7 +661,7 @@ describe("PerformanceView drawer", () => {
render(<PerformanceView adapter={adapter()} />);
await openFirstRow();
const panel = await screen.findByRole("dialog");
- fireEvent.click(within(panel).getByRole("button", { name: "Copy prompt for your agent" }));
+ fireEvent.click(within(panel).getByRole("button", { name: "Copy prompt" }));
expect(await screen.findByText(/Causal performance opportunity/)).toBeTruthy();
});
@@ -669,7 +669,7 @@ describe("PerformanceView drawer", () => {
const served = vi.fn(async (planId: string, flavor: string) => `served ${planId} ${flavor}`);
render(<PerformanceView adapter={adapter({ getRefactoringPlanPrompt: served })} />);
const [first] = await rows();
- fireEvent.click(within(first!).getByRole("button", { name: /^Copy prompt for your agent:/ }));
+ fireEvent.click(within(first!).getByRole("button", { name: /^Copy prompt:/ }));
// No plan fetch on this host, so the evidence handoff, and no drawer.
expect(await screen.findByText(/Causal performance opportunity/)).toBeTruthy();
expect(screen.queryByText("Show this cause on the map")).toBeNull();
diff --git a/packages/ui/__tests__/health/row-prompt-action.test.tsx b/packages/ui/__tests__/health/row-prompt-action.test.tsx
index b062aae9d..b535f7c26 100644
--- a/packages/ui/__tests__/health/row-prompt-action.test.tsx
+++ b/packages/ui/__tests__/health/row-prompt-action.test.tsx
@@ -12,14 +12,18 @@ describe("RowPromptAction", () => {
<RowPromptAction subject="src/a.ts" onClick={onClick} />
</div>,
);
- const button = screen.getByRole("button", { name: "Copy prompt for your agent: src/a.ts" });
- expect(button).toHaveTextContent("Copy prompt for your agent");
+ const button = screen.getByRole("button", { name: "Copy prompt: src/a.ts" });
+ expect(button).toHaveTextContent("Copy prompt");
expect(button.className).toMatch(/opacity-0/);
expect(button.className).toMatch(/group-hover\/row:opacity-100/);
expect(button.className).toMatch(/group-focus-within\/row:opacity-100/);
expect(button.className).toMatch(/focus-visible:opacity-100/);
- // No resting fill: the model tint appears on hover only.
- expect(button.className.split(" ")).not.toContain("bg-[var(--color-model-muted)]");
+ expect(button.className).toMatch(/\[@media\(hover:none\)\]:opacity-100/);
+ // Neutral ink: plum is kept for model work.
+ expect(button.className).not.toMatch(/color-model/);
+ // Revealed, it reads as an action: ink label, soft fill on hover.
+ expect(button.className).toContain("text-[var(--color-text-primary)]");
+ expect(button.className).toContain("hover:bg-[var(--color-action-soft-hover)]");
fireEvent.click(button);
expect(onClick).toHaveBeenCalledOnce();
// The row's own click (open the file) does not fire as well.
@@ -27,6 +31,19 @@ describe("RowPromptAction", () => {
});
});
+describe("RowPromptAction icon variant", () => {
+ it("drops the visible label and keeps the row's name as the accessible name", () => {
+ render(
+ <div className="group/row">
+ <RowPromptAction variant="icon" label="Fix a.ts:3" onClick={vi.fn()} />
+ </div>,
+ );
+ const button = screen.getByRole("button", { name: "Fix a.ts:3" });
+ expect(button).toHaveTextContent("");
+ expect(button.className).toMatch(/opacity-0/);
+ });
+});
+
describe("PromptForRowsButton", () => {
it("counts the rows it covers and renders nothing for none", () => {
const onClick = vi.fn();
diff --git a/packages/ui/__tests__/health/setup-prompt.test.ts b/packages/ui/__tests__/health/setup-prompt.test.ts
index d0c0ef957..026aa0873 100644
--- a/packages/ui/__tests__/health/setup-prompt.test.ts
+++ b/packages/ui/__tests__/health/setup-prompt.test.ts
@@ -10,28 +10,45 @@ const SYNC: SetupPromptRow = {
};
describe("buildSetupAiPrompt", () => {
- it("carries the repo, the detected state, the exact command and the status check", () => {
+ it("names the repo, what was found, the command and the status check", () => {
const prompt = buildSetupAiPrompt(SYNC);
- expect(prompt).toContain("## Setup: Keep the index in sync (`orbit-api`)");
- expect(prompt).toContain(`What repowise detected: ${SYNC.state}`);
- expect(prompt).toContain("```\nrepowise hook install\n```");
- expect(prompt).toContain("`repowise status`");
- expect(prompt).not.toContain("Confirm with me before changing anything");
+ expect(prompt).toContain(
+ "repowise reports for orbit-api: Keep the index in sync. The post-commit hook is not installed, so the index updates only on `repowise update`.",
+ );
+ expect(prompt).toContain(
+ "Run `repowise hook install` from the repository root, then run `repowise status` and tell me what it reports.",
+ );
+ expect(prompt).not.toContain("once I agree");
});
- it("asks a fix to confirm before changing anything and verifies with doctor", () => {
+ it("words a doctor finding with a fix as one ask that does not contradict itself", () => {
const prompt = buildSetupAiPrompt({
- ...SYNC,
- title: "Index",
+ repoName: "orbit-api",
+ title: "Post-commit hook",
+ state: "not installed.",
+ command: "repowise hook install",
+ verify: "doctor",
+ fix: true,
+ fromDoctor: true,
+ });
+ expect(prompt).toContain(
+ "`repowise doctor` in orbit-api reports: Post-commit hook, not installed. The fix is `repowise hook install`. Tell me what it changes, run it once I agree, then run `repowise doctor` again to check.",
+ );
+ expect(prompt).not.toMatch(/to confirm|until I confirm/);
+ });
+
+ it("asks for the cause when no single command fixes it, and lists the items", () => {
+ const prompt = buildSetupAiPrompt({
+ repoName: "orbit-api",
+ title: "Files that could not be parsed",
state: "3 files could not be parsed.",
- command: "repowise doctor --format json",
verify: "doctor",
fix: true,
items: ["src/legacy/report.py", "scripts/gen.py"],
});
- expect(prompt).toContain("Confirm with me before changing anything");
- expect(prompt).toContain("Find out why first");
- expect(prompt).toContain("`repowise doctor --format json` afterwards");
+ expect(prompt).toContain("No single command fixes this. Find the cause");
+ expect(prompt).toContain("then run `repowise doctor` to check.");
+ expect(prompt).not.toContain("The fix is");
expect(prompt).toContain("- `src/legacy/report.py`\n- `scripts/gen.py`");
});
diff --git a/packages/ui/__tests__/overview/next-actions.test.tsx b/packages/ui/__tests__/overview/next-actions.test.tsx
index ba0050f44..bfc2e9051 100644
--- a/packages/ui/__tests__/overview/next-actions.test.tsx
+++ b/packages/ui/__tests__/overview/next-actions.test.tsx
@@ -194,7 +194,7 @@ describe("the row prompt", () => {
it("opens the agent prompt from the row without opening the drawer", async () => {
const loadPrompt = vi.fn().mockResolvedValue("Prompt from core");
render(<NextActions data={response([], [action()])} hrefFor={() => null} loadPrompt={loadPrompt} />);
- fireEvent.click(screen.getByRole("button", { name: /Copy prompt for your agent: Raise test coverage/ }));
+ fireEvent.click(screen.getByRole("button", { name: /Copy prompt: Raise test coverage/ }));
const dialog = await screen.findByRole("dialog");
expect(await within(dialog).findByText("Prompt from core")).toBeInTheDocument();
expect(within(dialog).queryByText("Why it is on the list")).toBeNull();
@@ -203,7 +203,7 @@ describe("the row prompt", () => {
it("is absent when the host has no prompt", () => {
render(<NextActions data={response([], [action()])} hrefFor={() => null} />);
- expect(screen.queryByRole("button", { name: /Copy prompt for your agent/ })).toBeNull();
+ expect(screen.queryByRole("button", { name: /Copy prompt/ })).toBeNull();
});
});
diff --git a/packages/ui/__tests__/owners/ownership-lede.test.tsx b/packages/ui/__tests__/owners/ownership-lede.test.tsx
index 4104452f1..c075f38cb 100644
--- a/packages/ui/__tests__/owners/ownership-lede.test.tsx
+++ b/packages/ui/__tests__/owners/ownership-lede.test.tsx
@@ -42,7 +42,7 @@ describe("OwnershipLede", () => {
expect(screen.getByText("74%", { selector: "*:not(p)" })).toBeTruthy();
expect(screen.getByText("Well shared")).toBeTruthy();
expect(screen.getByText(/has two or more people who know it/)).toBeTruthy();
- expect(screen.getByRole("button", { name: /Copy prompt for your agent/ })).toBeTruthy();
+ expect(screen.getByRole("button", { name: /Copy prompt/ })).toBeTruthy();
});
it("reads plain when low and never names the truck-factor person", () => {
diff --git a/packages/ui/__tests__/refactoring/opportunity-drawer.test.tsx b/packages/ui/__tests__/refactoring/opportunity-drawer.test.tsx
index 0b739f3b4..57b135b8a 100644
--- a/packages/ui/__tests__/refactoring/opportunity-drawer.test.tsx
+++ b/packages/ui/__tests__/refactoring/opportunity-drawer.test.tsx
@@ -77,7 +77,7 @@ describe("OpportunityDrawer steps unavailable", () => {
expect(screen.getByText(/The 7 steps for this refactoring plan could not be loaded/)).toBeTruthy();
expect(screen.queryByText(/Showing 0 of/)).toBeNull();
// The prompt is built from the steps, so it is not offered without them.
- expect(screen.queryByRole("button", { name: /Copy prompt/ })).toBeNull();
+ expect(screen.queryByRole("button", { name: /Agent prompt/ })).toBeNull();
});
it("says nothing about missing steps when they loaded", () => {
@@ -85,7 +85,7 @@ describe("OpportunityDrawer steps unavailable", () => {
expect(screen.queryByText(/could not be loaded/)).toBeNull();
expect(screen.getByText("Showing 0 of 12 steps.")).toBeTruthy();
- expect(screen.getByRole("button", { name: /Copy prompt/ })).toBeTruthy();
+ expect(screen.getByRole("button", { name: /Agent prompt/ })).toBeTruthy();
});
});
diff --git a/packages/ui/__tests__/shared/hairline-card.test.ts b/packages/ui/__tests__/shared/hairline-card.test.ts
index 0e4ecedc7..ff2b20411 100644
--- a/packages/ui/__tests__/shared/hairline-card.test.ts
+++ b/packages/ui/__tests__/shared/hairline-card.test.ts
@@ -22,10 +22,10 @@ describe("hairlineCardClass", () => {
expect(classes.some((c) => c.includes("ring-"))).toBe(false);
});
- it("puts the accent only on the focus ring of a card that is itself a control", () => {
+ it("gives a card that is itself a control the neutral focus ring and no accent", () => {
const classes = tokens("link");
- expect(classes).toContain("focus-visible:ring-[var(--color-accent-primary)]");
- expect(classes.filter((c) => c.includes("accent")).every((c) => c.startsWith("focus-visible:"))).toBe(true);
+ expect(classes).toContain("focus-visible:ring-[var(--color-focus-ring)]");
+ expect(classes.some((c) => c.includes("accent"))).toBe(false);
});
it("holds the strong hairline with a faint accent ring when highlighted", () => {
diff --git a/packages/ui/__tests__/ui/button.test.tsx b/packages/ui/__tests__/ui/button.test.tsx
index 1f531882f..20bc5f181 100644
--- a/packages/ui/__tests__/ui/button.test.tsx
+++ b/packages/ui/__tests__/ui/button.test.tsx
@@ -8,9 +8,10 @@ describe("Button", () => {
const btn = screen.getByRole("button", { name: "Click me" });
expect(btn).toBeInTheDocument();
expect(btn.className).toMatch(/inline-flex/);
- // Primary actions are ink; orange stays on the focus ring only.
+ // Primary actions are ink and the focus ring is the neutral focus token.
expect(btn.className).toContain("bg-[var(--color-action-primary)]");
expect(btn.className).not.toMatch(/accent-fill|gradient-ember/);
+ expect(btn.className).toContain("ring-[var(--color-focus-ring)]");
});
it("applies the destructive variant class when requested", () => {
diff --git a/packages/ui/__tests__/ui/input.test.tsx b/packages/ui/__tests__/ui/input.test.tsx
new file mode 100644
index 000000000..3d2f79ea3
--- /dev/null
+++ b/packages/ui/__tests__/ui/input.test.tsx
@@ -0,0 +1,22 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { Input } from "../../src/ui/input.js";
+
+describe("Input", () => {
+ it("is a recessed field that lifts to the surface on focus", () => {
+ render(<Input aria-label="Name" />);
+ const field = screen.getByRole("textbox", { name: "Name" });
+ expect(field.className).toContain("bg-[var(--color-field-bg)]");
+ expect(field.className).toContain("border-[var(--color-field-border)]");
+ expect(field.className).toContain("hover:border-[var(--color-field-border-hover)]");
+ expect(field.className).toContain("focus-visible:bg-[var(--color-bg-surface)]");
+ expect(field.className).toContain("focus-visible:ring-[var(--color-focus-ring)]");
+ });
+
+ it("dims a disabled value's text, not the whole box", () => {
+ render(<Input aria-label="Branch" disabled defaultValue="main" />);
+ const field = screen.getByRole("textbox", { name: "Branch" });
+ expect(field.className).not.toContain("disabled:opacity-50");
+ expect(field.className).toContain("disabled:text-[var(--color-text-secondary)]");
+ });
+});
diff --git a/packages/ui/__tests__/workspace/contract-drawer.test.tsx b/packages/ui/__tests__/workspace/contract-drawer.test.tsx
index af84b3cfc..34dd7c06d 100644
--- a/packages/ui/__tests__/workspace/contract-drawer.test.tsx
+++ b/packages/ui/__tests__/workspace/contract-drawer.test.tsx
@@ -100,7 +100,7 @@ describe("ContractDrawer", () => {
expect(screen.getByText("92%")).toBeInTheDocument();
expect(screen.getByText("fastapi")).toBeInTheDocument();
expect(screen.getByText("Framework registration")).toBeInTheDocument();
- expect(screen.getByRole("button", { name: "AI prompt" })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Agent prompt" })).toBeInTheDocument();
});
it("links the file and the counterpart code, and swaps to the counterpart", () => {
diff --git a/packages/ui/__tests__/workspace/repo-pair-table.test.tsx b/packages/ui/__tests__/workspace/repo-pair-table.test.tsx
index 134778dc0..2303fcd1d 100644
--- a/packages/ui/__tests__/workspace/repo-pair-table.test.tsx
+++ b/packages/ui/__tests__/workspace/repo-pair-table.test.tsx
@@ -27,7 +27,7 @@ describe("RepoPairTable", () => {
<RepoPairTable repoPairs={[p]} onSelectPair={onSelect} onPrompt={onPrompt} selectedPairId={p.id} />,
);
expect(screen.getByText("Showing only these")).toBeInTheDocument();
- fireEvent.click(screen.getByRole("button", { name: "AI prompt for api and core" }));
+ fireEvent.click(screen.getByRole("button", { name: "Copy prompt for api and core" }));
expect(onPrompt).toHaveBeenCalledWith(p);
expect(onSelect).not.toHaveBeenCalled();
});
diff --git a/packages/ui/__tests__/workspace/workspace-next-actions.test.tsx b/packages/ui/__tests__/workspace/workspace-next-actions.test.tsx
index c49573df7..b6c8fd617 100644
--- a/packages/ui/__tests__/workspace/workspace-next-actions.test.tsx
+++ b/packages/ui/__tests__/workspace/workspace-next-actions.test.tsx
@@ -125,7 +125,7 @@ describe("WorkspaceNextActions", () => {
loadPrompt={loadPrompt}
/>,
);
- fireEvent.click(screen.getByRole("button", { name: /Copy prompt for your agent: Clean up/ }));
+ fireEvent.click(screen.getByRole("button", { name: /Copy prompt: Clean up/ }));
const dialog = await screen.findByRole("dialog");
expect(await within(dialog).findByText("Row prompt")).toBeInTheDocument();
expect(loadPrompt).toHaveBeenCalledWith("f1", expect.objectContaining({ id: "y" }), expect.any(String));
diff --git a/packages/ui/scripts/contrast-check.py b/packages/ui/scripts/contrast-check.py
index 513e1d7a2..3e97a248e 100755
--- a/packages/ui/scripts/contrast-check.py
+++ b/packages/ui/scripts/contrast-check.py
@@ -106,6 +106,10 @@ LIGHT = {
"bg-canvas": "#F0EBE6", # --color-bg-canvas → var(--color-bg-inset)
"text-primary": "#241B2C",
"text-secondary": "#5E5360",
+ "focus-ring": "#5E5360", # --color-focus-ring → var(--color-text-secondary)
+ "field-bg": "#F5F1ED",
+ # --color-action-soft-hover (ink 11%) composited on the page and a card.
+ "action-soft-page": "#E3DEDB", "action-soft-card": "#E7E6E8",
"text-tertiary": "#8C7F88",
"text-inverse": "#FFFFFF",
"text-on-accent": "#241B2C",
@@ -160,6 +164,10 @@ DARK = {
"bg-canvas": "#0A0A0B", # --color-bg-canvas → var(--color-bg-inset)
"text-primary": "#EEEAF4",
"text-secondary": "#A79DB3",
+ "focus-ring": "#A79DB3", # --color-focus-ring → var(--color-text-secondary)
+ "field-bg": "#101012",
+ # --color-action-soft-hover (white 12%) composited on a card and elevated.
+ "action-soft-page": "#353537", "action-soft-card": "#303032",
"text-tertiary": "#786F84",
"text-inverse": "#17131D",
"text-on-accent": "#17131D",
@@ -228,6 +236,15 @@ CHECKS = [
("text-secondary", "bg-surface", 3.0, "Progress and data bar on card"),
("text-secondary", "bg-inset", 3.0, "Progress and data bar on inset track"),
("text-secondary", "bg-elevated", 3.0, "Progress and data bar on elevated track"),
+ # Keyboard focus ring (non-text, 3:1) on every ground a control sits on.
+ *[("focus-ring", bg, 3.0, f"Focus ring on {bg}") for bg in ("bg-root", "bg-surface", "bg-elevated", "bg-inset")],
+ # Form fields: the value, a disabled value and the placeholder on the well.
+ ("text-primary", "field-bg", 7.0, "Field value"),
+ ("text-secondary", "field-bg", 4.5, "Disabled field value"),
+ ("text-tertiary", "field-bg", 3.0, "Field placeholder"),
+ # Soft-ink copy-prompt button: its label at the hovered (strongest) fill.
+ ("text-primary", "action-soft-page", 4.5, "Soft action label on page"),
+ ("text-primary", "action-soft-card", 4.5, "Soft action label on card"),
("success", "bg-surface", 4.5, "Success text on card"),
("warning", "bg-surface", 4.5, "Warning text on card"),
("warning", "bg-root", 4.5, "Warning text on page"),
diff --git a/packages/ui/src/blast-radius/impact-view.tsx b/packages/ui/src/blast-radius/impact-view.tsx
index 46c825727..178022c76 100644
--- a/packages/ui/src/blast-radius/impact-view.tsx
+++ b/packages/ui/src/blast-radius/impact-view.tsx
@@ -191,7 +191,7 @@ export function ImpactView({
max={10}
value={maxDepth}
onChange={(e) => setMaxDepth(Math.max(1, Math.min(10, Number(e.target.value))))}
- className="w-16 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-primary)]"
+ className="w-16 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-focus-ring)]"
aria-label="Maximum dependency depth (1–10)"
/>
</label>
diff --git a/packages/ui/src/cards/evidence-card.tsx b/packages/ui/src/cards/evidence-card.tsx
index d57389853..855c79dcd 100644
--- a/packages/ui/src/cards/evidence-card.tsx
+++ b/packages/ui/src/cards/evidence-card.tsx
@@ -84,7 +84,7 @@ export function RefView({ cardRef, buildRefHref }: { cardRef: CardRef; buildRefH
<a
href={href}
title={cardRef.id}
- className={`${className} text-[var(--color-accent-primary)] rounded-sm underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]`}
+ className={`${className} text-[var(--color-accent-primary)] rounded-sm underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]`}
>
{label}
</a>
@@ -175,7 +175,7 @@ export function EvidenceCardView({ card, buildRefHref }: EvidenceCardViewProps)
return (
<li key={i} className="text-xs">
{href ? (
- <a href={href} className="text-[var(--color-accent-primary)] rounded-sm underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">
+ <a href={href} className="text-[var(--color-accent-primary)] rounded-sm underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]">
{link.label}
</a>
) : (
diff --git a/packages/ui/src/chat/artifact-panel.tsx b/packages/ui/src/chat/artifact-panel.tsx
index 2ad5cdf12..01e35af3b 100644
--- a/packages/ui/src/chat/artifact-panel.tsx
+++ b/packages/ui/src/chat/artifact-panel.tsx
@@ -92,7 +92,7 @@ function ArtifactHeader({ artifact, comparing, onCompare, onPin, onOpenSource, o
URL.revokeObjectURL(url);
setStatus("Artifact exported.");
}, [artifact]);
- const actionClass = "inline-flex h-8 items-center gap-1.5 px-2 text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ const actionClass = "inline-flex h-8 items-center gap-1.5 px-2 text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
return (
<header className="border-b border-[var(--color-border-default)] pb-4">
<div className="flex items-start justify-between gap-3">
diff --git a/packages/ui/src/chat/artifacts.tsx b/packages/ui/src/chat/artifacts.tsx
index 78b80d469..ffc51aa9e 100644
--- a/packages/ui/src/chat/artifacts.tsx
+++ b/packages/ui/src/chat/artifacts.tsx
@@ -423,7 +423,7 @@ function ChangeRiskCard({ data }: { data: RiskReportArtifactData }) {
fragile.length > 0 ||
data.classification) && (
<details>
- <summary className="cursor-pointer text-xs text-[var(--color-text-tertiary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">
+ <summary className="cursor-pointer text-xs text-[var(--color-text-tertiary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]">
More detail
</summary>
<div className="mt-2 space-y-2">
diff --git a/packages/ui/src/chat/ask-about-this.tsx b/packages/ui/src/chat/ask-about-this.tsx
index 7d8c69ca6..c3c604e84 100644
--- a/packages/ui/src/chat/ask-about-this.tsx
+++ b/packages/ui/src/chat/ask-about-this.tsx
@@ -51,7 +51,7 @@ export function AskAboutThis({
});
}}
className={cn(
- "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] motion-reduce:transition-none",
+ "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] motion-reduce:transition-none",
className,
)}
>
diff --git a/packages/ui/src/chat/chat-composer.tsx b/packages/ui/src/chat/chat-composer.tsx
index dc8e2fe53..41994b399 100644
--- a/packages/ui/src/chat/chat-composer.tsx
+++ b/packages/ui/src/chat/chat-composer.tsx
@@ -106,7 +106,7 @@ export function ChatComposer({
<button
type="button"
className={cn(
- "flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-surface)] disabled:cursor-not-allowed motion-reduce:transition-none",
+ "flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-surface)] disabled:cursor-not-allowed motion-reduce:transition-none",
isStreaming
? "border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] hover:border-[var(--color-border-hover)]"
: hasText && !disabled
diff --git a/packages/ui/src/chat/chat-context-indicator.tsx b/packages/ui/src/chat/chat-context-indicator.tsx
index b15fa0e7d..8ec32e5f5 100644
--- a/packages/ui/src/chat/chat-context-indicator.tsx
+++ b/packages/ui/src/chat/chat-context-indicator.tsx
@@ -38,7 +38,7 @@ export function ChatContextIndicator({
onClick={onRemove}
aria-label="Remove current view from this message"
title="Remove current view"
- className="ml-auto inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="ml-auto inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-3.5 w-3.5" />
</button>
diff --git a/packages/ui/src/chat/chat-dock.tsx b/packages/ui/src/chat/chat-dock.tsx
index 767ae01ac..def62ca2d 100644
--- a/packages/ui/src/chat/chat-dock.tsx
+++ b/packages/ui/src/chat/chat-dock.tsx
@@ -397,7 +397,7 @@ export function ChatDock({
? `Open repository chat, ${error ? "chat needs attention" : "answer ready"}`
: "Open repository chat"
}
- className="group flex min-h-11 items-center gap-2 rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] py-1.5 pl-1.5 pr-3 shadow-[var(--shadow-md)] outline-none transition-[border-color,box-shadow,transform] hover:border-[var(--color-border-hover)] hover:shadow-[var(--shadow-lg)] focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] motion-safe:hover:-translate-y-px motion-reduce:transition-none"
+ className="group flex min-h-11 items-center gap-2 rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] py-1.5 pl-1.5 pr-3 shadow-[var(--shadow-md)] outline-none transition-[border-color,box-shadow,transform] hover:border-[var(--color-border-hover)] hover:shadow-[var(--shadow-lg)] focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] motion-safe:hover:-translate-y-px motion-reduce:transition-none"
>
<span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--color-bg-elevated)]">
<BrandMark
@@ -434,7 +434,7 @@ export function ChatDock({
onClick={onDismiss}
aria-label="Hide Ask Repowise"
title="Hide Ask Repowise. Bring it back in Settings."
- className="absolute -right-1.5 -top-1.5 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-tertiary)] shadow-[var(--shadow-md)] transition-opacity before:absolute before:-inset-1.5 before:content-[''] hover:text-[var(--color-text-primary)] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] pointer-fine:opacity-0 pointer-fine:group-hover/dock:opacity-100 motion-reduce:transition-none"
+ className="absolute -right-1.5 -top-1.5 flex h-6 w-6 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-tertiary)] shadow-[var(--shadow-md)] transition-opacity before:absolute before:-inset-1.5 before:content-[''] hover:text-[var(--color-text-primary)] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] pointer-fine:opacity-0 pointer-fine:group-hover/dock:opacity-100 motion-reduce:transition-none"
>
<X className="h-3 w-3" />
</button>
@@ -573,7 +573,7 @@ export function ChatDock({
<button
type="button"
onClick={onOpenFullChat}
- className="inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<MessageCircle className="h-3.5 w-3.5" />
Full chat
diff --git a/packages/ui/src/chat/chat-interface.tsx b/packages/ui/src/chat/chat-interface.tsx
index b7f7e003f..7b540584b 100644
--- a/packages/ui/src/chat/chat-interface.tsx
+++ b/packages/ui/src/chat/chat-interface.tsx
@@ -446,7 +446,7 @@ export function ChatInterface({
<button
type="button"
onClick={() => void onRetry(lastMessage)}
- className="inline-flex h-8 items-center rounded-md px-2 text-xs font-medium hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-8 items-center rounded-md px-2 text-xs font-medium hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
Retry
</button>
@@ -463,7 +463,7 @@ export function ChatInterface({
aria-pressed={isFollowingLive}
aria-label="Jump to latest"
title="Jump to latest"
- className="absolute bottom-3 left-1/2 z-10 flex h-8 w-8 print:hidden -translate-x-1/2 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] text-[var(--color-text-secondary)] shadow-[var(--shadow-sm)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="absolute bottom-3 left-1/2 z-10 flex h-8 w-8 print:hidden -translate-x-1/2 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] text-[var(--color-text-secondary)] shadow-[var(--shadow-sm)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<ArrowDown className="h-4 w-4" />
</button>
diff --git a/packages/ui/src/chat/chat-selection-affordance.tsx b/packages/ui/src/chat/chat-selection-affordance.tsx
index b3e3b149e..4974ca570 100644
--- a/packages/ui/src/chat/chat-selection-affordance.tsx
+++ b/packages/ui/src/chat/chat-selection-affordance.tsx
@@ -205,7 +205,7 @@ export function ChatSelectionAffordance({
setPlacement(null);
}}
style={{ top: placement.top, left: placement.left }}
- className="fixed z-[calc(var(--z-modal)-1)] inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] px-2.5 text-xs text-[var(--color-text-secondary)] shadow-[var(--shadow-md)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="fixed z-[calc(var(--z-modal)-1)] inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] px-2.5 text-xs text-[var(--color-text-secondary)] shadow-[var(--shadow-md)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<MessageCircleQuestion className="h-3.5 w-3.5" aria-hidden />
{label}
diff --git a/packages/ui/src/chat/chat-suggestions.tsx b/packages/ui/src/chat/chat-suggestions.tsx
index cc3469b77..0d105c860 100644
--- a/packages/ui/src/chat/chat-suggestions.tsx
+++ b/packages/ui/src/chat/chat-suggestions.tsx
@@ -46,7 +46,7 @@ export function ChatSuggestions({
type="button"
data-chat-suggestion={suggestion.source}
onClick={() => onSelect(suggestion)}
- className="rounded-full border border-[var(--color-border-default)] px-2.5 py-1 text-left text-xs text-[var(--color-text-tertiary)] hover:border-[var(--color-border-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-full border border-[var(--color-border-default)] px-2.5 py-1 text-left text-xs text-[var(--color-text-tertiary)] hover:border-[var(--color-border-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{suggestion.text}
</button>
@@ -71,7 +71,7 @@ export function ChatSuggestions({
<button
type="button"
data-chat-suggestion={suggestion.source}
- className="group flex w-full items-center gap-3 border-b border-[var(--color-border-default)] py-3 text-left text-[15px] text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="group flex w-full items-center gap-3 border-b border-[var(--color-border-default)] py-3 text-left text-[15px] text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
onClick={() => onSelect(suggestion)}
>
<span className="min-w-0 flex-1">{suggestion.text}</span>
diff --git a/packages/ui/src/chat/conversation-history.tsx b/packages/ui/src/chat/conversation-history.tsx
index 2f652a579..ad56a81cf 100644
--- a/packages/ui/src/chat/conversation-history.tsx
+++ b/packages/ui/src/chat/conversation-history.tsx
@@ -86,8 +86,8 @@ export function ConversationHistory({
const panel = (
<div ref={panelRef} {...(variant === "popover" ? { role: "dialog", "aria-label": "Conversation history" } : {})} className={cn("flex min-h-0 flex-col bg-[var(--color-bg-surface)]", variant === "rail" ? "h-full border-r border-[var(--color-border-default)]" : "max-h-[min(70dvh,560px)] w-80 overflow-hidden rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-[var(--shadow-lg)]")}>
<div className="flex items-center gap-1 border-b border-[var(--color-border-default)] p-2">
- <button type="button" onClick={() => { onNew(); closePopover(); }} className="flex min-h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-xs text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><Plus className="h-3.5 w-3.5 shrink-0" /> <span className="truncate">New conversation</span></button>
- {variant === "rail" && collapsible && <button type="button" onClick={() => updateRailCollapsed(true)} aria-label="Collapse conversation history" title="Collapse history" className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><PanelLeftClose className="h-4 w-4" /></button>}
+ <button type="button" onClick={() => { onNew(); closePopover(); }} className="flex min-h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-xs text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"><Plus className="h-3.5 w-3.5 shrink-0" /> <span className="truncate">New conversation</span></button>
+ {variant === "rail" && collapsible && <button type="button" onClick={() => updateRailCollapsed(true)} aria-label="Collapse conversation history" title="Collapse history" className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"><PanelLeftClose className="h-4 w-4" /></button>}
</div>
<label className="m-2 flex min-h-9 items-center gap-2 border-b border-[var(--color-border-default)] px-1 focus-within:border-[var(--color-border-hover)]"><Search className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" /><span className="sr-only">Search conversations</span><input value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Search history" className="min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text-primary)] !outline-none placeholder:text-[var(--color-text-tertiary)]" /></label>
<div className="min-h-0 flex-1 overflow-y-auto px-2 pb-2">
@@ -103,7 +103,7 @@ export function ConversationHistory({
{editing?.id === conversation.id ? (
<form className="flex gap-1 p-2" onSubmit={(event) => { event.preventDefault(); const title = editing.title.trim(); if (title) void onRename?.(conversation.id, title); setEditing(null); }}><input autoFocus value={editing.title} onChange={(event) => setEditing({ id: conversation.id, title: event.target.value })} aria-label="Conversation title" className="min-w-0 flex-1 border-b border-[var(--color-accent-primary)] bg-transparent text-xs text-[var(--color-text-primary)] outline-none" /><button className="min-h-8 px-2 text-xs text-[var(--color-text-secondary)]">Save</button></form>
) : (
- <button type="button" onClick={() => { onSelect(conversation.id); closePopover(); }} className="w-full py-2 pl-2 pr-[7.5rem] text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] sm:pr-2"><span className="block text-xs leading-4 text-[var(--color-text-primary)] [overflow-wrap:anywhere]">{conversation.title}</span><span className="mt-0.5 block truncate font-mono text-[10px] tabular-nums text-[var(--color-text-tertiary)]">{formatRelativeTime(conversation.updated_at)} · {conversation.message_count} msgs</span></button>
+ <button type="button" onClick={() => { onSelect(conversation.id); closePopover(); }} className="w-full py-2 pl-2 pr-[7.5rem] text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:pr-2"><span className="block text-xs leading-4 text-[var(--color-text-primary)] [overflow-wrap:anywhere]">{conversation.title}</span><span className="mt-0.5 block truncate font-mono text-[10px] tabular-nums text-[var(--color-text-tertiary)]">{formatRelativeTime(conversation.updated_at)} · {conversation.message_count} msgs</span></button>
)}
<div className="absolute right-1 top-1 flex items-center justify-end gap-0.5 opacity-70 sm:rounded sm:opacity-0 sm:group-hover:bg-[var(--color-bg-overlay)] sm:group-hover:opacity-100 sm:group-focus-within:bg-[var(--color-bg-overlay)] sm:group-focus-within:opacity-100 sm:pointer-events-none sm:group-hover:pointer-events-auto sm:group-focus-within:pointer-events-auto">
{onRename && <button type="button" onClick={() => setEditing({ id: conversation.id, title: conversation.title })} aria-label="Rename conversation" className="flex h-7 w-7 items-center justify-center rounded text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-overlay)] hover:text-[var(--color-text-primary)]"><Pencil className="h-3.5 w-3.5" /></button>}
@@ -124,11 +124,11 @@ export function ConversationHistory({
if (variant === "rail" && collapsible && railCollapsed) return (
<aside aria-label="Conversation history" data-collapsed="true" className={cn("min-h-0 overflow-hidden", className)}>
<div className="flex h-full flex-col items-center gap-1 border-r border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-1.5 py-2">
- <button type="button" onClick={() => updateRailCollapsed(false)} aria-label="Expand conversation history" title="Expand history" className="flex h-9 w-9 items-center justify-center rounded-md text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><PanelLeftOpen className="h-4 w-4" /></button>
- <button type="button" onClick={onNew} aria-label="New conversation" title="New conversation" className="flex h-9 w-9 items-center justify-center rounded-md text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><Plus className="h-4 w-4" /></button>
+ <button type="button" onClick={() => updateRailCollapsed(false)} aria-label="Expand conversation history" title="Expand history" className="flex h-9 w-9 items-center justify-center rounded-md text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"><PanelLeftOpen className="h-4 w-4" /></button>
+ <button type="button" onClick={onNew} aria-label="New conversation" title="New conversation" className="flex h-9 w-9 items-center justify-center rounded-md text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"><Plus className="h-4 w-4" /></button>
</div>
</aside>
);
if (variant === "rail") return <aside aria-label="Conversation history" data-collapsed="false" className={cn("min-h-0 overflow-hidden", className)}>{panel}</aside>;
- return <div className={cn("relative", className)}><button ref={triggerRef} type="button" onClick={() => setOpen(!open)} aria-expanded={open} aria-haspopup="dialog" className="flex min-h-9 items-center gap-1 rounded-md px-2 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"><History className="h-3.5 w-3.5" /><span className="sr-only sm:not-sr-only">History</span></button>{open && <><button type="button" aria-label="Close history" className="fixed inset-0 z-[var(--z-dropdown)]" onClick={closePopover} /><div className="absolute left-0 top-full z-[calc(var(--z-dropdown)+1)] mt-1">{panel}</div></>}</div>;
+ return <div className={cn("relative", className)}><button ref={triggerRef} type="button" onClick={() => setOpen(!open)} aria-expanded={open} aria-haspopup="dialog" className="flex min-h-9 items-center gap-1 rounded-md px-2 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"><History className="h-3.5 w-3.5" /><span className="sr-only sm:not-sr-only">History</span></button>{open && <><button type="button" aria-label="Close history" className="fixed inset-0 z-[var(--z-dropdown)]" onClick={closePopover} /><div className="absolute left-0 top-full z-[calc(var(--z-dropdown)+1)] mt-1">{panel}</div></>}</div>;
}
diff --git a/packages/ui/src/chat/message-actions.tsx b/packages/ui/src/chat/message-actions.tsx
index 38c8e8d82..c44e36f40 100644
--- a/packages/ui/src/chat/message-actions.tsx
+++ b/packages/ui/src/chat/message-actions.tsx
@@ -17,7 +17,7 @@ interface MessageActionsProps {
}
const ICON_BUTTON =
- "inline-flex h-8 w-8 items-center justify-center rounded-md text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "inline-flex h-8 w-8 items-center justify-center rounded-md text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
/**
* Copy, retry and edit under a turn. Revealed on hover or focus with a fine
@@ -123,20 +123,20 @@ function MessageEditForm({
value={draft}
onChange={(event) => setDraft(event.target.value)}
aria-label="Edit message"
- className="min-h-20 w-full resize-y rounded-2xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-4 py-2.5 text-base leading-relaxed text-[var(--color-text-primary)] !outline-none focus:border-[var(--color-border-hover)] focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="min-h-20 w-full resize-y rounded-2xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-4 py-2.5 text-base leading-relaxed text-[var(--color-text-primary)] !outline-none focus:border-[var(--color-border-hover)] focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
/>
<div className="flex justify-end gap-2">
<button
type="button"
onClick={onCancel}
- className="inline-flex h-8 items-center rounded-full px-3 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-8 items-center rounded-full px-3 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
Cancel
</button>
<button
type="submit"
aria-label="Fork and resend"
- className="inline-flex h-8 items-center rounded-full bg-[var(--color-action-primary)] px-3 text-xs font-medium text-[var(--color-text-on-action)] hover:bg-[var(--color-action-primary-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-root)]"
+ className="inline-flex h-8 items-center rounded-full bg-[var(--color-action-primary)] px-3 text-xs font-medium text-[var(--color-text-on-action)] hover:bg-[var(--color-action-primary-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-root)]"
>
Send
</button>
@@ -160,7 +160,7 @@ function ErrorNotice({
<button
type="button"
onClick={() => void onRetry()}
- className="inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<RotateCcw aria-hidden className="h-3.5 w-3.5" />
Retry
diff --git a/packages/ui/src/chat/source-citations.tsx b/packages/ui/src/chat/source-citations.tsx
index e9eefb14c..37b66f5be 100644
--- a/packages/ui/src/chat/source-citations.tsx
+++ b/packages/ui/src/chat/source-citations.tsx
@@ -231,7 +231,7 @@ export function SourceCitations({
return (
<details className="group/cites">
- <summary className="inline-flex min-h-8 cursor-pointer list-none items-center gap-1.5 rounded-md text-xs text-[var(--color-text-tertiary)] marker:hidden hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] [&::-webkit-details-marker]:hidden">
+ <summary className="inline-flex min-h-8 cursor-pointer list-none items-center gap-1.5 rounded-md text-xs text-[var(--color-text-tertiary)] marker:hidden hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] [&::-webkit-details-marker]:hidden">
<span className="tabular-nums">Sources · {sources.length}</span>
<ChevronRight aria-hidden className="h-3 w-3 transition-transform group-open/cites:rotate-90 motion-reduce:transition-none" />
</summary>
@@ -242,7 +242,7 @@ export function SourceCitations({
<li key={source.id}>
<a
href={buildHref ? buildHref(source) : defaultBuildHref(source, prefix)}
- className="group flex min-h-8 w-full min-w-0 flex-wrap items-baseline gap-x-2 rounded-md py-1 text-xs text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="group flex min-h-8 w-full min-w-0 flex-wrap items-baseline gap-x-2 rounded-md py-1 text-xs text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<SourceIcon
pageType={source.pageType}
diff --git a/packages/ui/src/chat/tool-call-block.tsx b/packages/ui/src/chat/tool-call-block.tsx
index 3f8c65f5f..cad2872ca 100644
--- a/packages/ui/src/chat/tool-call-block.tsx
+++ b/packages/ui/src/chat/tool-call-block.tsx
@@ -73,7 +73,7 @@ export function ToolCallBlock({ toolCall, onViewArtifact }: ToolCallBlockProps)
<div className="flex min-h-8 items-center gap-2">
<button
type="button"
- className="flex min-h-8 min-w-0 flex-1 items-center gap-1.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex min-h-8 min-w-0 flex-1 items-center gap-1.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
onClick={() => !isRunning && setExpanded((e) => !e)}
disabled={isRunning}
aria-expanded={expanded}
@@ -106,7 +106,7 @@ export function ToolCallBlock({ toolCall, onViewArtifact }: ToolCallBlockProps)
<button
type="button"
onClick={onViewArtifact}
- className="inline-flex min-h-8 shrink-0 items-center gap-0.5 rounded-md px-1 text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex min-h-8 shrink-0 items-center gap-0.5 rounded-md px-1 text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
View <ArrowUpRight aria-hidden className="h-3 w-3" />
</button>
diff --git a/packages/ui/src/chat/tool-call-group.tsx b/packages/ui/src/chat/tool-call-group.tsx
index e123bad17..2fcb25719 100644
--- a/packages/ui/src/chat/tool-call-group.tsx
+++ b/packages/ui/src/chat/tool-call-group.tsx
@@ -76,7 +76,7 @@ export function ToolCallGroup({ toolCalls, onViewArtifact }: ToolCallGroupProps)
<div data-activity-trail="true" className="text-xs">
<button
type="button"
- className="inline-flex min-h-8 max-w-full items-center gap-1.5 rounded-md text-left text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex min-h-8 max-w-full items-center gap-1.5 rounded-md text-left text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
onClick={() => setExpanded((e) => !e)}
aria-expanded={expanded}
>
diff --git a/packages/ui/src/chat/view-part.tsx b/packages/ui/src/chat/view-part.tsx
index 9f2f1f416..3ea3e3364 100644
--- a/packages/ui/src/chat/view-part.tsx
+++ b/packages/ui/src/chat/view-part.tsx
@@ -816,7 +816,7 @@ function ChartPart({ view, buildRefHref, domId }: PartProps & { view: ChartView
aria-expanded={showData}
aria-controls={tableId}
onClick={() => setShowData((open) => !open)}
- className="inline-flex min-h-8 items-center rounded-md text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] print:hidden"
+ className="inline-flex min-h-8 items-center rounded-md text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] print:hidden"
>
Data
</button>
@@ -857,7 +857,7 @@ function SectionPart({
key={id}
href={`#${props.domId(id)}`}
aria-label={`See ${parts.get(id)?.title ?? id}`}
- className="ml-1 align-super text-[10px] text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="ml-1 align-super text-[10px] text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{id}
</a>
diff --git a/packages/ui/src/commits/history-filters.tsx b/packages/ui/src/commits/history-filters.tsx
index c287aaff9..5d8d37720 100644
--- a/packages/ui/src/commits/history-filters.tsx
+++ b/packages/ui/src/commits/history-filters.tsx
@@ -127,7 +127,7 @@ export function HistoryFilters({
aria-pressed={value.hotspots}
onClick={() => onChange({ hotspots: !value.hotspots })}
className={cn(
- "inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
value.hotspots
? "border-[var(--color-border-hover)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)]"
: "border-[var(--color-border-default)] text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)]",
diff --git a/packages/ui/src/coupling/area-copy.ts b/packages/ui/src/coupling/area-copy.ts
index 2dba1b29b..e666eaffc 100644
--- a/packages/ui/src/coupling/area-copy.ts
+++ b/packages/ui/src/coupling/area-copy.ts
@@ -31,7 +31,7 @@ export const DEFAULT_AREA_COUPLING_COPY = {
unexplained: (n: number, pct: number) =>
`${plural(n, "file pair", "file pairs")} with no direct import (${pct}%)`,
allExplained: "All explained",
- promptLabel: "Copy prompt for your agent",
+ promptLabel: "Copy prompt",
bulkPromptLabel: (n: number) => `Copy prompt for these ${fmt(n)}`,
promptTitle: "Decouple prompt",
promptDescription:
diff --git a/packages/ui/src/coupling/area-filters.tsx b/packages/ui/src/coupling/area-filters.tsx
index b00fcf5c9..85f7bad2e 100644
--- a/packages/ui/src/coupling/area-filters.tsx
+++ b/packages/ui/src/coupling/area-filters.tsx
@@ -9,7 +9,7 @@ const RECENCY_STEPS = [90, 365];
const DEPTHS = [1, 2, 3, 4];
const CONTROL =
- "h-8 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2 text-xs text-[var(--color-text-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]";
+ "h-8 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2 text-xs text-[var(--color-text-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]";
function Toggle({
label,
diff --git a/packages/ui/src/coupling/area-pair-list.tsx b/packages/ui/src/coupling/area-pair-list.tsx
index b0fe8101d..26f985f7d 100644
--- a/packages/ui/src/coupling/area-pair-list.tsx
+++ b/packages/ui/src/coupling/area-pair-list.tsx
@@ -53,7 +53,7 @@ const AreaPairRow = memo(function AreaPairRow({ pair, copy, onOpen, onPrompt }:
<button
type="button"
onClick={() => onOpen({ source: pair.source, target: pair.target })}
- className="flex min-w-0 flex-1 flex-col gap-3 rounded-md px-1 py-1 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)] sm:flex-row sm:items-center"
+ className="flex min-w-0 flex-1 flex-col gap-3 rounded-md px-1 py-1 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] sm:flex-row sm:items-center"
>
<span className="flex min-w-0 flex-1 flex-col gap-1">
<span className="break-all font-mono text-[15px] text-[var(--color-text-primary)] group-hover/row:text-[var(--color-accent-primary)]">
diff --git a/packages/ui/src/coupling/coupling-explorer.tsx b/packages/ui/src/coupling/coupling-explorer.tsx
index 171155bcf..0a32e6c7e 100644
--- a/packages/ui/src/coupling/coupling-explorer.tsx
+++ b/packages/ui/src/coupling/coupling-explorer.tsx
@@ -12,6 +12,7 @@ import { fileEntityPath } from "../shared/entity/routes";
import { cn } from "../lib/cn";
import { truncatePath } from "../lib/format";
import type { CouplingEdge, CouplingGraphResponse, CouplingNode } from "@repowise-dev/types/coupling";
+import { FIELD_CLASS } from "../ui/input";
// Stable identities so the `?? []` fallbacks do not invalidate a memo on every
// render when the payload really is missing its arrays.
@@ -407,7 +408,7 @@ export function CouplingExplorer({
onChange={(e) => setQuery(e.target.value)}
placeholder="Filter by file path…"
aria-label="Filter the couplings by file path"
- className="h-8 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] pl-8 pr-3 text-xs text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "h-8 w-full pl-8 pr-3 text-xs")}
/>
</div>
<div className="flex items-center gap-2">
diff --git a/packages/ui/src/dashboard/active-job-banner.tsx b/packages/ui/src/dashboard/active-job-banner.tsx
index 633f60688..3e7cbd7fe 100644
--- a/packages/ui/src/dashboard/active-job-banner.tsx
+++ b/packages/ui/src/dashboard/active-job-banner.tsx
@@ -159,7 +159,7 @@ function DismissButton({ label, onDismiss }: { label: string; onDismiss: () => v
type="button"
onClick={onDismiss}
aria-label={label}
- className="ml-auto rounded p-0.5 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className="ml-auto rounded p-0.5 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]"
>
<X className="h-3 w-3" />
</button>
diff --git a/packages/ui/src/dashboard/explore-cards.tsx b/packages/ui/src/dashboard/explore-cards.tsx
index 909ddaea8..2ecdc2c13 100644
--- a/packages/ui/src/dashboard/explore-cards.tsx
+++ b/packages/ui/src/dashboard/explore-cards.tsx
@@ -3,6 +3,8 @@
import * as React from "react";
import { ArrowRight, MessageCircleQuestion, Waypoints } from "lucide-react";
import { Card } from "../ui/card";
+import { FIELD_CLASS } from "../ui/input";
+import { cn } from "../lib/cn";
interface KnowledgeGraphCardProps {
/** Link to the repo's knowledge-graph page. */
@@ -80,7 +82,7 @@ export function AskAnythingCard({
onChange={(e) => setQuestion(e.target.value)}
placeholder={placeholder}
aria-label="Ask a question about this codebase"
- className="h-9 w-full min-w-0 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "h-9 w-full min-w-0 px-3 text-sm")}
/>
<button
type="submit"
diff --git a/packages/ui/src/decisions/decision-create-form.tsx b/packages/ui/src/decisions/decision-create-form.tsx
index 62c9f8761..aacf228bb 100644
--- a/packages/ui/src/decisions/decision-create-form.tsx
+++ b/packages/ui/src/decisions/decision-create-form.tsx
@@ -43,7 +43,7 @@ const TEXTAREA_CLASS =
"box-border min-w-0 flex w-full rounded-md border border-[var(--color-border-default)] " +
"bg-[var(--color-bg-surface)] px-3 py-2 text-sm text-[var(--color-text-primary)] " +
"transition-colors placeholder:text-[var(--color-text-tertiary)] focus-visible:outline-none " +
- "focus-visible:ring-1 focus-visible:ring-[var(--color-accent-primary)] " +
+ "focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)] " +
"disabled:cursor-not-allowed disabled:opacity-50";
export interface DecisionCreateFormProps {
diff --git a/packages/ui/src/dependencies/external-dependencies-table.tsx b/packages/ui/src/dependencies/external-dependencies-table.tsx
index 985f21901..3b11a1fea 100644
--- a/packages/ui/src/dependencies/external-dependencies-table.tsx
+++ b/packages/ui/src/dependencies/external-dependencies-table.tsx
@@ -30,6 +30,8 @@ import {
} from "../ui/select";
import { Sheet, SheetContent, SheetTitle } from "../ui/sheet";
import { PackageRelationshipGraph } from "./package-relationship-graph";
+import { FIELD_CLASS } from "../ui/input";
+import { cn } from "../lib/cn";
export type ExternalDependencyRole = "all" | "runtime" | "dev-only" | "mixed";
export type ExternalDependencyUsage =
@@ -503,7 +505,7 @@ export function ExternalDependenciesTable({
value={state.query}
onChange={(event) => onStateChange(updateState(state, { query: event.target.value }))}
placeholder="Search packages or versions"
- className="h-9 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] pl-9 pr-3 text-sm text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)] focus:ring-1 focus:ring-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "h-9 w-full pl-9 pr-3 text-sm")}
/>
</label>
<Select value={state.ecosystem} onValueChange={(ecosystem) => onStateChange(updateState(state, { ecosystem }))}>
diff --git a/packages/ui/src/dependencies/package-relationship-graph.tsx b/packages/ui/src/dependencies/package-relationship-graph.tsx
index 30fd60a30..2be1331ae 100644
--- a/packages/ui/src/dependencies/package-relationship-graph.tsx
+++ b/packages/ui/src/dependencies/package-relationship-graph.tsx
@@ -85,7 +85,7 @@ export function PackageRelationshipGraph({
type="button"
aria-expanded={expanded}
onClick={() => onToggleAggregate(expanded ? null : node.aggregate_key)}
- className="group flex w-full items-center gap-2 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2.5 text-left hover:border-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] motion-reduce:transition-none"
+ className="group flex w-full items-center gap-2 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2.5 text-left hover:border-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] motion-reduce:transition-none"
>
<span className="min-w-0 flex-1">
<span className="block break-words text-xs font-medium text-[var(--color-text-primary)]">{node.label}</span>
diff --git a/packages/ui/src/doc-drift/drift-findings-table.tsx b/packages/ui/src/doc-drift/drift-findings-table.tsx
index b8af84021..07764d09e 100644
--- a/packages/ui/src/doc-drift/drift-findings-table.tsx
+++ b/packages/ui/src/doc-drift/drift-findings-table.tsx
@@ -31,7 +31,7 @@ import {
} from "../shared/responsive-table";
import { EmptyState } from "../shared/empty-state";
import { FilePath } from "../shared/file-path";
-import { AiPromptButton } from "../health/ai-prompt-button";
+import { RowPromptAction } from "../health/row-prompt-action";
import { groupByDocument } from "./group-by-document";
export interface DriftFindingsTableProps {
@@ -152,7 +152,7 @@ export function DriftFindingsTable({
// The button stops its own propagation, so it is safe inside a row that
// also opens the panel.
render: (f) => (
- <AiPromptButton
+ <RowPromptAction
variant="icon"
onClick={() => onPrompt(f)}
label={`Fix ${f.file_path}:${f.line_number} with an agent`}
diff --git a/packages/ui/src/files/files-index.tsx b/packages/ui/src/files/files-index.tsx
index eb35d06b5..81102fc68 100644
--- a/packages/ui/src/files/files-index.tsx
+++ b/packages/ui/src/files/files-index.tsx
@@ -12,6 +12,7 @@ import { FilesTable, lineCoverage, type SortKey } from "./files-table";
// to emphasise a figure identically, and two identical local copies is how that
// stops being true without anyone noticing.
import { Fig } from "./file-section";
+import { FIELD_CLASS } from "../ui/input";
interface FilesIndexProps {
files: FileRow[];
@@ -269,7 +270,7 @@ export function FilesIndex({ files, languages, fileHref }: FilesIndexProps) {
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Filter files by path…"
- className="h-9 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] pl-8 pr-3 text-sm text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "h-9 w-full pl-8 pr-3 text-sm")}
/>
</div>
<Segmented<TestFilter>
@@ -285,7 +286,7 @@ export function FilesIndex({ files, languages, fileHref }: FilesIndexProps) {
<select
value={langFilter}
onChange={(e) => setLangFilter(e.target.value)}
- className="h-9 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2 text-sm text-[var(--color-text-secondary)] outline-none focus:border-[var(--color-accent-primary)]"
+ className="h-9 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2 text-sm text-[var(--color-text-secondary)] outline-none focus:border-[var(--color-focus-ring)]"
>
<option value="">All languages</option>
{languages.map((l) => (
diff --git a/packages/ui/src/git/hotspot-table.tsx b/packages/ui/src/git/hotspot-table.tsx
index 0618d261a..5390773a4 100644
--- a/packages/ui/src/git/hotspot-table.tsx
+++ b/packages/ui/src/git/hotspot-table.tsx
@@ -93,7 +93,7 @@ function SortHeader({
{onSortChange ? (
<button
type="button"
- className="cursor-pointer select-none uppercase tracking-wider font-medium hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] rounded"
+ className="cursor-pointer select-none uppercase tracking-wider font-medium hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] rounded"
onClick={() =>
onSortChange({
key: column,
diff --git a/packages/ui/src/graph/centrality-leaderboard.tsx b/packages/ui/src/graph/centrality-leaderboard.tsx
index 2799f476f..639f0c5dd 100644
--- a/packages/ui/src/graph/centrality-leaderboard.tsx
+++ b/packages/ui/src/graph/centrality-leaderboard.tsx
@@ -91,7 +91,7 @@ export function CentralityLeaderboard({
<button
type="button"
aria-label="What do these metrics mean?"
- className="inline-flex shrink-0 items-center rounded-sm text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex shrink-0 items-center rounded-sm text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Info className="h-3 w-3" aria-hidden />
</button>
diff --git a/packages/ui/src/graph/graph-community-panel.tsx b/packages/ui/src/graph/graph-community-panel.tsx
index 21ed62f03..13c37025f 100644
--- a/packages/ui/src/graph/graph-community-panel.tsx
+++ b/packages/ui/src/graph/graph-community-panel.tsx
@@ -561,7 +561,7 @@ function NeighborRow({
<button
type="button"
onClick={onSelect}
- className="flex w-full items-center justify-between gap-2 rounded px-1.5 py-1 text-left transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full items-center justify-between gap-2 rounded px-1.5 py-1 text-left transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{body}
</button>
diff --git a/packages/ui/src/graph/graph-flow.tsx b/packages/ui/src/graph/graph-flow.tsx
index fa95a1a7d..e4e44187a 100644
--- a/packages/ui/src/graph/graph-flow.tsx
+++ b/packages/ui/src/graph/graph-flow.tsx
@@ -1271,7 +1271,7 @@ export function GraphFlow(props: GraphFlowProps) {
onClick={handleToggleShortcutHelp}
title="Keyboard shortcuts (?)"
aria-label="Keyboard shortcuts"
- className="flex h-7 w-7 items-center justify-center rounded-md text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex h-7 w-7 items-center justify-center rounded-md text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<HelpCircle className="h-3.5 w-3.5" />
</button>
diff --git a/packages/ui/src/graph/graph-legend.tsx b/packages/ui/src/graph/graph-legend.tsx
index e970ed9aa..9c73d41a6 100644
--- a/packages/ui/src/graph/graph-legend.tsx
+++ b/packages/ui/src/graph/graph-legend.tsx
@@ -425,7 +425,7 @@ export const GraphLegend = memo(function GraphLegend({
aria-label={
overview.showExternal ? "Hide third-party modules" : "Show third-party modules"
}
- className="rounded px-1 py-0.5 font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded px-1 py-0.5 font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{overview.showExternal ? "Hide" : "Show"}
</button>
@@ -505,7 +505,7 @@ export const GraphLegend = memo(function GraphLegend({
<button
type="button"
onClick={() => onCommunityClick(cid)}
- className="max-w-[12rem] truncate rounded hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="max-w-[12rem] truncate rounded hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{label}
</button>
diff --git a/packages/ui/src/graph/graph-population-control.tsx b/packages/ui/src/graph/graph-population-control.tsx
index b923cc489..845c6d1f0 100644
--- a/packages/ui/src/graph/graph-population-control.tsx
+++ b/packages/ui/src/graph/graph-population-control.tsx
@@ -47,7 +47,7 @@ export function GraphPopulationControl({
<button
type="button"
aria-label={`Files counted: ${summary}`}
- className={`inline-flex h-7 items-center gap-1.5 rounded-md border border-[var(--color-border-default)] px-2 text-xs text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] ${className ?? ""}`}
+ className={`inline-flex h-7 items-center gap-1.5 rounded-md border border-[var(--color-border-default)] px-2 text-xs text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${className ?? ""}`}
>
<Filter className="h-3 w-3" />
<span className="tabular-nums">{summary}</span>
diff --git a/packages/ui/src/graph/graph-scope-breadcrumb.tsx b/packages/ui/src/graph/graph-scope-breadcrumb.tsx
index c3d48332e..85102196c 100644
--- a/packages/ui/src/graph/graph-scope-breadcrumb.tsx
+++ b/packages/ui/src/graph/graph-scope-breadcrumb.tsx
@@ -42,7 +42,7 @@ export function GraphScopeBreadcrumb({
type="button"
onClick={onRoot}
title={`Back to ${rootLabel}`}
- className="flex shrink-0 items-center gap-1 rounded px-1.5 py-1 hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex shrink-0 items-center gap-1 rounded px-1.5 py-1 hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Home className="h-3.5 w-3.5" />
<span className="max-w-[10rem] truncate">{rootLabel}</span>
@@ -54,7 +54,7 @@ export function GraphScopeBreadcrumb({
type="button"
onClick={crumb.onClick}
title={`Back to ${crumb.label}`}
- className="max-w-[12rem] truncate rounded px-1.5 py-1 hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="max-w-[12rem] truncate rounded px-1.5 py-1 hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{crumb.label}
</button>
diff --git a/packages/ui/src/graph/graph-scope-controls.tsx b/packages/ui/src/graph/graph-scope-controls.tsx
index bb2fcf1c4..6b73ca267 100644
--- a/packages/ui/src/graph/graph-scope-controls.tsx
+++ b/packages/ui/src/graph/graph-scope-controls.tsx
@@ -73,7 +73,7 @@ export function GraphScopeSwitcher({
tabIndex={active ? 0 : -1}
title={s.hint}
onClick={() => onScopeChange(s.id)}
- className={`rounded px-2.5 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] ${
+ className={`rounded px-2.5 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${
active
? "bg-[var(--color-bg-elevated)] font-semibold text-[var(--color-text-primary)]"
: "font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]"
@@ -122,7 +122,7 @@ export function ModuleFilterSelect({
<select
value={activeModule ?? ""}
onChange={(e) => onModuleChange(e.target.value || null)}
- className="rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<option value="">All modules</option>
{prominent.map((g) => (
@@ -224,7 +224,7 @@ export function GraphNarrowingSelect({
else if (v.startsWith("m:")) onChange({ module: v.slice(2), community: null });
else onChange({ module: null, community: null });
}}
- className="max-w-[15rem] rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="max-w-[15rem] rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<option value="">All files</option>
{staleModule && <option value={`m:${staleModule}`}>{staleModule} · 0</option>}
diff --git a/packages/ui/src/graph/graph-toolbar.tsx b/packages/ui/src/graph/graph-toolbar.tsx
index 1255ca917..55f27d21b 100644
--- a/packages/ui/src/graph/graph-toolbar.tsx
+++ b/packages/ui/src/graph/graph-toolbar.tsx
@@ -11,6 +11,8 @@ import {
} from "lucide-react";
import { memo, useState } from "react";
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";
+import { FIELD_CLASS } from "../ui/input";
+import { cn } from "../lib/cn";
/**
* No "risk" member. There was one, and it painted `pagerank * 3` through
@@ -158,7 +160,7 @@ const itemActiveClass =
const itemIdleClass =
"border-[var(--color-border-default)] text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)]";
const itemClass =
- "flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
/** Segmented control, matching `coupling-explorer`'s: counts live inside the
* segments rather than in a caption beside them. */
@@ -354,7 +356,7 @@ export const GraphToolbar = memo(function GraphToolbar({
onKeyDown={onSearchKeyDown}
placeholder="Search nodes…"
aria-label="Search graph nodes"
- className="w-40 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] py-1.5 pl-7 pr-14 text-xs text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-border-hover)] sm:w-36 lg:w-48"
+ className={cn(FIELD_CLASS, "w-40 py-1.5 pl-7 pr-14 text-xs sm:w-36 lg:w-48")}
/>
<span className="absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-1">
{searchQuery && searchMatchCount != null && searchTotalCount != null && (
diff --git a/packages/ui/src/health/ai-prompt-action.tsx b/packages/ui/src/health/ai-prompt-action.tsx
index ce8c4210c..7ca1007a0 100644
--- a/packages/ui/src/health/ai-prompt-action.tsx
+++ b/packages/ui/src/health/ai-prompt-action.tsx
@@ -18,7 +18,7 @@ const AiPromptModal = lazy(() =>
);
/** The label every actionable row's primary button carries. */
-export const AGENT_PROMPT_LABEL = "Copy prompt for your agent";
+export const AGENT_PROMPT_LABEL = "Copy prompt";
/** The same verb for a group: "Copy prompt for these 4", or "this one" for one. */
export function bulkAgentPromptLabel(count: number): string {
diff --git a/packages/ui/src/health/ai-prompt-button.tsx b/packages/ui/src/health/ai-prompt-button.tsx
index b48fa8371..86bc450d5 100644
--- a/packages/ui/src/health/ai-prompt-button.tsx
+++ b/packages/ui/src/health/ai-prompt-button.tsx
@@ -1,18 +1,31 @@
"use client";
-import { Sparkles } from "lucide-react";
+import { useEffect, useRef, useState, type MouseEvent, type ReactElement } from "react";
+import { Check, ClipboardCopy } from "lucide-react";
import { cn } from "../lib/cn";
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
export interface AiPromptButtonProps {
- onClick: () => void;
- /** Visible label for the default variant; also used as the title/aria-label. */
+ /** Runs on click; with `copyText` it runs as the copy starts, whatever its outcome. */
+ onClick?: () => void;
+ /**
+ * The prompt itself, built on demand. When given, a click copies it, the
+ * button says "Copied" for a moment, and hover or focus previews its
+ * first lines. Without it the button only calls `onClick`, which usually
+ * opens the prompt modal.
+ */
+ copyText?: () => string;
+ /** Visible label; also the accessible name unless `ariaLabel` is given. */
label?: string;
+ /** The label shown for a moment after a copy. */
+ copiedLabel?: string;
+ /** The label shown for a moment when the clipboard refuses the copy. */
+ failedLabel?: string;
/**
- * `default` shows the green sparkles pill with a label (cards, headers).
- * `icon` is a compact icon-only button for dense table rows; the label
- * still rides along as the tooltip / accessible name.
- * `ghost` is icon + label with no fill, for a per-row action that should
- * not repeat a filled pill down every row (see `RowPromptAction`).
+ * `default` is a neutral outlined button for a detail view or a header.
+ * `ghost` is icon + label with no border, for a per-row action (see
+ * `RowPromptAction`). `icon` is icon-only for dense table rows; the label
+ * rides along as the tooltip and accessible name.
*/
variant?: "default" | "icon" | "ghost";
/** Accessible name when the visible label repeats down a list, e.g. naming the row. */
@@ -20,70 +33,142 @@ export interface AiPromptButtonProps {
className?: string;
}
+const COPIED_MS = 1600;
+const PEEK_LINES = 4;
+
+const BASE =
+ "inline-flex items-center gap-1.5 rounded-md text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
+
+const VARIANT: Record<NonNullable<AiPromptButtonProps["variant"]>, string> = {
+ // Soft ink: a tonal fill so the most clicked action reads as one, quieter than the ink button.
+ default:
+ "h-7 border border-[var(--color-border-default)] bg-[var(--color-action-soft)] px-2.5 text-[var(--color-text-primary)] hover:border-[var(--color-border-hover)] hover:bg-[var(--color-action-soft-hover)]",
+ ghost:
+ "h-7 px-2 text-[var(--color-text-primary)] hover:bg-[var(--color-action-soft-hover)]",
+ icon: "h-6 w-6 justify-center p-0 text-[var(--color-text-primary)] hover:bg-[var(--color-action-soft-hover)]",
+};
+
+/** The first few non-empty lines of a prompt, for the hover preview. */
+export function promptPeek(prompt: string, lines = PEEK_LINES): string {
+ const kept = prompt.split("\n").filter((line) => line.trim() !== "");
+ const head = kept.slice(0, lines).join("\n");
+ return kept.length > lines ? `${head}\n...` : head;
+}
+
+async function writeClipboard(value: string): Promise<boolean> {
+ try {
+ await navigator.clipboard.writeText(value);
+ return true;
+ } catch {
+ // Clipboard blocked (insecure origin, denied permission).
+ return false;
+ }
+}
+
+/** Mounted only while the tooltip is open, so the prompt is built on demand. */
+function PromptPeek({ build }: { build: () => string }) {
+ return (
+ <span className="block max-w-xs whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-[var(--color-text-secondary)] [overflow-wrap:anywhere]">
+ {promptPeek(build())}
+ </span>
+ );
+}
+
+type CopyResult = "copied" | "failed" | null;
+
+/** The last copy's outcome, for a moment; cleared on unmount. */
+function useCopyResult(): [CopyResult, (result: Exclude<CopyResult, null>) => void] {
+ const [result, setResult] = useState<CopyResult>(null);
+ const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
+ useEffect(
+ () => () => {
+ if (timer.current) clearTimeout(timer.current);
+ },
+ [],
+ );
+ const flag = (next: Exclude<CopyResult, null>) => {
+ setResult(next);
+ if (timer.current) clearTimeout(timer.current);
+ timer.current = setTimeout(() => setResult(null), COPIED_MS);
+ };
+ return [result, flag];
+}
+
/**
- * Canonical "hand this to an AI agent" affordance. One button, used everywhere
- * an AI prompt can be generated (refactor, coverage, dead code, security,
- * hotspots) so the action reads the same on every screen. The host owns the
- * click — typically opening the shared AiPromptModal.
+ * Canonical "hand this to your agent" affordance, used everywhere a prompt
+ * can be generated so the action reads the same on every screen. Quiet on
+ * purpose: neutral ink on a soft fill, with a copy icon. The host owns the
+ * click (typically opening the shared AiPromptModal, so the label defaults to
+ * "Agent prompt"), or passes `copyText` to copy straight away ("Copy prompt").
*/
export function AiPromptButton({
onClick,
- label = "AI fix prompt",
+ copyText,
+ label = copyText ? "Copy prompt" : "Agent prompt",
+ copiedLabel = "Copied",
+ failedLabel = "Couldn't copy",
variant = "default",
ariaLabel,
className,
}: AiPromptButtonProps) {
- const base =
- "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 (
- <button
- type="button"
- onClick={(e) => {
- e.stopPropagation();
- onClick();
- }}
- title={label}
- aria-label={ariaLabel ?? label}
- className={cn(base, "h-6 w-6 justify-center p-0", className)}
- >
- <Sparkles className="h-3.5 w-3.5 transition-transform group-hover/ai:rotate-12" />
- </button>
- );
- }
- if (variant === "ghost") {
- return (
- <button
- type="button"
- onClick={(e) => {
- e.stopPropagation();
- onClick();
- }}
- title={label}
- aria-label={ariaLabel}
- className={cn(
- "group/ai inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-model-muted)] hover:text-[var(--color-model)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
- className,
- )}
- >
- <Sparkles className="h-3.5 w-3.5 text-[var(--color-model)] transition-transform group-hover/ai:rotate-12" />
- {label}
- </button>
- );
+ const [result, flagResult] = useCopyResult();
+ const copied = result === "copied";
+ const shown = { copied: copiedLabel, failed: failedLabel }[result ?? "copied"];
+
+ function handleClick(e: MouseEvent<HTMLButtonElement>) {
+ e.stopPropagation();
+ if (copyText) void writeClipboard(copyText()).then((ok) => flagResult(ok ? "copied" : "failed"));
+ onClick?.();
}
- return (
+
+ const Icon = copied ? Check : ClipboardCopy;
+ const button = (
<button
type="button"
- onClick={(e) => {
- e.stopPropagation();
- onClick();
- }}
- title={label}
- aria-label={ariaLabel}
- className={cn(base, "px-2.5 py-1 text-xs", className)}
+ onClick={handleClick}
+ // A native title only where nothing else names the button on hover.
+ title={variant === "icon" && !copyText ? label : undefined}
+ aria-label={variant === "icon" ? (ariaLabel ?? label) : ariaLabel}
+ className={cn(BASE, VARIANT[variant], className)}
>
- <Sparkles className="h-3.5 w-3.5 transition-transform group-hover/ai:rotate-12" />
- {label}
+ <Icon
+ aria-hidden
+ className={cn("h-3.5 w-3.5 shrink-0", copied && "text-[var(--color-success)]")}
+ />
+ {variant !== "icon" && (result ? shown : label)}
</button>
);
+ if (!copyText) return button;
+ return (
+ <WithPromptPeek build={copyText} announce={result ? shown : ""}>
+ {button}
+ </WithPromptPeek>
+ );
+}
+
+/** The copy button with its prompt preview on hover or focus, and the polite announcement. */
+function WithPromptPeek({
+ build,
+ announce,
+ children,
+}: {
+ build: () => string;
+ announce: string;
+ children: ReactElement;
+}) {
+ return (
+ <>
+ <TooltipProvider delayDuration={300}>
+ <Tooltip>
+ <TooltipTrigger asChild>{children}</TooltipTrigger>
+ <TooltipContent side="bottom" align="end">
+ <PromptPeek build={build} />
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ <span aria-live="polite" className="sr-only">
+ {announce}
+ </span>
+ </>
+ );
}
diff --git a/packages/ui/src/health/ai-prompt-modal.tsx b/packages/ui/src/health/ai-prompt-modal.tsx
index 8a7d3f224..3e8064d1b 100644
--- a/packages/ui/src/health/ai-prompt-modal.tsx
+++ b/packages/ui/src/health/ai-prompt-modal.tsx
@@ -1,7 +1,7 @@
"use client";
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
-import { Check, Copy, MessageCircleQuestion, Sparkles } from "lucide-react";
+import { Check, ClipboardCopy, Copy, MessageCircleQuestion } from "lucide-react";
import type { ChatContext } from "@repowise-dev/types/chat";
import {
Dialog,
@@ -118,7 +118,7 @@ function FetchedPromptText({ load, pre }: { load: PromptLoad; pre: ReactNode })
pane.current?.focus();
load.retry();
}}
- className="rounded font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
Retry
</button>
@@ -169,7 +169,7 @@ function AskPromptInChat({
onAsked?.();
}}
disabled={!prompt}
- className="inline-flex shrink-0 items-center gap-1.5 rounded-md border border-[var(--color-border-default)] px-3 py-1.5 text-xs font-medium text-[var(--color-text-primary)] transition-colors hover:border-[var(--color-border-hover)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] disabled:opacity-50 motion-reduce:transition-none"
+ className="inline-flex shrink-0 items-center gap-1.5 rounded-md border border-[var(--color-border-default)] px-3 py-1.5 text-xs font-medium text-[var(--color-text-primary)] transition-colors hover:border-[var(--color-border-hover)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50 motion-reduce:transition-none"
>
<MessageCircleQuestion className="h-3.5 w-3.5" aria-hidden /> Ask in chat
</button>
@@ -276,7 +276,7 @@ export function AiPromptBlock({
"inline-flex shrink-0 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-model)] text-[var(--color-text-on-model)] hover:bg-[var(--color-model-hover)]")
+ : "bg-[var(--color-action-primary)] text-[var(--color-text-on-action)] hover:bg-[var(--color-action-primary-hover)]")
}
>
{copied ? (
@@ -310,7 +310,7 @@ export function AiPromptModal({
<DialogContent className="min-w-0 w-[calc(100vw-2rem)] max-w-3xl overflow-hidden">
<DialogHeader className="min-w-0">
<DialogTitle className="flex min-w-0 items-center gap-2 pr-6">
- <Sparkles className="h-4 w-4 shrink-0 text-[var(--color-model)]" />
+ <ClipboardCopy aria-hidden className="h-4 w-4 shrink-0 text-[var(--color-text-tertiary)]" />
<span className="min-w-0 truncate">{title}</span>
{filePath ? (
<span className="ml-2 min-w-0 max-w-[260px] flex-1 truncate font-mono text-xs font-normal text-[var(--color-text-tertiary)]">
diff --git a/packages/ui/src/health/ai-prompts/setup-prompt.ts b/packages/ui/src/health/ai-prompts/setup-prompt.ts
index b70c40bbd..8ba6dc502 100644
--- a/packages/ui/src/health/ai-prompts/setup-prompt.ts
+++ b/packages/ui/src/health/ai-prompts/setup-prompt.ts
@@ -1,4 +1,4 @@
-import { bulletList, REPO_ROLE, repoSuffix, type AiPromptFlavor } from "./shared";
+import { bulletList, REPO_ROLE, type AiPromptFlavor } from "./shared";
// ─────────────────────────────────────────────────────────────────────
// Setup prompt: one Setup page row, handed to the agent to finish or fix
@@ -11,20 +11,21 @@ export interface SetupPromptRow {
title: string;
/** What repowise detected, in a sentence or two. */
state: string;
- /** The exact command that makes the change. */
- command: string;
+ /** The exact command that makes the change; omitted when no one command fixes it. */
+ command?: string;
/** How the agent checks the result. */
verify: "status" | "doctor";
- /** Something is wrong: the agent investigates and confirms before changing anything. */
+ /** Something is wrong: the agent says what the fix changes and waits for a yes. */
fix?: boolean;
/** Paths or names the state refers to, listed under it. */
items?: string[];
+ /** The finding is a `repowise doctor` check, so the prompt opens on it. */
+ fromDoctor?: boolean;
}
const VERIFY: Record<SetupPromptRow["verify"], string> = {
- status: "Run `repowise status` afterwards and tell me what it reports for this repository.",
- doctor:
- "Run `repowise doctor --format json` afterwards and tell me the level and detail of the matching check.",
+ status: "repowise status",
+ doctor: "repowise doctor",
};
const MAX_ITEMS = 20;
@@ -36,46 +37,48 @@ function itemLines(items: string[] | undefined): string | null {
return bulletList([...shown, more > 0 ? `and ${more} more` : null]);
}
+/** A sentence that ends in exactly one full stop. */
+function sentence(text: string): string {
+ const trimmed = text.trim().replace(/[.\s]+$/, "");
+ return trimmed ? `${trimmed}.` : "";
+}
+
+/** What was found: a doctor check reads "title, detail"; a Setup row "title. state". */
+function opening(row: SetupPromptRow): string {
+ if (row.fromDoctor) {
+ const detail = row.state.trim() ? `, ${row.state.trim()}` : "";
+ return sentence(`\`repowise doctor\` in ${row.repoName} reports: ${row.title}${detail}`);
+ }
+ return `repowise reports for ${row.repoName}: ${sentence(row.title)} ${sentence(row.state)}`.trim();
+}
+
+/** What to do about it, worded for whether there is a fix and a command. */
+function ask(row: SetupPromptRow): string {
+ const check = `\`${VERIFY[row.verify]}\``;
+ const again = row.fromDoctor && row.verify === "doctor" ? " again" : "";
+ if (row.fix && row.command) {
+ return `The fix is \`${row.command}\`. Tell me what it changes, run it once I agree, then run ${check}${again} to check.`;
+ }
+ if (row.fix) {
+ return `No single command fixes this. Find the cause and tell me what you would change, make the change once I agree, then run ${check}${again} to check.`;
+ }
+ if (row.command) {
+ return `Run \`${row.command}\` from the repository root, then run ${check} and tell me what it reports.`;
+ }
+ return `Run ${check} and tell me what it reports.`;
+}
+
/**
- * A prompt for one Setup row: the repo, what was detected, the exact command
- * and how to verify it. A fix asks the agent to find the cause and confirm
- * with the person before changing anything.
+ * A prompt for one Setup row: what repowise found in the repo, the command
+ * that fixes it, and how to check. A fix asks the agent to say what the
+ * command changes and to run it once the person agrees.
*/
export function buildSetupAiPrompt(
row: SetupPromptRow,
flavor: AiPromptFlavor = "generic",
): string {
- const task = row.fix
- ? "Find out why first, then tell me what you found and what you would change. The usual fix is this command, run from the repository root:"
- : "Run this from the repository root:";
- const constraints = row.fix
- ? [
- "Confirm with me before changing anything: files, config, hooks or the index.",
- "If the problem is not what repowise reported, say so and stop.",
- ]
- : [
- "Run only the command above and the check below. Do not edit other files.",
- "If the command fails, show me its output and stop.",
- ];
- const expected = row.fix
- ? "What you found, the change you propose, and, once I confirm and you run it, what the check reports."
- : "The command's result and what the check reports.";
- const detected = [`What repowise detected: ${row.state}`, itemLines(row.items)]
+ // Blocks joined by a blank line, so the prompt reads cleanly when pasted.
+ return [REPO_ROLE[flavor], `${opening(row)} ${ask(row)}`, itemLines(row.items)]
.filter(Boolean)
- .join("\n");
-
- // Blocks joined by a blank line, so the prompt reads as sections when pasted.
- return [
- REPO_ROLE[flavor],
- `## Setup: ${row.title}${repoSuffix(row.repoName)}`,
- detected,
- "## Do this",
- `${task}\n\n\`\`\`\n${row.command}\n\`\`\``,
- "## Verify",
- VERIFY[row.verify],
- "## Hard constraints",
- bulletList(constraints),
- "## What I expect back",
- expected,
- ].join("\n\n");
+ .join("\n\n");
}
diff --git a/packages/ui/src/health/area-map-section.tsx b/packages/ui/src/health/area-map-section.tsx
index 9b181eb9c..6c54e7dce 100644
--- a/packages/ui/src/health/area-map-section.tsx
+++ b/packages/ui/src/health/area-map-section.tsx
@@ -29,6 +29,8 @@ import { MapFieldList } from "./map/inspector";
import { AreaRail } from "./area-rail/area-rail";
import { DEFAULT_AREA_RAIL_LABELS, type AreaRailLabels } from "./area-rail/labels";
import type { CodeHealthAdapter } from "./code-health-adapter";
+import { FIELD_CLASS } from "../ui/input";
+import { cn } from "../lib/cn";
/** Map height. The rail is height-matched so it never outgrows the field beside it. */
const MAP_HEIGHT = 720;
@@ -119,7 +121,7 @@ function SearchBox({ value, onChange, label }: { value: string; onChange: (v: st
onChange={(e) => onChange(e.target.value)}
placeholder={label}
aria-label={label}
- className="w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] py-1.5 pl-7 pr-2 text-xs text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] hover:border-[var(--color-border-hover)] focus-visible:border-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "w-full py-1.5 pl-7 pr-2 text-xs")}
/>
</div>
);
diff --git a/packages/ui/src/health/area-rail/area-card.tsx b/packages/ui/src/health/area-rail/area-card.tsx
index dcd9ab645..ad6e75bed 100644
--- a/packages/ui/src/health/area-rail/area-card.tsx
+++ b/packages/ui/src/health/area-rail/area-card.tsx
@@ -64,7 +64,7 @@ function Links({ links, labels, onNavigate }: { links: AreaLinks; labels: AreaRa
e.preventDefault();
onNavigate(l.href);
}}
- className="rounded 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-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{l.label}
</a>
@@ -148,7 +148,7 @@ export function AreaCard(props: AreaCardProps) {
<Facts detail={detail} labels={labels} />
<details className="group flex flex-col gap-4">
- <summary className="flex cursor-pointer list-none items-center gap-1 rounded text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] [&::-webkit-details-marker]:hidden">
+ <summary className="flex cursor-pointer list-none items-center gap-1 rounded text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] [&::-webkit-details-marker]:hidden">
<ChevronRight aria-hidden className="h-3.5 w-3.5 transition-transform group-open:rotate-90" />
{labels.hotspots(detail.hotspots.total)} · {labels.owners} · {labels.topFindings}
</summary>
diff --git a/packages/ui/src/health/area-rail/area-rail.tsx b/packages/ui/src/health/area-rail/area-rail.tsx
index aed48627c..4890e44ea 100644
--- a/packages/ui/src/health/area-rail/area-rail.tsx
+++ b/packages/ui/src/health/area-rail/area-rail.tsx
@@ -68,7 +68,7 @@ export function AreaRail(props: AreaRailProps) {
<button
type="button"
onClick={props.onClearFile}
- className="self-start rounded font-mono text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="self-start rounded font-mono text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
← {labels.backToArea(area ? props.nameOf(area) : labels.repository)}
</button>
diff --git a/packages/ui/src/health/area-rail/area-sections.tsx b/packages/ui/src/health/area-rail/area-sections.tsx
index f397e72c0..4bf82a6d9 100644
--- a/packages/ui/src/health/area-rail/area-sections.tsx
+++ b/packages/ui/src/health/area-rail/area-sections.tsx
@@ -25,7 +25,7 @@ export function RailSection({ title, children }: { title: string; children: Reac
}
const ROW =
- "flex w-full min-w-0 items-baseline gap-2 rounded px-1.5 py-1 text-left transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "flex w-full min-w-0 items-baseline gap-2 rounded px-1.5 py-1 text-left transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
function Score({ score }: { score: number | null }) {
return (
diff --git a/packages/ui/src/health/biomarker-chip.tsx b/packages/ui/src/health/biomarker-chip.tsx
index 26a40c107..f1feb4a08 100644
--- a/packages/ui/src/health/biomarker-chip.tsx
+++ b/packages/ui/src/health/biomarker-chip.tsx
@@ -40,7 +40,7 @@ export function BiomarkerChip({ type, showInfo = true, className = "" }: Biomark
type="button"
onClick={(e) => e.stopPropagation()}
aria-label={`What is ${info.label}?`}
- className={`inline-flex items-center gap-1 text-xs font-medium text-[var(--color-text-primary)] rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] ${className}`}
+ className={`inline-flex items-center gap-1 text-xs font-medium text-[var(--color-text-primary)] rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${className}`}
>
{info.label}
<Info className="h-3 w-3 text-[var(--color-text-tertiary)]" aria-hidden />
diff --git a/packages/ui/src/health/biomarker-list.tsx b/packages/ui/src/health/biomarker-list.tsx
index 4934138a9..a62935116 100644
--- a/packages/ui/src/health/biomarker-list.tsx
+++ b/packages/ui/src/health/biomarker-list.tsx
@@ -193,7 +193,7 @@ function BiomarkerGroup({
}
}}
aria-expanded={expanded}
- className="flex w-full items-center gap-2 px-3 py-2 text-left cursor-pointer rounded-t-lg hover:bg-[var(--color-bg-elevated)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full items-center gap-2 px-3 py-2 text-left cursor-pointer rounded-t-lg hover:bg-[var(--color-bg-elevated)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{expanded ? (
<ChevronDown className="h-4 w-4 text-[var(--color-text-tertiary)]" />
diff --git a/packages/ui/src/health/code-health-lede.tsx b/packages/ui/src/health/code-health-lede.tsx
index 99b076d9a..f426f5d59 100644
--- a/packages/ui/src/health/code-health-lede.tsx
+++ b/packages/ui/src/health/code-health-lede.tsx
@@ -39,7 +39,7 @@ import { Info } from "lucide-react";
/** The lede's two quiet toggles: "Breakdown" under the figure, "How it is scored" under the prose. */
const DISCLOSURE =
- "inline-flex cursor-pointer list-none items-center gap-1 rounded text-[11px] font-medium text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] [&::-webkit-details-marker]:hidden";
+ "inline-flex cursor-pointer list-none items-center gap-1 rounded text-[11px] font-medium text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] [&::-webkit-details-marker]:hidden";
const HEALTH_HINT =
"Fitted against real bug history to predict where defects appear. Built from " +
@@ -384,7 +384,7 @@ export function CodeHealthLede({
return (
<details className="group/lede">
- <summary className="flex cursor-pointer list-none flex-wrap items-baseline gap-x-2.5 gap-y-1 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] [&::-webkit-details-marker]:hidden">
+ <summary className="flex cursor-pointer list-none flex-wrap items-baseline gap-x-2.5 gap-y-1 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] [&::-webkit-details-marker]:hidden">
<span className="font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]">
Code health
</span>
diff --git a/packages/ui/src/health/code-health-map.tsx b/packages/ui/src/health/code-health-map.tsx
index 89dc6e997..590600818 100644
--- a/packages/ui/src/health/code-health-map.tsx
+++ b/packages/ui/src/health/code-health-map.tsx
@@ -309,7 +309,7 @@ export function CodeHealthMap({
data-matches={model.matches.length}
data-selected={selectedIdx >= 0 ? (selectedPath ?? undefined) : undefined}
data-keyboard-cursor={cursorItem?.path}
- className="relative w-full overflow-hidden rounded-xl border border-[var(--color-border-default)] has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--color-accent-primary)]"
+ className="relative w-full overflow-hidden rounded-xl border border-[var(--color-border-default)] has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--color-focus-ring)]"
style={{
minHeight,
background: "radial-gradient(ellipse at 50% 42%, var(--color-bg-surface), var(--color-bg-root) 75%)",
diff --git a/packages/ui/src/health/file-drawer/issues.tsx b/packages/ui/src/health/file-drawer/issues.tsx
index 3a24a5e7d..82faf2fc9 100644
--- a/packages/ui/src/health/file-drawer/issues.tsx
+++ b/packages/ui/src/health/file-drawer/issues.tsx
@@ -124,7 +124,7 @@ function IssueRow({
// Only while the body is mounted: an id that resolves to nothing is
// a broken reference for assistive tech.
{...(open ? { "aria-controls": bodyId } : {})}
- className="flex min-w-0 flex-1 flex-col gap-0.5 rounded-sm py-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex min-w-0 flex-1 flex-col gap-0.5 rounded-sm py-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<span className="flex min-w-0 items-baseline gap-2">
<ChevronRight
@@ -429,7 +429,7 @@ function TriageMenu({
<PopoverTrigger
aria-label={`Triage ${label}`}
disabled={disabled}
- className="rounded-md p-1 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-selected)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] disabled:opacity-50"
+ className="rounded-md p-1 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-selected)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50"
>
<MoreHorizontal className="h-4 w-4" aria-hidden="true" />
</PopoverTrigger>
@@ -457,7 +457,7 @@ function TriageMenu({
onSelect(opt.value);
}}
className={cn(
- "block w-full rounded px-2 py-1.5 text-left text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "block w-full rounded px-2 py-1.5 text-left text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
current
? "font-medium text-[var(--color-text-primary)]"
: "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-selected)] hover:text-[var(--color-text-primary)]",
diff --git a/packages/ui/src/health/file-drawer/performance-causes.tsx b/packages/ui/src/health/file-drawer/performance-causes.tsx
index 60d2f1807..3a15df691 100644
--- a/packages/ui/src/health/file-drawer/performance-causes.tsx
+++ b/packages/ui/src/health/file-drawer/performance-causes.tsx
@@ -114,7 +114,7 @@ function CauseRow({
<button
type="button"
onClick={() => onSelect(o.opportunity_id)}
- className="flex w-full flex-col gap-0.5 px-1 py-2 text-left transition-colors hover:bg-[var(--color-bg-selected)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full flex-col gap-0.5 px-1 py-2 text-left transition-colors hover:bg-[var(--color-bg-selected)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{body}
</button>
diff --git a/packages/ui/src/health/file-drawer/shared.ts b/packages/ui/src/health/file-drawer/shared.ts
index d462fb4c3..fef7769ae 100644
--- a/packages/ui/src/health/file-drawer/shared.ts
+++ b/packages/ui/src/health/file-drawer/shared.ts
@@ -28,7 +28,7 @@ export const CLOSED_STATUSES = new Set(["resolved", "false_positive"]);
/** A link in ink, not accent: the accent belongs to the one primary action. */
export const QUIET_LINK =
- "inline-flex w-fit items-center gap-1.5 rounded-sm text-xs font-medium text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "inline-flex w-fit items-center gap-1.5 rounded-sm text-xs font-medium text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
export const MICRO_LABEL =
"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-tertiary)]";
diff --git a/packages/ui/src/health/file-drawer/verdict.tsx b/packages/ui/src/health/file-drawer/verdict.tsx
index 4e861afbf..6c794af3b 100644
--- a/packages/ui/src/health/file-drawer/verdict.tsx
+++ b/packages/ui/src/health/file-drawer/verdict.tsx
@@ -61,7 +61,7 @@ export function VerdictSection({
{/* The prompt is the one primary action, withheld only when the
verdict is the all-clear and there is nothing for it to fix. */}
{model.showPrompt ? (
- <AiPromptButton onClick={onPrompt} label="Fix with AI prompt" />
+ <AiPromptButton onClick={onPrompt} />
) : null}
<PlanLink href={planTarget} onNavigate={onNavigate} />
{fullPage ? (
diff --git a/packages/ui/src/health/file-opportunity.tsx b/packages/ui/src/health/file-opportunity.tsx
index be0bf576f..6b88d8d11 100644
--- a/packages/ui/src/health/file-opportunity.tsx
+++ b/packages/ui/src/health/file-opportunity.tsx
@@ -126,7 +126,7 @@ export function FindingOpportunityLink({
}
: (e) => e.stopPropagation()
}
- className="inline-flex items-center gap-1.5 rounded text-[11.5px] font-medium text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex items-center gap-1.5 rounded text-[11.5px] font-medium text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
>
<Wrench className="h-3 w-3" aria-hidden="true" />
Refactoring plan: {stepSummary(opportunity)}
diff --git a/packages/ui/src/health/file-path-picker.tsx b/packages/ui/src/health/file-path-picker.tsx
index eeb1651a3..4764567c0 100644
--- a/packages/ui/src/health/file-path-picker.tsx
+++ b/packages/ui/src/health/file-path-picker.tsx
@@ -104,7 +104,7 @@ export function FilePathPicker({ selected, onAdd, onRemove, onSearch }: FilePath
return (
<div ref={containerRef} className="relative">
<div
- className="flex flex-wrap items-center gap-1.5 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1.5 focus-within:ring-1 focus-within:ring-[var(--color-accent-primary)]"
+ className="flex flex-wrap items-center gap-1.5 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1.5 focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"
onClick={() => containerRef.current?.querySelector("input")?.focus()}
>
{selected.map((p) => (
diff --git a/packages/ui/src/health/fix-first/fix-first-item.tsx b/packages/ui/src/health/fix-first/fix-first-item.tsx
index e43ebd40a..86e98a40b 100644
--- a/packages/ui/src/health/fix-first/fix-first-item.tsx
+++ b/packages/ui/src/health/fix-first/fix-first-item.tsx
@@ -42,11 +42,11 @@ const TIER_DOT: Record<FixTier, string> = {
const LINK =
- "rounded 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)]";
+ "rounded text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
/** File paths are reference text: muted at rest, readable on hover, never accent. */
const PATH_LINK =
- "rounded text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "rounded text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
export interface FixFirstItemProps {
item: FixItem;
@@ -100,7 +100,7 @@ export function FixFirstItem({
onClick={onToggle}
aria-expanded={expanded}
aria-controls={panelId}
- className="group/row flex w-full min-w-0 items-start justify-between gap-3 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="group/row flex w-full min-w-0 items-start justify-between gap-3 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<span className="min-w-0 text-[13px] font-medium leading-5 text-[var(--color-text-primary)] [overflow-wrap:anywhere]">
{item.title}
@@ -380,7 +380,7 @@ function Actions({
type="button"
disabled={pending || saved === status}
onClick={() => void triage(status)}
- className="rounded-md border border-[var(--color-border-default)] px-2 py-1 font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] disabled:opacity-50"
+ className="rounded-md border border-[var(--color-border-default)] px-2 py-1 font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50"
>
{STATUS_LABEL[status]}
</button>
diff --git a/packages/ui/src/health/fix-first/fix-first-list.tsx b/packages/ui/src/health/fix-first/fix-first-list.tsx
index 8d4bf97e6..b5e533bb2 100644
--- a/packages/ui/src/health/fix-first/fix-first-list.tsx
+++ b/packages/ui/src/health/fix-first/fix-first-list.tsx
@@ -98,7 +98,7 @@ export function FixFirstList({
const excludedControl =
excludedTotal > 0 ? (
<Popover>
- <PopoverTrigger className="rounded text-xs text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">
+ <PopoverTrigger className="rounded text-xs text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]">
<span className="tabular-nums">{formatNumber(excludedTotal)}</span> excluded
</PopoverTrigger>
<PopoverContent align="start">
diff --git a/packages/ui/src/health/impact-effort-quadrant.tsx b/packages/ui/src/health/impact-effort-quadrant.tsx
index fd1dd8dc4..ea122c8fd 100644
--- a/packages/ui/src/health/impact-effort-quadrant.tsx
+++ b/packages/ui/src/health/impact-effort-quadrant.tsx
@@ -231,7 +231,7 @@ export function ImpactEffortQuadrant({
aria-label={`Impact and effort plot of ${fmt(data.plotted)} files. Arrow keys step through them, largest gain first. Enter finds the file in the list.`}
onKeyDown={onKeyDown}
onBlur={() => setActive(null)}
- className="rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className="rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]"
>
<svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden="true" className="block">
{/* Axes */}
diff --git a/packages/ui/src/health/map/controls.tsx b/packages/ui/src/health/map/controls.tsx
index 233586f9a..7dd517d2f 100644
--- a/packages/ui/src/health/map/controls.tsx
+++ b/packages/ui/src/health/map/controls.tsx
@@ -35,7 +35,7 @@ export function ZoomControls({
aria-label={b.label}
title={b.label}
onClick={b.act}
- className={`min-w-[28px] px-2 py-1 font-mono tabular-nums text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-accent-primary)] ${
+ className={`min-w-[28px] px-2 py-1 font-mono tabular-nums text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-focus-ring)] ${
i > 0 ? "border-l border-[var(--color-border-default)]" : ""
}`}
>
diff --git a/packages/ui/src/health/map/inspector.tsx b/packages/ui/src/health/map/inspector.tsx
index 4ad1ae585..9d1786ee5 100644
--- a/packages/ui/src/health/map/inspector.tsx
+++ b/packages/ui/src/health/map/inspector.tsx
@@ -117,7 +117,7 @@ export function MapFieldList({
aria-current={selected ? "true" : undefined}
className={cn(
"flex w-full flex-col gap-0.5 px-1.5 py-2 text-left transition-colors",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
selected
? "bg-[var(--color-bg-selected)] shadow-[inset_2px_0_0_var(--color-tab-active)]"
: "hover:bg-[var(--color-bg-elevated)]",
diff --git a/packages/ui/src/health/map/labels.tsx b/packages/ui/src/health/map/labels.tsx
index 211703d3e..bb57cf456 100644
--- a/packages/ui/src/health/map/labels.tsx
+++ b/packages/ui/src/health/map/labels.tsx
@@ -140,7 +140,7 @@ export function AreaLabels({
data-area={l.path}
data-dominated={l.dominated ? "true" : undefined}
className={`group pointer-events-auto absolute left-0 top-0 flex max-w-[220px] flex-col items-center rounded px-1.5 py-0.5 text-center leading-tight bg-[var(--color-bg-glass)] data-[state=open]:flex-row data-[state=open]:gap-1.5 ${
- cursor === l.path ? "ring-2 ring-[var(--color-accent-primary)]" : ""
+ cursor === l.path ? "ring-2 ring-[var(--color-focus-ring)]" : ""
}`}
style={{ visibility: "hidden" }}
>
diff --git a/packages/ui/src/health/map/legend.tsx b/packages/ui/src/health/map/legend.tsx
index 7428cff4a..1e90120ea 100644
--- a/packages/ui/src/health/map/legend.tsx
+++ b/packages/ui/src/health/map/legend.tsx
@@ -128,7 +128,7 @@ export function MapLensSwitcher({
<button
type="button"
aria-haspopup="menu"
- className="inline-flex items-center gap-1 rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex items-center gap-1 rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{moreLabel}
<ChevronDown aria-hidden className="h-3.5 w-3.5" />
@@ -145,7 +145,7 @@ export function MapLensSwitcher({
setOpen(false);
onOverlayChange(lens);
}}
- className={`flex w-full items-center rounded px-2 py-1.5 text-left text-xs hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] ${
+ className={`flex w-full items-center rounded px-2 py-1.5 text-left text-xs hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${
lens === overlay
? "font-semibold text-[var(--color-text-primary)]"
: "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]"
diff --git a/packages/ui/src/health/map/scope-note.tsx b/packages/ui/src/health/map/scope-note.tsx
index 141d2304a..e0741d93e 100644
--- a/packages/ui/src/health/map/scope-note.tsx
+++ b/packages/ui/src/health/map/scope-note.tsx
@@ -16,7 +16,7 @@ import type { MapScope } from "./types";
import type { MapCanvasLabels } from "./canvas-labels";
const ACTION =
- "pointer-events-auto rounded px-1 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)] disabled:cursor-wait disabled:opacity-60";
+ "pointer-events-auto rounded px-1 text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-wait disabled:opacity-60";
const plural = (n: number, one: string, many: string) => (n === 1 ? one : many);
diff --git a/packages/ui/src/health/performance/area-groups.tsx b/packages/ui/src/health/performance/area-groups.tsx
index 78db40de7..4d50f4daa 100644
--- a/packages/ui/src/health/performance/area-groups.tsx
+++ b/packages/ui/src/health/performance/area-groups.tsx
@@ -140,7 +140,7 @@ const AreaCard = memo(function AreaCard({
type="button"
onClick={() => setOpen((value) => !value)}
aria-expanded={open}
- className="flex w-full min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded text-left sm:w-auto sm:flex-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded text-left sm:w-auto sm:flex-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<ChevronRight
aria-hidden="true"
diff --git a/packages/ui/src/health/performance/drawer/fix.tsx b/packages/ui/src/health/performance/drawer/fix.tsx
index 3765bd25c..35c5fd1a4 100644
--- a/packages/ui/src/health/performance/drawer/fix.tsx
+++ b/packages/ui/src/health/performance/drawer/fix.tsx
@@ -144,7 +144,7 @@ export function MapLink({
return (
<a
href={href}
- className="inline-block rounded text-sm 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="inline-block rounded text-sm 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-focus-ring)]"
>
Show this cause on the map
</a>
@@ -169,7 +169,7 @@ function SiblingLink({
<button
type="button"
onClick={() => onSelect(sibling.opportunity_id)}
- className="rounded 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 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-focus-ring)]"
>
{label}
</button>
diff --git a/packages/ui/src/health/performance/drawer/index.tsx b/packages/ui/src/health/performance/drawer/index.tsx
index 727d24eb5..deba4960f 100644
--- a/packages/ui/src/health/performance/drawer/index.tsx
+++ b/packages/ui/src/health/performance/drawer/index.tsx
@@ -111,7 +111,6 @@ export default function OpportunityDrawer({
<AiPromptButton
label={AGENT_PROMPT_LABEL}
onClick={() => onAgentPrompt(current)}
- className="px-3.5 py-2 text-sm"
/>
</div>
</div>
diff --git a/packages/ui/src/health/performance/drawer/plan.tsx b/packages/ui/src/health/performance/drawer/plan.tsx
index 94a08e60e..ee5d817aa 100644
--- a/packages/ui/src/health/performance/drawer/plan.tsx
+++ b/packages/ui/src/health/performance/drawer/plan.tsx
@@ -211,7 +211,7 @@ export function PlanSection({
{href ? (
<a
href={href}
- className="mt-2 inline-block rounded text-sm 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="mt-2 inline-block rounded text-sm 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-focus-ring)]"
>
Open the plan on Refactoring
</a>
diff --git a/packages/ui/src/health/performance/evidence.tsx b/packages/ui/src/health/performance/evidence.tsx
index b1718e536..598c25939 100644
--- a/packages/ui/src/health/performance/evidence.tsx
+++ b/packages/ui/src/health/performance/evidence.tsx
@@ -57,7 +57,7 @@ export function RawObservations({
type="button"
onClick={() => setOpen((value) => !value)}
aria-expanded={open}
- className="rounded text-sm font-medium text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded text-sm font-medium text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-text-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{open ? "Hide" : "Read"} the raw observations
<span className="tabular-nums"> ({reportedTotal.toLocaleString()})</span>
diff --git a/packages/ui/src/health/performance/queue.tsx b/packages/ui/src/health/performance/queue.tsx
index 81ca9166a..9736b6ad0 100644
--- a/packages/ui/src/health/performance/queue.tsx
+++ b/packages/ui/src/health/performance/queue.tsx
@@ -130,7 +130,7 @@ function MetaLine({ opportunity }: { opportunity: PerformanceOpportunity }) {
/** A quiet link: secondary ink at rest, the accent only on hover and focus. */
export const QUIET_LINK_CLS =
- "rounded text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-accent-primary)] hover:underline focus-visible:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "rounded text-[var(--color-text-secondary)] underline-offset-2 hover:text-[var(--color-accent-primary)] hover:underline focus-visible:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
/**
* Memoized because a page is up to a hundred of these and the surrounding
@@ -246,7 +246,7 @@ function RowOverflow({
setOpen(false);
onClick();
}}
- className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Icon className="h-3.5 w-3.5 shrink-0" aria-hidden="true" />
{label}
diff --git a/packages/ui/src/health/performance/states.tsx b/packages/ui/src/health/performance/states.tsx
index 0e3c7864c..b6000b2f2 100644
--- a/packages/ui/src/health/performance/states.tsx
+++ b/packages/ui/src/health/performance/states.tsx
@@ -176,7 +176,7 @@ export function LinkedCauseUnavailable({
<button
type="button"
onClick={onDismiss}
- className="rounded 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-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
Dismiss
</button>
diff --git a/packages/ui/src/health/preview-badge.tsx b/packages/ui/src/health/preview-badge.tsx
index a09457847..14a645bad 100644
--- a/packages/ui/src/health/preview-badge.tsx
+++ b/packages/ui/src/health/preview-badge.tsx
@@ -51,7 +51,7 @@ export function PreviewBadge({
data-preview
aria-label={label ? `${label}: ${text}` : strings.ariaLabel(text)}
onClick={(e) => e.stopPropagation()}
- className="rounded border border-[var(--color-border-default)] px-1 font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded border border-[var(--color-border-default)] px-1 font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{label ?? strings.label}
</button>
diff --git a/packages/ui/src/health/refactoring-card.tsx b/packages/ui/src/health/refactoring-card.tsx
index a9b5a21c0..f9abe896f 100644
--- a/packages/ui/src/health/refactoring-card.tsx
+++ b/packages/ui/src/health/refactoring-card.tsx
@@ -221,7 +221,7 @@ export function HealthWorkItemCard({
type="button"
data-work-item-header=""
onClick={onSelect ? () => onSelect(target) : undefined}
- className="group/file flex w-full items-center gap-1.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] disabled:cursor-default"
+ className="group/file flex w-full items-center gap-1.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-default"
disabled={!onSelect}
title={onSelect ? "Open file health drawer" : undefined}
>
@@ -269,7 +269,7 @@ export function HealthWorkItemCard({
type="button"
onClick={toggle}
aria-expanded={expanded}
- className="flex w-full items-center gap-2 border-t border-[var(--color-border-default)] px-4 py-2 text-xs text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full items-center gap-2 border-t border-[var(--color-border-default)] px-4 py-2 text-xs text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-focus-ring)]"
>
{expanded ? <ChevronDown className="h-3.5 w-3.5" /> : <ChevronRight className="h-3.5 w-3.5" />}
{expanded ? "Hide" : "Show"} all {target.finding_count} findings
diff --git a/packages/ui/src/health/related-work.tsx b/packages/ui/src/health/related-work.tsx
index 8c68416f6..8928699d7 100644
--- a/packages/ui/src/health/related-work.tsx
+++ b/packages/ui/src/health/related-work.tsx
@@ -266,7 +266,7 @@ function RelatedRow({
}
: (e) => e.stopPropagation()
}
- className="flex items-baseline gap-2 rounded text-[var(--color-text-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex items-baseline gap-2 rounded text-[var(--color-text-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
>
{text}
</a>
diff --git a/packages/ui/src/health/row-prompt-action.tsx b/packages/ui/src/health/row-prompt-action.tsx
index fbe0fcd51..22b2be39b 100644
--- a/packages/ui/src/health/row-prompt-action.tsx
+++ b/packages/ui/src/health/row-prompt-action.tsx
@@ -6,9 +6,10 @@ import { AGENT_PROMPT_LABEL, bulkAgentPromptLabel } from "./ai-prompt-action";
/**
* The per-row "hand this to your agent" action. Ghost (icon + label, no fill)
- * so a column of them does not shout, and revealed on row hover, keyboard
- * focus within the row, and the selected row. It stays in the tab order and
- * shows on focus, and it is always visible where there is no hover (touch).
+ * so a column of them does not shout, or icon-only for a dense table, and
+ * revealed on row hover, keyboard focus within the row, and the selected row.
+ * It stays in the tab order and shows on focus, and it is always visible
+ * where there is no hover (touch).
*
* The row must carry `group/row` (and `data-selected` when selected), as
* `ResponsiveTable` rows do. The click usually calls `openPrompt` from
@@ -18,17 +19,20 @@ export function RowPromptAction({
onClick,
label = AGENT_PROMPT_LABEL,
subject,
+ variant = "ghost",
className,
}: {
onClick: () => void;
label?: string;
+ /** `icon` for a dense table row; the label is then the accessible name. */
+ variant?: "ghost" | "icon";
/** What the row is about, e.g. its path; names the action for screen readers. */
subject?: string;
className?: string;
}) {
return (
<AiPromptButton
- variant="ghost"
+ variant={variant}
label={label}
{...(subject ? { ariaLabel: `${label}: ${subject}` } : {})}
onClick={onClick}
@@ -41,7 +45,7 @@ export function RowPromptAction({
}
/**
- * The filled header action: one prompt over every row the current filters
+ * The header action: one prompt over every row the current filters
* show. Renders nothing for an empty list, since a prompt about nothing is
* not an action.
*/
diff --git a/packages/ui/src/health/trend-chart.tsx b/packages/ui/src/health/trend-chart.tsx
index fe60c19e4..4a751032d 100644
--- a/packages/ui/src/health/trend-chart.tsx
+++ b/packages/ui/src/health/trend-chart.tsx
@@ -494,7 +494,7 @@ function LegendButton({
onPointerLeave={() => onEmphasis(null)}
onFocus={emphasise}
onBlur={() => onEmphasis(null)}
- className={`inline-flex items-center gap-1.5 rounded px-1.5 py-1 transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)] disabled:cursor-default ${
+ className={`inline-flex items-center gap-1.5 rounded px-1.5 py-1 transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] disabled:cursor-default ${
on ? "text-[var(--color-text-secondary)]" : "text-[var(--color-text-tertiary)] line-through"
}`}
>
@@ -655,7 +655,7 @@ export function TrendChart({ history, height = 220 }: TrendChartProps) {
role="group"
aria-label="Health KPI trend. Arrow keys step through snapshots."
{...box}
- className="relative rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className="relative rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-focus-ring)]"
>
<svg
width={g.width}
diff --git a/packages/ui/src/health/trend-view.tsx b/packages/ui/src/health/trend-view.tsx
index f30b65639..836831238 100644
--- a/packages/ui/src/health/trend-view.tsx
+++ b/packages/ui/src/health/trend-view.tsx
@@ -210,7 +210,7 @@ function MoverRow({
type="button"
onClick={() => onSelectFile(row.file_path)}
title={row.file_path}
- className={`${grid} rounded transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]`}
+ className={`${grid} rounded transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]`}
>
{body}
</button>
@@ -254,7 +254,7 @@ function MoverGroup({
<button
type="button"
onClick={() => setOpen((v) => !v)}
- className="self-start rounded px-2 py-1 text-xs text-[var(--color-accent-primary)] hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className="self-start rounded px-2 py-1 text-xs text-[var(--color-accent-primary)] hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]"
>
{open ? "Show fewer" : `Show ${rows.length - GROUP_MAX} more`}
</button>
diff --git a/packages/ui/src/overview/action-drawer.tsx b/packages/ui/src/overview/action-drawer.tsx
index e2e12cc90..abc67193d 100644
--- a/packages/ui/src/overview/action-drawer.tsx
+++ b/packages/ui/src/overview/action-drawer.tsx
@@ -89,7 +89,7 @@ export function ActionDrawer({
);
const Link = LinkComponent ?? "a";
const linkCls =
- "rounded text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "rounded text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
return (
<AdaptivePanel
@@ -255,7 +255,7 @@ export function ActionDrawer({
onAnswer(state, message);
onClose();
}}
- className="inline-flex items-center gap-1.5 rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-surface)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex items-center gap-1.5 rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-surface)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Icon className="h-3.5 w-3.5" aria-hidden="true" />
{label}
@@ -303,7 +303,7 @@ function EvidenceList({
{href ? (
<Link
href={href}
- className="min-w-0 rounded font-mono text-xs text-[var(--color-accent-primary)] [overflow-wrap:anywhere] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="min-w-0 rounded font-mono text-xs text-[var(--color-accent-primary)] [overflow-wrap:anywhere] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{where}
</Link>
@@ -334,7 +334,7 @@ function EvidenceList({
<button
type="button"
onClick={() => setAll((a) => !a)}
- className="rounded text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{all ? "Show fewer" : `Show all ${details.length.toLocaleString()}`}
</button>
diff --git a/packages/ui/src/overview/explore-cards.tsx b/packages/ui/src/overview/explore-cards.tsx
index b6b3c4fc5..4ef08e23d 100644
--- a/packages/ui/src/overview/explore-cards.tsx
+++ b/packages/ui/src/overview/explore-cards.tsx
@@ -50,7 +50,7 @@ export function ExploreCards({
>
<A
href={c.href}
- className="flex flex-1 flex-col gap-1.5 rounded-lg px-5 py-4 no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex flex-1 flex-col gap-1.5 rounded-lg px-5 py-4 no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<span className="flex items-center justify-between gap-2 text-xs font-medium text-[var(--color-text-secondary)]">
{c.label}
diff --git a/packages/ui/src/overview/next-actions.tsx b/packages/ui/src/overview/next-actions.tsx
index ad8e13c10..85d5b03de 100644
--- a/packages/ui/src/overview/next-actions.tsx
+++ b/packages/ui/src/overview/next-actions.tsx
@@ -261,7 +261,7 @@ export function NextActions({
<button
type="button"
onClick={() => setExpanded((e) => !e)}
- className="rounded text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{expanded ? "Show fewer" : `Show all ${Math.min(rows.length, total).toLocaleString()}`}
</button>
diff --git a/packages/ui/src/overview/section.tsx b/packages/ui/src/overview/section.tsx
index b22cc2c2f..b1f37ce46 100644
--- a/packages/ui/src/overview/section.tsx
+++ b/packages/ui/src/overview/section.tsx
@@ -78,7 +78,7 @@ export function OverviewSection({
)}
>
<details open={defaultOpen} className="group/section flex flex-col gap-3">
- <summary className="flex cursor-pointer list-none flex-wrap items-baseline gap-x-2 gap-y-1 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">
+ <summary className="flex cursor-pointer list-none flex-wrap items-baseline gap-x-2 gap-y-1 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]">
<span
className="text-[var(--color-text-tertiary)] transition-transform group-open/section:rotate-90"
aria-hidden
diff --git a/packages/ui/src/owners/knowledge-area-list.tsx b/packages/ui/src/owners/knowledge-area-list.tsx
index 6586db7c6..0154fc790 100644
--- a/packages/ui/src/owners/knowledge-area-list.tsx
+++ b/packages/ui/src/owners/knowledge-area-list.tsx
@@ -75,7 +75,7 @@ export function KnowledgeAreaRow({
aria-expanded={open}
aria-controls={panelId}
onClick={() => setOpen((o) => !o)}
- className="group flex min-w-0 flex-1 items-start gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="group flex min-w-0 flex-1 items-start gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<span
aria-hidden
diff --git a/packages/ui/src/owners/people-picker.tsx b/packages/ui/src/owners/people-picker.tsx
index 49262e567..8f18226f0 100644
--- a/packages/ui/src/owners/people-picker.tsx
+++ b/packages/ui/src/owners/people-picker.tsx
@@ -174,7 +174,7 @@ function SelectedPeople({
type="button"
onClick={() => onRemove(key)}
aria-label={removeLabel(p.name)}
- className="rounded-full p-0.5 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)]"
+ className="rounded-full p-0.5 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-3 w-3" />
</button>
diff --git a/packages/ui/src/present/deck-view.tsx b/packages/ui/src/present/deck-view.tsx
index bad1aeac6..42f66fcbf 100644
--- a/packages/ui/src/present/deck-view.tsx
+++ b/packages/ui/src/present/deck-view.tsx
@@ -19,7 +19,7 @@ interface DeckViewProps {
}
const FOCUS =
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
// Fresh is the quiet default; only a source that needs attention is marked.
const FRESHNESS: Record<string, { color: string; word: string }> = {
diff --git a/packages/ui/src/present/present-overlay.tsx b/packages/ui/src/present/present-overlay.tsx
index f9cd31cdf..e7b4e9f6a 100644
--- a/packages/ui/src/present/present-overlay.tsx
+++ b/packages/ui/src/present/present-overlay.tsx
@@ -64,7 +64,7 @@ export function PresentOverlay({ model, onClose, onOpenPage }: PresentOverlayPro
onClick={onClose}
aria-label="Close presentation (Esc)"
title="Close (Esc)"
- className="rounded-md p-1.5 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-md p-1.5 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-4 w-4" />
</button>
diff --git a/packages/ui/src/present/slide-progress.tsx b/packages/ui/src/present/slide-progress.tsx
index e4d4faa60..10ea26f0c 100644
--- a/packages/ui/src/present/slide-progress.tsx
+++ b/packages/ui/src/present/slide-progress.tsx
@@ -30,7 +30,7 @@ export function SlideProgress({
aria-label={`Go to slide ${i + 1}`}
aria-current={i === index ? "step" : undefined}
className={cn(
- "h-1.5 rounded-full transition-all motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "h-1.5 rounded-full transition-all motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
i === index
? "w-5 bg-[var(--color-control-selected)]"
: "w-1.5 bg-[var(--color-border-active)] hover:bg-[var(--color-text-tertiary)]",
diff --git a/packages/ui/src/refactoring/opportunity-drawer.tsx b/packages/ui/src/refactoring/opportunity-drawer.tsx
index 39243908e..632915ade 100644
--- a/packages/ui/src/refactoring/opportunity-drawer.tsx
+++ b/packages/ui/src/refactoring/opportunity-drawer.tsx
@@ -25,7 +25,8 @@
*/
import * as React from "react";
-import { Layers, Sparkles, Terminal } from "lucide-react";
+import { Layers, Terminal } from "lucide-react";
+import { AiPromptButton } from "../health/ai-prompt-button";
import { Sheet, SheetContent, SheetTitle } from "../ui/sheet";
import { Skeleton, SkeletonRegion } from "../ui/skeleton";
@@ -515,14 +516,7 @@ function DrawerBody({
agent an empty plan. */}
{onAiPrompt && !stepsUnavailable ? (
<div className="flex items-center gap-3 border-t border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-5 py-3.5">
- <button
- type="button"
- onClick={() => onAiPrompt(detail)}
- 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 agent
- </button>
+ <AiPromptButton onClick={() => onAiPrompt(detail)} />
<span className="hidden text-xs text-[var(--color-text-tertiary)] sm:block">
The ordered steps, the evidence, and the id to query it back.
</span>
@@ -679,7 +673,7 @@ function StepCode({
type="button"
aria-expanded={open}
onClick={() => setOpen((o) => !o)}
- 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)]"
+ 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-focus-ring)]"
>
{open ? "Hide the code" : "Show the code"}
</button>
diff --git a/packages/ui/src/refactoring/opportunity-rows.tsx b/packages/ui/src/refactoring/opportunity-rows.tsx
index 78cd2d028..7770424d2 100644
--- a/packages/ui/src/refactoring/opportunity-rows.tsx
+++ b/packages/ui/src/refactoring/opportunity-rows.tsx
@@ -376,7 +376,7 @@ function RowOverflow({
}}
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
+ Copy prompt
</button>
) : null}
{href ? (
diff --git a/packages/ui/src/refactoring/refactoring-board.tsx b/packages/ui/src/refactoring/refactoring-board.tsx
index 482b469fb..1ab5464e3 100644
--- a/packages/ui/src/refactoring/refactoring-board.tsx
+++ b/packages/ui/src/refactoring/refactoring-board.tsx
@@ -286,7 +286,7 @@ export function RefactoringBoard({
onChange={(e) =>
onServerStateChange({ order: e.target.value as RefactoringOrder, offset: 0 })
}
- className="h-9 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 text-sm text-[var(--color-text-primary)] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent-primary)]"
+ className="h-9 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 text-sm text-[var(--color-text-primary)] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]"
>
{SORT_OPTIONS.map((o) => (
<option key={o.value} value={o.value}>
diff --git a/packages/ui/src/refactoring/refactoring-drawer.tsx b/packages/ui/src/refactoring/refactoring-drawer.tsx
index 6c4000941..a917911e5 100644
--- a/packages/ui/src/refactoring/refactoring-drawer.tsx
+++ b/packages/ui/src/refactoring/refactoring-drawer.tsx
@@ -20,7 +20,8 @@
*/
import type { ReactNode } from "react";
-import { Layers, Sparkles, TrendingUp, Wand2 } from "lucide-react";
+import { Layers, TrendingUp, Wand2 } from "lucide-react";
+import { AiPromptButton } from "../health/ai-prompt-button";
import { CollapsibleSection } from "../shared/collapsible-section";
import { Sheet, SheetContent, SheetTitle } from "../ui/sheet";
@@ -347,14 +348,7 @@ function DrawerBody({
{onAiPrompt ? (
<div className="flex items-center gap-3 border-t border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-5 py-3.5">
- <button
- type="button"
- onClick={() => onAiPrompt(plan)}
- 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 agent
- </button>
+ <AiPromptButton onClick={() => onAiPrompt(plan)} />
<span className="hidden text-xs text-[var(--color-text-tertiary)] sm:block">
The steps, the blast radius, and a completion contract.
</span>
diff --git a/packages/ui/src/refactoring/refactoring-lede.tsx b/packages/ui/src/refactoring/refactoring-lede.tsx
index 26b42291b..7833af21d 100644
--- a/packages/ui/src/refactoring/refactoring-lede.tsx
+++ b/packages/ui/src/refactoring/refactoring-lede.tsx
@@ -81,7 +81,7 @@ function LedeChips({
<button
type="button"
onClick={onSeeStructural}
- className="rounded text-xs 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 text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
See the{" "}
<span className="font-mono tabular-nums">{formatNumber(structuralShown)}</span>{" "}
diff --git a/packages/ui/src/settings/model-combobox.tsx b/packages/ui/src/settings/model-combobox.tsx
index a56b3459f..0ba153930 100644
--- a/packages/ui/src/settings/model-combobox.tsx
+++ b/packages/ui/src/settings/model-combobox.tsx
@@ -9,6 +9,7 @@
import { useId, useMemo, useState, type KeyboardEvent, type ReactNode } from "react";
import { Check } from "lucide-react";
+import { FIELD_CLASS } from "../ui/input";
import { Spinner } from "../ui/spinner";
import { cn } from "../lib/cn";
@@ -229,8 +230,8 @@ export function ModelCombobox({
onBlur={state.hide}
onKeyDown={state.onKeyDown}
className={cn(
- "box-border flex h-8 w-full min-w-0 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 font-mono text-xs text-[var(--color-text-primary)]",
- "placeholder:text-[var(--color-text-tertiary)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent-primary)]",
+ FIELD_CLASS,
+ "box-border flex h-8 w-full min-w-0 px-2.5 font-mono text-xs",
)}
/>
{state.expanded && (
diff --git a/packages/ui/src/shared/breadcrumb.tsx b/packages/ui/src/shared/breadcrumb.tsx
index be65c1921..d1761b972 100644
--- a/packages/ui/src/shared/breadcrumb.tsx
+++ b/packages/ui/src/shared/breadcrumb.tsx
@@ -36,7 +36,7 @@ export function Breadcrumb({ segments, LinkComponent = "a" }: BreadcrumbProps) {
<button
type="button"
onClick={segment.onSelect}
- className="rounded text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors truncate focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors truncate focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{segment.label}
</button>
diff --git a/packages/ui/src/shared/code-block.tsx b/packages/ui/src/shared/code-block.tsx
index ba2751f37..5beb9d4f8 100644
--- a/packages/ui/src/shared/code-block.tsx
+++ b/packages/ui/src/shared/code-block.tsx
@@ -53,7 +53,7 @@ export function CodeFrame({ code, language, children, compact = false, label, cl
<button
type="button"
onClick={() => void copy()}
- className="inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs text-[var(--color-text-tertiary)] transition-opacity hover:text-[var(--color-text-primary)] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] pointer-fine:opacity-0 pointer-fine:group-hover/code:opacity-100 pointer-coarse:h-8 motion-reduce:transition-none"
+ className="inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs text-[var(--color-text-tertiary)] transition-opacity hover:text-[var(--color-text-primary)] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] pointer-fine:opacity-0 pointer-fine:group-hover/code:opacity-100 pointer-coarse:h-8 motion-reduce:transition-none"
aria-label="Copy code"
>
{copied ? <Check className="h-3.5 w-3.5" /> : <Copy className="h-3.5 w-3.5" />}
diff --git a/packages/ui/src/shared/collapsible-section.tsx b/packages/ui/src/shared/collapsible-section.tsx
index 3f790483b..9db4d2623 100644
--- a/packages/ui/src/shared/collapsible-section.tsx
+++ b/packages/ui/src/shared/collapsible-section.tsx
@@ -49,7 +49,7 @@ export function CollapsibleSection({
onClick={() => setOpen((v) => !v)}
aria-expanded={open}
aria-controls={bodyId}
- className="flex w-full items-center gap-2 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-sm font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full items-center gap-2 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-sm font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<span aria-hidden="true" className="text-[var(--color-text-tertiary)]">
{open ? "▾" : "▸"}
@@ -78,7 +78,7 @@ export function CollapsibleSection({
aria-expanded={open}
aria-controls={bodyId}
className={cn(
- "flex w-full min-w-0 items-center gap-2 rounded-sm text-left font-medium text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "flex w-full min-w-0 items-center gap-2 rounded-sm text-left font-medium text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
dense ? "py-2 text-xs" : "py-2.5 text-[15px]",
)}
>
diff --git a/packages/ui/src/shared/command-line.tsx b/packages/ui/src/shared/command-line.tsx
index bad3fdd26..4dbd4dea3 100644
--- a/packages/ui/src/shared/command-line.tsx
+++ b/packages/ui/src/shared/command-line.tsx
@@ -24,7 +24,7 @@ export function CommandLine({ command }: { command: string }) {
type="button"
onClick={() => void copy()}
aria-label={copied ? "Copied" : "Copy command"}
- className="inline-flex shrink-0 items-center gap-1 rounded text-xs 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)]"
+ className="inline-flex shrink-0 items-center gap-1 rounded text-xs text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{copied ? <Check className="h-3.5 w-3.5" /> : <Copy className="h-3.5 w-3.5" />}
<span aria-hidden>{copied ? "Copied" : "Copy"}</span>
diff --git a/packages/ui/src/shared/dismissible-notice.tsx b/packages/ui/src/shared/dismissible-notice.tsx
index 9d9d85960..50ccaec4f 100644
--- a/packages/ui/src/shared/dismissible-notice.tsx
+++ b/packages/ui/src/shared/dismissible-notice.tsx
@@ -85,7 +85,7 @@ export function DismissibleNotice({
type="button"
onClick={onDismiss}
aria-label={dismissLabel}
- className="-mr-1 shrink-0 rounded p-1 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="-mr-1 shrink-0 rounded p-1 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-3.5 w-3.5" aria-hidden="true" />
</button>
diff --git a/packages/ui/src/shared/file-path.tsx b/packages/ui/src/shared/file-path.tsx
index ed30daf9d..5a1db07cf 100644
--- a/packages/ui/src/shared/file-path.tsx
+++ b/packages/ui/src/shared/file-path.tsx
@@ -255,7 +255,7 @@ function CopyPathButton({ text, label, copiedLabel }: { text: string; label: str
}}
aria-label={copied ? copiedLabel : label}
className={cn(
- "ml-1 inline-flex shrink-0 items-center self-center rounded-sm hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "ml-1 inline-flex shrink-0 items-center self-center rounded-sm hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
DIM,
)}
>
diff --git a/packages/ui/src/shared/hairline-card.ts b/packages/ui/src/shared/hairline-card.ts
index 3693e6d63..54660a102 100644
--- a/packages/ui/src/shared/hairline-card.ts
+++ b/packages/ui/src/shared/hairline-card.ts
@@ -2,8 +2,8 @@ import { cn } from "../lib/cn";
/**
* The quiet card: a 1px hairline on the page ground, no fill, no shadow, no
- * lift. The hairline strengthens on hover and focus; the accent appears only
- * as a focus ring. For a discrete object a person opens or acts on, never for
+ * lift. The hairline strengthens on hover and focus, and a control gets the
+ * neutral focus ring. For a discrete object a person opens or acts on, never for
* a section or a statistic (DESIGN_LANGUAGE "Sections before cards").
*
* - `static`: a card nothing in it reacts to.
@@ -24,7 +24,7 @@ const STRONG = "border-[var(--color-border-hover)]";
const VARIANT: Record<HairlineCardVariant, string> = {
static: REST,
group: `${REST} transition-colors hover:border-[var(--color-border-hover)] focus-within:border-[var(--color-border-hover)]`,
- link: `${REST} transition-colors hover:border-[var(--color-border-hover)] focus-visible:border-[var(--color-border-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]`,
+ link: `${REST} transition-colors hover:border-[var(--color-border-hover)] focus-visible:border-[var(--color-border-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]`,
};
export function hairlineCardClass(
diff --git a/packages/ui/src/shared/info-tip.tsx b/packages/ui/src/shared/info-tip.tsx
index 523c33f13..4a84075a2 100644
--- a/packages/ui/src/shared/info-tip.tsx
+++ b/packages/ui/src/shared/info-tip.tsx
@@ -32,7 +32,7 @@ export function InfoTip({ content, label = "More info", className, side }: InfoT
aria-label={label}
onClick={(e) => e.stopPropagation()}
className={cn(
- "inline-flex shrink-0 items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] rounded-sm",
+ "inline-flex shrink-0 items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] rounded-sm",
className,
)}
>
diff --git a/packages/ui/src/shared/more-filters.tsx b/packages/ui/src/shared/more-filters.tsx
index 72be88321..160238e26 100644
--- a/packages/ui/src/shared/more-filters.tsx
+++ b/packages/ui/src/shared/more-filters.tsx
@@ -27,7 +27,7 @@ export function MoreFilters({
onClick={() => setOpen((value) => !value)}
aria-expanded={open}
aria-controls={panelId}
- className="inline-flex items-center gap-1 rounded text-xs font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex items-center gap-1 rounded text-xs font-medium text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<ChevronRight aria-hidden="true" className={`h-3.5 w-3.5 transition-transform ${open ? "rotate-90" : ""}`} />
{label}
@@ -81,7 +81,7 @@ export function ActiveFilterChips({
type="button"
onClick={() => remove(chip)}
aria-label={removeLabel(chip.label)}
- className="inline-flex items-center gap-1 rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 py-0.5 text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex items-center gap-1 rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 py-0.5 text-xs text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{chip.label}
<X aria-hidden="true" className="h-3 w-3" />
@@ -93,7 +93,7 @@ export function ActiveFilterChips({
<button
type="button"
onClick={onClearAll}
- 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)]"
+ 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-focus-ring)]"
>
{clearAllLabel}
</button>
diff --git a/packages/ui/src/shared/release-notice.tsx b/packages/ui/src/shared/release-notice.tsx
index 9ac175ad6..33f9742ba 100644
--- a/packages/ui/src/shared/release-notice.tsx
+++ b/packages/ui/src/shared/release-notice.tsx
@@ -117,7 +117,7 @@ function renderBody(
return detail ? (
<details className="group/release">
- <summary className="cursor-pointer list-none rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">
+ <summary className="cursor-pointer list-none rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]">
{lead}
{children}{" "}
<span className="text-[var(--color-accent-primary)] underline-offset-2 hover:underline">
diff --git a/packages/ui/src/shared/responsive-table/responsive-table.tsx b/packages/ui/src/shared/responsive-table/responsive-table.tsx
index a5f177b7e..536862b94 100644
--- a/packages/ui/src/shared/responsive-table/responsive-table.tsx
+++ b/packages/ui/src/shared/responsive-table/responsive-table.tsx
@@ -129,7 +129,7 @@ export function clickableRowProps<E extends HTMLElement>(activate: () => void) {
}
export const CLICKABLE_ROW_CLS =
- "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-accent-primary)]";
+ "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-focus-ring)]";
const NOOP_MEASURE = () => {};
@@ -249,7 +249,7 @@ export function ResponsiveTable<T>({
{c.sortable && onSort ? (
<button
type="button"
- className="inline-flex cursor-pointer select-none items-center font-medium uppercase tracking-wider focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] rounded"
+ className="inline-flex cursor-pointer select-none items-center font-medium uppercase tracking-wider focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] rounded"
onClick={() => onSort(c.key)}
>
{label}
diff --git a/packages/ui/src/shared/route-states.tsx b/packages/ui/src/shared/route-states.tsx
index 8bddf5190..ef720e40e 100644
--- a/packages/ui/src/shared/route-states.tsx
+++ b/packages/ui/src/shared/route-states.tsx
@@ -127,7 +127,7 @@ export function RouteNotFound({
{links.map((link, i) => (
<li
key={i}
- className="[&>a]:flex [&>a]:min-h-10 [&>a]:items-center [&>a]:gap-2 [&>a]:px-3 [&>a]:text-[var(--color-text-primary)] [&>a]:transition-colors [&>a:hover]:bg-[var(--color-bg-wash-hover)] [&>a:focus-visible]:outline-none [&>a:focus-visible]:ring-2 [&>a:focus-visible]:ring-[var(--color-accent-primary)] [&_svg]:h-4 [&_svg]:w-4 [&_svg]:text-[var(--color-text-tertiary)]"
+ className="[&>a]:flex [&>a]:min-h-10 [&>a]:items-center [&>a]:gap-2 [&>a]:px-3 [&>a]:text-[var(--color-text-primary)] [&>a]:transition-colors [&>a:hover]:bg-[var(--color-bg-wash-hover)] [&>a:focus-visible]:outline-none [&>a:focus-visible]:ring-2 [&>a:focus-visible]:ring-[var(--color-focus-ring)] [&_svg]:h-4 [&_svg]:w-4 [&_svg]:text-[var(--color-text-tertiary)]"
>
{link}
</li>
diff --git a/packages/ui/src/shared/row-overflow.tsx b/packages/ui/src/shared/row-overflow.tsx
index 1899e2e63..3bc34a046 100644
--- a/packages/ui/src/shared/row-overflow.tsx
+++ b/packages/ui/src/shared/row-overflow.tsx
@@ -40,7 +40,7 @@ export function RowOverflow({ label, items }: { label: string; items: RowOverflo
setOpen(false);
onSelect();
}}
- className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Icon className="h-3.5 w-3.5 shrink-0" aria-hidden="true" />
{itemLabel}
diff --git a/packages/ui/src/shared/segmented.tsx b/packages/ui/src/shared/segmented.tsx
index d78efa842..fac0bb808 100644
--- a/packages/ui/src/shared/segmented.tsx
+++ b/packages/ui/src/shared/segmented.tsx
@@ -86,7 +86,7 @@ export function Segmented<T extends string>({
onFocus={show}
onMouseLeave={o.disabledReason ? () => setReason(null) : undefined}
onBlur={o.disabledReason ? () => setReason(null) : undefined}
- className={`inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] ${
+ className={`inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${
active
? "bg-[var(--color-bg-elevated)] font-semibold text-[var(--color-text-primary)]"
: o.disabledReason
diff --git a/packages/ui/src/shared/theme-toggle.tsx b/packages/ui/src/shared/theme-toggle.tsx
index 2f2ebcf75..dcda702de 100644
--- a/packages/ui/src/shared/theme-toggle.tsx
+++ b/packages/ui/src/shared/theme-toggle.tsx
@@ -34,7 +34,7 @@ export interface ThemeToggleProps {
const LABELLED_WIDTH = "min-w-[5rem]";
const BUTTON =
- "inline-flex h-8 w-8 items-center justify-center rounded-md text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "inline-flex h-8 w-8 items-center justify-center rounded-md text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
export function ThemeToggle({
switchToDarkLabel = "Switch to dark theme",
diff --git a/packages/ui/src/shared/view-tabs.tsx b/packages/ui/src/shared/view-tabs.tsx
index 4107d1efa..3b1f05bea 100644
--- a/packages/ui/src/shared/view-tabs.tsx
+++ b/packages/ui/src/shared/view-tabs.tsx
@@ -117,7 +117,7 @@ export function ViewTabs({
tabIndex={active ? 0 : -1}
onClick={() => onValueChange(tab.id)}
className={cn(
- "inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 border-transparent px-1 pb-2 -mb-px text-sm font-medium ring-offset-[var(--color-bg-root)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2",
+ "inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 border-transparent px-1 pb-2 -mb-px text-sm font-medium ring-offset-[var(--color-bg-root)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2",
active
? "border-[var(--color-tab-active)] text-[var(--color-text-primary)]"
: "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",
diff --git a/packages/ui/src/stats/arrivals-timeline.tsx b/packages/ui/src/stats/arrivals-timeline.tsx
index 1537c9583..fbf54b2ef 100644
--- a/packages/ui/src/stats/arrivals-timeline.tsx
+++ b/packages/ui/src/stats/arrivals-timeline.tsx
@@ -67,7 +67,7 @@ export function ArrivalsTimeline({
<button
type="button"
onClick={() => setExpanded(true)}
- className="self-start rounded-md px-1 text-xs font-medium text-[var(--color-accent-primary)] underline-offset-4 hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className="self-start rounded-md px-1 text-xs font-medium text-[var(--color-accent-primary)] underline-offset-4 hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-focus-ring)]"
>
Show {formatNumber(hidden)} more
</button>
diff --git a/packages/ui/src/stats/records-list.tsx b/packages/ui/src/stats/records-list.tsx
index fc6ff0f4a..762129d5a 100644
--- a/packages/ui/src/stats/records-list.tsx
+++ b/packages/ui/src/stats/records-list.tsx
@@ -215,7 +215,7 @@ export function RecordsList({
{row.href ? (
<A
href={row.href}
- className="text-[var(--color-text-primary)] underline decoration-[var(--color-border-default)] underline-offset-4 hover:text-[var(--color-accent-primary)] hover:decoration-current focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-accent-primary)]"
+ className="text-[var(--color-text-primary)] underline decoration-[var(--color-border-default)] underline-offset-4 hover:text-[var(--color-accent-primary)] hover:decoration-current focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-focus-ring)]"
>
{text}
</A>
diff --git a/packages/ui/src/ui/button.tsx b/packages/ui/src/ui/button.tsx
index 50e2e0ffe..309f1cba7 100644
--- a/packages/ui/src/ui/button.tsx
+++ b/packages/ui/src/ui/button.tsx
@@ -6,7 +6,7 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "../lib/cn";
const buttonVariants = cva(
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-root)] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-root)] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
diff --git a/packages/ui/src/ui/dialog.tsx b/packages/ui/src/ui/dialog.tsx
index 83ff4d227..d07195378 100644
--- a/packages/ui/src/ui/dialog.tsx
+++ b/packages/ui/src/ui/dialog.tsx
@@ -44,7 +44,7 @@ const DialogContent = React.forwardRef<
{...props}
>
{children}
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-[var(--color-bg-root)] transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-primary)] focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:text-[var(--color-text-secondary)]">
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-[var(--color-bg-root)] transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:text-[var(--color-text-secondary)]">
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
diff --git a/packages/ui/src/ui/input.tsx b/packages/ui/src/ui/input.tsx
index 477fbb40d..9ad878dbb 100644
--- a/packages/ui/src/ui/input.tsx
+++ b/packages/ui/src/ui/input.tsx
@@ -1,13 +1,22 @@
import * as React from "react";
import { cn } from "../lib/cn";
+/**
+ * The look every form field shares (Input, the Select trigger, comboboxes):
+ * a recessed well that lifts to the surface on focus, with the neutral focus
+ * ring. Disabled dims the text, not the whole box, so the value stays legible.
+ */
+export const FIELD_CLASS =
+ "rounded-md border border-[var(--color-field-border)] bg-[var(--color-field-bg)] text-[var(--color-text-primary)] transition-colors placeholder:text-[var(--color-text-tertiary)] hover:border-[var(--color-field-border-hover)] focus-visible:bg-[var(--color-bg-surface)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-not-allowed disabled:text-[var(--color-text-secondary)] disabled:hover:border-[var(--color-field-border)]";
+
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
- "box-border min-w-0 flex h-9 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-1 text-sm text-[var(--color-text-primary)] transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[var(--color-text-tertiary)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent-primary)] disabled:cursor-not-allowed disabled:opacity-50",
+ FIELD_CLASS,
+ "box-border min-w-0 flex h-9 w-full px-3 py-1 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium",
className,
)}
ref={ref}
diff --git a/packages/ui/src/ui/select.tsx b/packages/ui/src/ui/select.tsx
index f2c2d55a6..f477d5f06 100644
--- a/packages/ui/src/ui/select.tsx
+++ b/packages/ui/src/ui/select.tsx
@@ -4,6 +4,7 @@ import * as React from "react";
import * as SelectPrimitive from "@radix-ui/react-select";
import { Check, ChevronDown, ChevronUp } from "lucide-react";
import { cn } from "../lib/cn";
+import { FIELD_CLASS } from "./input";
const Select = SelectPrimitive.Root;
const SelectGroup = SelectPrimitive.Group;
@@ -16,7 +17,8 @@ const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger
ref={ref}
className={cn(
- "box-border min-w-0 flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-sm text-[var(--color-text-primary)] ring-offset-[var(--color-bg-root)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-primary)] disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
+ FIELD_CLASS,
+ "box-border min-w-0 flex h-9 w-full items-center justify-between whitespace-nowrap px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-[var(--color-focus-ring)] data-[state=open]:bg-[var(--color-bg-surface)] [&>span]:line-clamp-1",
className,
)}
{...props}
diff --git a/packages/ui/src/ui/sheet.tsx b/packages/ui/src/ui/sheet.tsx
index f7ff782c2..e947fc28e 100644
--- a/packages/ui/src/ui/sheet.tsx
+++ b/packages/ui/src/ui/sheet.tsx
@@ -66,7 +66,7 @@ const SheetContent = React.forwardRef<
<DialogPrimitive.Close
className={cn(
"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity",
- "hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-primary)]",
+ "hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
"disabled:pointer-events-none",
)}
aria-label={closeLabel}
diff --git a/packages/ui/src/ui/slider.tsx b/packages/ui/src/ui/slider.tsx
index 97f7f07ec..221a68adc 100644
--- a/packages/ui/src/ui/slider.tsx
+++ b/packages/ui/src/ui/slider.tsx
@@ -31,7 +31,7 @@ export function Slider({
aria-labelledby={ariaLabelledBy}
className={cn(
"block h-4 w-4 rounded-full border border-[var(--color-accent-primary)] bg-[var(--color-bg-surface)] shadow",
- "transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
"disabled:pointer-events-none disabled:opacity-50",
)}
/>
diff --git a/packages/ui/src/ui/switch.tsx b/packages/ui/src/ui/switch.tsx
index 62ef0d3ae..292170c28 100644
--- a/packages/ui/src/ui/switch.tsx
+++ b/packages/ui/src/ui/switch.tsx
@@ -11,7 +11,7 @@ export function Switch({
<SwitchPrimitive.Root
className={cn(
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2",
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-root)]",
"disabled:cursor-not-allowed disabled:opacity-50",
"data-[state=checked]:bg-[var(--color-control-selected)] data-[state=unchecked]:bg-[var(--color-bg-elevated)]",
className,
diff --git a/packages/ui/src/ui/tabs.tsx b/packages/ui/src/ui/tabs.tsx
index 4f5cd7306..0dd617744 100644
--- a/packages/ui/src/ui/tabs.tsx
+++ b/packages/ui/src/ui/tabs.tsx
@@ -28,7 +28,7 @@ const TabsTrigger = React.forwardRef<
<TabsPrimitive.Trigger
ref={ref}
className={cn(
- "inline-flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-1 pb-2 -mb-px text-sm font-medium text-[var(--color-text-secondary)] ring-offset-[var(--color-bg-root)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:border-b-2 data-[state=active]:border-[var(--color-tab-active)]",
+ "inline-flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-1 pb-2 -mb-px text-sm font-medium text-[var(--color-text-secondary)] ring-offset-[var(--color-bg-root)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:border-b-2 data-[state=active]:border-[var(--color-tab-active)]",
className,
)}
{...props}
@@ -62,7 +62,7 @@ const TabsContent = React.forwardRef<
<TabsPrimitive.Content
ref={ref}
className={cn(
- "mt-2 ring-offset-[var(--color-bg-root)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2",
+ "mt-2 ring-offset-[var(--color-bg-root)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2",
className,
)}
{...props}
diff --git a/packages/ui/src/wiki/human-notes.tsx b/packages/ui/src/wiki/human-notes.tsx
index 450a42835..8a8ee13bf 100644
--- a/packages/ui/src/wiki/human-notes.tsx
+++ b/packages/ui/src/wiki/human-notes.tsx
@@ -3,6 +3,8 @@
import { useState } from "react";
import { Pencil, StickyNote, X } from "lucide-react";
import { Button } from "../ui/button";
+import { FIELD_CLASS } from "../ui/input";
+import { cn } from "../lib/cn";
/**
* Human-curated note pinned above a page's generated content, editable in
@@ -84,7 +86,7 @@ export function HumanNotes({
autoFocus
aria-label="Human note"
placeholder="Context the generated docs can't know — gotchas, history, plans…"
- className="w-full resize-y rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-sm text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)]"
+ className={cn(FIELD_CLASS, "w-full resize-y px-3 py-2 text-sm")}
/>
<div className="flex items-center gap-2">
<Button size="sm" onClick={() => void save()} disabled={saving}>
diff --git a/packages/ui/src/workspace/contract-attention.tsx b/packages/ui/src/workspace/contract-attention.tsx
index 448c8f8c9..9ce69d308 100644
--- a/packages/ui/src/workspace/contract-attention.tsx
+++ b/packages/ui/src/workspace/contract-attention.tsx
@@ -17,6 +17,7 @@ import { memo, useMemo, useState, type ElementType } from "react";
import type { OrphanProvider, UnmatchedConsumer } from "@repowise-dev/types/workspace";
import { AiPromptButton } from "../health/ai-prompt-button";
+import { RowPromptAction } from "../health/row-prompt-action";
import { AiPromptModal } from "../health/ai-prompt-modal";
import type { AiPromptFlavor } from "../health/ai-prompt-builder";
import { formatNumber } from "../lib/format";
@@ -195,7 +196,7 @@ function UnmatchedGroup({
{copy.meaning}
</p>
</div>
- <AiPromptButton onClick={onPrompt} label="AI prompt" />
+ <AiPromptButton onClick={onPrompt} />
</div>
{shown > 0 ? (
@@ -207,7 +208,7 @@ function UnmatchedGroup({
onClick={() =>
onSelect({ repo: u.repo, file_path: u.file_path, contract_id: u.contract_id })
}
- className="grid w-full grid-cols-1 gap-x-4 gap-y-0.5 rounded-md px-2 py-1.5 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-accent-primary)] md:grid-cols-[minmax(0,5fr)_minmax(0,1fr)_minmax(0,5fr)]"
+ className="grid w-full grid-cols-1 gap-x-4 gap-y-0.5 rounded-md px-2 py-1.5 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-focus-ring)] md:grid-cols-[minmax(0,5fr)_minmax(0,1fr)_minmax(0,5fr)]"
>
<ContractIdentity contractId={u.contract_id} />
<span className="text-xs text-[var(--color-text-secondary)]">{u.repo}</span>
@@ -277,7 +278,7 @@ function OrphanTable({
</thead>
<tbody>
{shown.map((g) => (
- <tr key={`${g.repo}|${g.contractType}`} className="border-t border-[var(--color-border-default)]">
+ <tr key={`${g.repo}|${g.contractType}`} className="group/row border-t border-[var(--color-border-default)]">
<td className="py-2 pr-3 text-xs font-medium text-[var(--color-text-primary)]">
{g.repo}
</td>
@@ -295,10 +296,10 @@ function OrphanTable({
>
Browse
</A>
- <AiPromptButton
+ <RowPromptAction
variant="icon"
onClick={() => onPrompt(g)}
- label={`AI prompt for ${g.repo} ${providerNoun(g.contractType, 2)} with no caller`}
+ label={`Copy prompt for ${g.repo} ${providerNoun(g.contractType, 2)} with no caller`}
/>
</div>
</td>
diff --git a/packages/ui/src/workspace/contract-drawer.tsx b/packages/ui/src/workspace/contract-drawer.tsx
index 4318477e7..441999702 100644
--- a/packages/ui/src/workspace/contract-drawer.tsx
+++ b/packages/ui/src/workspace/contract-drawer.tsx
@@ -219,7 +219,7 @@ function Body({
{fileHref ? (
<a
href={fileHref}
- className="rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<FilePath path={contract.file_path} line={contract.line} mode="full" accent />
</a>
@@ -473,7 +473,7 @@ function CounterpartRow({
<button
type="button"
onClick={() => onSelectContract({ repo, file_path: file, contract_id: id })}
- className="-mx-1 min-w-0 flex-1 rounded-md px-1 py-0.5 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="-mx-1 min-w-0 flex-1 rounded-md px-1 py-0.5 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
aria-label={`Open the ${side} in ${repo}, ${file}`}
>
{content}
diff --git a/packages/ui/src/workspace/contract-prompt-button.tsx b/packages/ui/src/workspace/contract-prompt-button.tsx
index 023fa4450..dd0da38f7 100644
--- a/packages/ui/src/workspace/contract-prompt-button.tsx
+++ b/packages/ui/src/workspace/contract-prompt-button.tsx
@@ -19,7 +19,7 @@ export function ContractPromptButton({
const [open, setOpen] = useState(false);
return (
<>
- <AiPromptButton onClick={() => setOpen(true)} label="AI prompt" />
+ <AiPromptButton onClick={() => setOpen(true)} />
<AiPromptModal
open={open}
onOpenChange={setOpen}
diff --git a/packages/ui/src/workspace/repo-pair-table.tsx b/packages/ui/src/workspace/repo-pair-table.tsx
index d46b3b171..796179c28 100644
--- a/packages/ui/src/workspace/repo-pair-table.tsx
+++ b/packages/ui/src/workspace/repo-pair-table.tsx
@@ -2,7 +2,7 @@
import { EmptyState } from "../shared/empty-state";
import { clickableRowProps, CLICKABLE_ROW_CLS } from "../shared/responsive-table";
-import { AiPromptButton } from "../health/ai-prompt-button";
+import { RowPromptAction } from "../health/row-prompt-action";
import { PAIR_MICRO as MICRO } from "../coupling/pair-drawer-parts";
import { cn } from "../lib/cn";
import { formatDate, formatDateTime } from "../lib/format";
@@ -69,7 +69,7 @@ export function RepoPairTable({ repoPairs, onSelectPair, selectedPairId, onPromp
<tr
key={p.id}
className={cn(
- "border-t border-[var(--color-border-default)] first:border-t-0",
+ "group/row border-t border-[var(--color-border-default)] first:border-t-0",
onClick && "hover:bg-[var(--color-bg-elevated)]",
isSelected && "bg-[var(--color-selection-wash)]",
onClick && CLICKABLE_ROW_CLS,
@@ -116,9 +116,9 @@ export function RepoPairTable({ repoPairs, onSelectPair, selectedPairId, onPromp
</span>
)}
{onPrompt && (
- <AiPromptButton
+ <RowPromptAction
variant="icon"
- label={`AI prompt for ${p.repo1} and ${p.repo2}`}
+ label={`Copy prompt for ${p.repo1} and ${p.repo2}`}
onClick={() => onPrompt(p)}
/>
)}
diff --git a/packages/ui/src/workspace/system-map/system-map-aggregate-panel.tsx b/packages/ui/src/workspace/system-map/system-map-aggregate-panel.tsx
index 69e974bfc..164a3baf9 100644
--- a/packages/ui/src/workspace/system-map/system-map-aggregate-panel.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-aggregate-panel.tsx
@@ -18,7 +18,7 @@ import { SystemMapHealthMark } from "./system-map-health-mark";
import type { RepoHealth, SystemMapSelection } from "./types";
const ROW =
- "flex w-full min-w-0 items-baseline justify-between gap-3 rounded px-2 py-1.5 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "flex w-full min-w-0 items-baseline justify-between gap-3 rounded px-2 py-1.5 text-left hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
interface Lookups {
nodesById: ReadonlyMap<string, SystemNode>;
@@ -56,7 +56,7 @@ export function GroupPanel({
<button
type="button"
onClick={onOpen}
- className="self-start text-xs font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="self-start text-xs font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
Open this group on the map
</button>
diff --git a/packages/ui/src/workspace/system-map/system-map-between-control.tsx b/packages/ui/src/workspace/system-map/system-map-between-control.tsx
index 80d05420b..f8d745521 100644
--- a/packages/ui/src/workspace/system-map/system-map-between-control.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-between-control.tsx
@@ -60,7 +60,7 @@ export function SystemMapBetweenControl({ graph, families, open, onOpenChange, f
<button
type="button"
aria-expanded={open}
- className="inline-flex h-8 items-center gap-1.5 rounded-md border border-[var(--color-border-hover)] px-2.5 text-xs font-medium text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-8 items-center gap-1.5 rounded-md border border-[var(--color-border-hover)] px-2.5 text-xs font-medium text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Route size={14} aria-hidden />
Between
diff --git a/packages/ui/src/workspace/system-map/system-map-drawer.tsx b/packages/ui/src/workspace/system-map/system-map-drawer.tsx
index db935d13f..91b9bbcda 100644
--- a/packages/ui/src/workspace/system-map/system-map-drawer.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-drawer.tsx
@@ -156,7 +156,7 @@ export function SystemMapRailFrame({
type="button"
onClick={onClose}
aria-label="Close details"
- className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X size={14} aria-hidden />
</button>
@@ -262,7 +262,7 @@ function SelectButton({ onClick, children, title }: { onClick: () => void; child
type="button"
onClick={onClick}
title={title}
- className="cursor-pointer text-left font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="cursor-pointer text-left font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{children}
</button>
@@ -276,7 +276,7 @@ function VerbButton({ onClick, children, title }: { onClick: () => void; childre
type="button"
onClick={onClick}
title={title}
- className="rounded-md border border-[var(--color-border-hover)] px-2.5 py-1 text-xs font-medium text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-md border border-[var(--color-border-hover)] px-2.5 py-1 text-xs font-medium text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{children}
</button>
@@ -601,7 +601,7 @@ function NeighbourList({
<button
type="button"
onClick={() => onSelect({ type: "node", id: pick(e) })}
- className="flex w-full cursor-pointer items-baseline justify-between gap-3 rounded px-1.5 py-1 text-left text-[15px] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex w-full cursor-pointer items-baseline justify-between gap-3 rounded px-1.5 py-1 text-left text-[15px] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<span className="min-w-0 [overflow-wrap:anywhere]">{name(pick(e))}</span>
<span className="shrink-0 font-mono text-[10px] tabular-nums text-[var(--color-text-tertiary)]">
diff --git a/packages/ui/src/workspace/system-map/system-map-filters.tsx b/packages/ui/src/workspace/system-map/system-map-filters.tsx
index 89dae1fbd..19ae70096 100644
--- a/packages/ui/src/workspace/system-map/system-map-filters.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-filters.tsx
@@ -55,7 +55,7 @@ export function SystemMapFilters({ familyCounts, kindCounts, families, onToggleF
onClick={() => onToggleFamily(family)}
aria-pressed={active}
title={`${copy.label}: ${copy.meaning}${mix ? ` (${mix})` : ""}. ${active ? "Click to hide." : "Click to show."}`}
- className={`inline-flex min-h-[28px] items-center gap-1.5 rounded-md border px-2 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] ${
+ className={`inline-flex min-h-[28px] items-center gap-1.5 rounded-md border px-2 py-1 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${
active
? "border-[var(--color-border-hover)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)]"
: "border-dashed border-[var(--color-border-default)] text-[var(--color-text-secondary)]"
diff --git a/packages/ui/src/workspace/system-map/system-map-lens-results.tsx b/packages/ui/src/workspace/system-map/system-map-lens-results.tsx
index 494dfed60..75c3349c3 100644
--- a/packages/ui/src/workspace/system-map/system-map-lens-results.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-lens-results.tsx
@@ -317,7 +317,7 @@ export function NodeLink({
<button
type="button"
onClick={() => onSelect({ type: "node", id })}
- className="cursor-pointer font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="cursor-pointer font-medium text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{label}
</button>
@@ -361,7 +361,7 @@ export function CycleRow({
key={eid}
type="button"
onClick={() => onSelect({ type: "edge", id: eid })}
- className="cursor-pointer font-mono text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="cursor-pointer font-mono text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{e ? `${name(e.source)} → ${name(e.target)} ${edgeKindStyle(e.kind).label}` : eid}
</button>
diff --git a/packages/ui/src/workspace/system-map/system-map-lens.tsx b/packages/ui/src/workspace/system-map/system-map-lens.tsx
index 80d07a63a..d55f5ceae 100644
--- a/packages/ui/src/workspace/system-map/system-map-lens.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-lens.tsx
@@ -49,7 +49,7 @@ export function SystemMapLensControl({
<select
value={blastTarget ?? ""}
onChange={(e) => onBlastTargetChange(e.target.value || null)}
- className="min-w-0 max-w-[16rem] rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="min-w-0 max-w-[16rem] rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<option value="">choose a service</option>
{sorted.map((n) => (
diff --git a/packages/ui/src/workspace/system-map/system-map-nav-actions.tsx b/packages/ui/src/workspace/system-map/system-map-nav-actions.tsx
index ebfe51350..a93e373a5 100644
--- a/packages/ui/src/workspace/system-map/system-map-nav-actions.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-nav-actions.tsx
@@ -37,7 +37,7 @@ export function SystemMapNavActions({ nav, search, copy, name }: SystemMapNavAct
onClick={() => nav.setHelp((open) => !open)}
aria-label={copy.helpOpen}
title={copy.helpOpen}
- className="inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--color-border-default)] text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--color-border-default)] text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<Keyboard aria-hidden className="h-4 w-4" />
</button>
diff --git a/packages/ui/src/workspace/system-map/system-map-routes-panel.tsx b/packages/ui/src/workspace/system-map/system-map-routes-panel.tsx
index 9bb7c0229..fabfbf162 100644
--- a/packages/ui/src/workspace/system-map/system-map-routes-panel.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-routes-panel.tsx
@@ -53,7 +53,7 @@ export interface SystemMapRoutesPanelProps {
const QUIET = "text-xs text-[var(--color-text-secondary)]";
const BUTTON =
- "rounded-md border border-[var(--color-border-hover)] px-2.5 py-1 text-xs font-medium text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "rounded-md border border-[var(--color-border-hover)] px-2.5 py-1 text-xs font-medium text-[var(--color-text-primary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
export function SystemMapRoutesPanel(props: SystemMapRoutesPanelProps) {
const { graph, between, families } = props;
@@ -94,7 +94,7 @@ export function SystemMapRoutesPanel(props: SystemMapRoutesPanelProps) {
</p>
)}
<div className="flex flex-wrap items-center gap-x-4 gap-y-2">
- <AiPromptButton label="Copy prompt for an agent" onClick={() => setPrompting(true)} />
+ <AiPromptButton onClick={() => setPrompting(true)} />
{props.contractsHref &&
repos.map((repo) => {
const A = props.LinkComponent ?? "a";
@@ -111,7 +111,7 @@ export function SystemMapRoutesPanel(props: SystemMapRoutesPanelProps) {
onChange={(e) => setFilter(e.target.value)}
placeholder="Filter routes, files or packages"
aria-label="Filter routes"
- className="h-8 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] px-2.5 text-xs text-[var(--color-text-primary)] placeholder:text-[var(--color-text-secondary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-primary)]"
+ className="h-8 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] px-2.5 text-xs text-[var(--color-text-primary)] placeholder:text-[var(--color-text-secondary)] focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
/>
<RoutesBody state={state} q={q} a={a.name} b={b.name} {...props} />
</SystemMapRailFrame>
diff --git a/packages/ui/src/workspace/system-map/system-map-search.tsx b/packages/ui/src/workspace/system-map/system-map-search.tsx
index 7d39ec8a7..65d984180 100644
--- a/packages/ui/src/workspace/system-map/system-map-search.tsx
+++ b/packages/ui/src/workspace/system-map/system-map-search.tsx
@@ -12,6 +12,8 @@ import { Search } from "lucide-react";
import type { SystemMapNavCopy } from "./nav-copy";
import { SEARCH_MIN_CHARS, type SearchHit } from "./search-index";
import type { MapSearch } from "./use-system-map-search";
+import { FIELD_CLASS } from "../../ui/input";
+import { cn } from "../../lib/cn";
export interface SystemMapSearchProps {
search: MapSearch;
@@ -59,7 +61,7 @@ export function SystemMapSearch({ search, inputRef, copy, name }: SystemMapSearc
}}
onFocus={() => setOpen(true)}
onKeyDown={search.onKeyDown}
- className="h-8 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] pl-7 pr-2 text-xs text-[var(--color-text-primary)] placeholder:text-[var(--color-text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "h-8 w-full pl-7 pr-2 text-xs")}
/>
{shown && <SearchResults id={listId} optionId={optionId} search={search} copy={copy} name={name} />}
</div>
diff --git a/packages/ui/src/workspace/workspace-next-actions.tsx b/packages/ui/src/workspace/workspace-next-actions.tsx
index c8e741d24..59c29de1b 100644
--- a/packages/ui/src/workspace/workspace-next-actions.tsx
+++ b/packages/ui/src/workspace/workspace-next-actions.tsx
@@ -118,7 +118,7 @@ export function WorkspaceNextActions({
<p className="text-[15px] font-semibold leading-snug text-[var(--color-text-primary)]">
<Link
href={contractsHref}
- className="rounded hover:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded hover:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{renderActionTitle(c.title)}
</Link>
@@ -143,7 +143,7 @@ export function WorkspaceNextActions({
</h3>
<Link
href={repoHref(repoId)}
- className="rounded text-xs text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded text-xs text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{`All ${work(repo, horizon).toLocaleString()} in ${repo.alias}`}
</Link>
diff --git a/packages/ui/src/zoom/ZoomCanvas.tsx b/packages/ui/src/zoom/ZoomCanvas.tsx
index 70881acce..66ace2862 100644
--- a/packages/ui/src/zoom/ZoomCanvas.tsx
+++ b/packages/ui/src/zoom/ZoomCanvas.tsx
@@ -343,7 +343,7 @@ export const ZoomCanvas = forwardRef<ZoomCanvasHandle, ZoomCanvasProps>(function
tabIndex={0}
role="application"
aria-label="Zoomable system map. Drag to pan, scroll to zoom, double-click a card to dive into it, arrow keys to pan, plus and minus to zoom, Enter to open the centre node."
- className="h-full w-full touch-none outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="h-full w-full touch-none outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
style={{ cursor: "grab" }}
/>
{hover && (
diff --git a/packages/ui/styles/globals.css b/packages/ui/styles/globals.css
index c1c08724e..eb8648b4f 100644
--- a/packages/ui/styles/globals.css
+++ b/packages/ui/styles/globals.css
@@ -119,12 +119,27 @@
--color-model-hover: var(--color-plum-600);
--color-model-muted: color-mix(in srgb, var(--color-accent-secondary) 14%, transparent);
- /* Primary action: a solid ink button. Orange stays for links, focus,
+ /* Primary action: a solid ink button. Orange stays for links,
selection, indexing, "New" marks and the brand. Ground and text alias the
ink pair so they flip with the theme; hover steps toward the page. */
--color-action-primary: var(--color-text-primary);
--color-action-primary-hover: #3b2f45;
--color-text-on-action: var(--color-text-inverse);
+ /* Soft ink: a tonal fill for a frequent secondary action (copy prompt)
+ that should read as clickable without competing with the ink button. */
+ --color-action-soft: rgba(36, 27, 44, 0.06);
+ --color-action-soft-hover: rgba(36, 27, 44, 0.11);
+
+ /* Keyboard focus ring: neutral ink, so focus never reads as an alert or
+ a brand mark. Aliases text-secondary, which clears 3:1 against every
+ ground in both themes (contrast-check.py), so it needs no dark override. */
+ --color-focus-ring: var(--color-text-secondary);
+
+ /* Form fields: a recessed well a notch below the card, so a value reads
+ as something you can edit. On focus the well lifts to the surface. */
+ --color-field-bg: #f5f1ed;
+ --color-field-border: rgba(88, 67, 108, 0.16);
+ --color-field-border-hover: rgba(88, 67, 108, 0.28);
/* Neutral roles for state that used to be painted orange. Named by job so a
palette change is one edit here. Each aliases a themed token, so none
@@ -531,6 +546,12 @@
and need no override; see the light block for the family. */
--color-model-hover: var(--color-plum-200);
--color-action-primary-hover: #d6d6d9;
+ --color-action-soft: rgba(255, 255, 255, 0.08);
+ --color-action-soft-hover: rgba(255, 255, 255, 0.12);
+ /* Form fields: a notch below the card, see the light block. */
+ --color-field-bg: #101012;
+ --color-field-border: rgba(255, 255, 255, 0.10);
+ --color-field-border-hover: rgba(255, 255, 255, 0.18);
/* Series, the tail and heat steps — see the light block. */
--color-series-1: #f59520;
@@ -768,7 +789,7 @@ body {
/* -------------------------------------------------------------------- */
:focus-visible {
- outline: 2px solid var(--color-accent-fill);
+ outline: 2px solid var(--color-focus-ring);
outline-offset: 2px;
}
diff --git a/packages/web/messages/en.json b/packages/web/messages/en.json
index 392671fdc..c3427043a 100644
--- a/packages/web/messages/en.json
+++ b/packages/web/messages/en.json
@@ -481,7 +481,7 @@
"gotWorse": "Got worse",
"gotWorseDescription": "Findings this change introduced or made more severe, worst first.",
"gotWorseShown": "Showing the {shown} most severe of {total}.",
- "promptAction": "Copy prompt for your agent",
+ "promptAction": "Copy prompt",
"promptTitle": "Prompt for this change",
"promptDescription": "Hands your agent what this change made worse, with files and lines, or what its checklist flagged when nothing got worse.",
"checksPassed": "{count, plural, one {# check passed} other {# checks passed}}",
@@ -679,7 +679,7 @@
"openInOffboarding": "Open in off-boarding",
"matrixLoadFailed": "The per-file author shares could not be loaded. Check that the API is reachable and try again.",
"ui": {
- "agentPrompt": "Copy prompt for your agent",
+ "agentPrompt": "Copy prompt",
"promptForGroup": "{count, plural, one {Copy prompt for this one} other {Copy prompt for these #}}",
"repositoryRoot": "(repository root)",
"hotspot": "Hotspot",
@@ -992,7 +992,7 @@
"tests": {
"title": "Tests",
"description": "Which code your tests reach: measured from a coverage report when one is ingested, inferred from the dependency graph otherwise.",
- "promptAction": "Copy prompt for your agent",
+ "promptAction": "Copy prompt",
"cleanTitle": "No untested hotspots across {files} measured files",
"cleanBody": "Every file that changes often or that much of the code depends on has tests watching it.",
"batchPromptAction": "Copy prompt for these {count}",
@@ -1474,8 +1474,7 @@
"connect": "Connect",
"connecting": "Connecting",
"connectFailed": "Couldn't connect {name}",
- "copyPrompt": "Copy setup prompt",
- "promptCopied": "Setup prompt copied",
+ "copyPrompt": "Copy prompt",
"prompt": "Connect repowise to {name} for this repo. Run `{command}` in the repo root, then restart {name} so it loads the repowise tools. Run `repowise doctor` to check the connection.",
"askLabel": "Ask it something",
"askRisk": "Which files are riskiest to change, and why?",
@@ -1483,6 +1482,7 @@
"askStart": "Where should I start reading this repo?",
"copy": "Copy",
"copied": "Copied",
+ "copyFailed": "Couldn't copy",
"copyQuestion": "Copy: {question}"
},
"yours": {
@@ -1554,7 +1554,7 @@
"fixPromptLabel": "Copy prompt to fix what this commit made worse",
"fixPromptTitle": "Fix what this commit made worse",
"fixPromptDescription": "A ready-to-paste prompt that has your AI agent fix the findings this commit introduced or made more severe, at their files and lines, without undoing the commit.",
- "reviewPromptLabel": "Copy review prompt for your agent",
+ "reviewPromptLabel": "Copy review prompt",
"reviewPromptTitle": "AI commit review",
"reviewPromptDescription": "A ready-to-paste prompt that has your AI agent review this commit's change-risk, flag what to scrutinize, and suggest reviewers.",
"openFile": "Open file"
@@ -1578,7 +1578,7 @@
"lastTogether": "last {date}",
"unexplained": "{count, plural, one {# file pair} other {# file pairs}} with no direct import ({pct}%)",
"allExplained": "All explained",
- "promptLabel": "Copy prompt for your agent",
+ "promptLabel": "Copy prompt",
"bulkPromptLabel": "Copy prompt for these {count, number}",
"promptTitle": "Decouple prompt",
"promptDescription": "A ready-to-paste prompt asking your agent to find why these areas change together with no dependency between them, and to decouple what is accidental.",
@@ -1742,7 +1742,7 @@
"promptDescription": "A ready-to-paste prompt that walks your AI agent through confirming and remediating this security finding.",
"rescan": "Re-scan",
"rescanning": "Re-scanning…",
- "promptAction": "Copy prompt for your agent",
+ "promptAction": "Copy prompt",
"deadCodeClean": {
"title": "No dead code found",
"titleScoped": "No dead code across {files} files",
@@ -2344,12 +2344,14 @@
"essentials": "Essentials",
"optional": "Optional",
"tour": "Take the tour",
- "copyPrompt": "Copy prompt for your agent",
+ "copyPrompt": "Copy prompt",
"promptDescription": "Hand this to your coding agent. It names the command and how to check the result.",
- "promptPreview": "Prompt preview",
- "copied": "copied",
+ "copied": "Copied",
+ "copyFailed": "Couldn't copy",
"showFiles": "Show files",
"hideFiles": "Hide files",
+ "showDetails": "Show details",
+ "hideDetails": "Hide details",
"connect": "Connect {agent}",
"disconnect": "Disconnect",
"disconnectAgent": "Disconnect {agent}",
diff --git a/packages/web/messages/zh-CN.json b/packages/web/messages/zh-CN.json
index c787f77d6..cb8bda6d1 100644
--- a/packages/web/messages/zh-CN.json
+++ b/packages/web/messages/zh-CN.json
@@ -481,7 +481,7 @@
"gotWorse": "变差的部分",
"gotWorseDescription": "该变更新增或加重的问题,按严重程度从高到低排列。",
"gotWorseShown": "显示 {total} 个中最严重的 {shown} 个。",
- "promptAction": "复制给你的智能体的提示词",
+ "promptAction": "复制提示词",
"promptTitle": "该变更的提示词",
"promptDescription": "把该变更让代码变差的地方(含文件和行号)交给你的智能体;若没有变差,则交给它清单标记的项目。",
"checksPassed": "{count, plural, other {# 项检查通过}}",
@@ -679,7 +679,7 @@
"openInOffboarding": "在离职模拟中打开",
"matrixLoadFailed": "无法加载每个文件的作者占比。请确认 API 可以访问,然后重试。",
"ui": {
- "agentPrompt": "复制给智能体的提示词",
+ "agentPrompt": "复制提示词",
"promptForGroup": "{count, plural, one {为这一项复制提示词} other {为这 # 项复制提示词}}",
"repositoryRoot": "(仓库根目录)",
"hotspot": "热点",
@@ -992,7 +992,7 @@
"tests": {
"title": "测试",
"description": "你的测试覆盖了哪些代码:已导入覆盖率报告时为实测结果,否则根据依赖图推断。",
- "promptAction": "为你的智能体复制提示词",
+ "promptAction": "复制提示词",
"cleanTitle": "{files} 个已测量文件中没有未测试的热点",
"cleanBody": "所有频繁变更或被大量代码依赖的文件都有测试覆盖。",
"batchPromptAction": "为这 {count} 项复制提示词",
@@ -1474,8 +1474,7 @@
"connect": "连接",
"connecting": "正在连接",
"connectFailed": "无法连接 {name}",
- "copyPrompt": "复制设置提示词",
- "promptCopied": "已复制设置提示词",
+ "copyPrompt": "复制提示词",
"prompt": "为此仓库将 repowise 连接到 {name}。在仓库根目录运行 `{command}`,然后重启 {name},让它加载 repowise 工具。运行 `repowise doctor` 检查连接。",
"askLabel": "问它一个问题",
"askRisk": "哪些文件改动风险最高?为什么?",
@@ -1483,6 +1482,7 @@
"askStart": "我应该从哪里开始阅读这个仓库?",
"copy": "复制",
"copied": "已复制",
+ "copyFailed": "无法复制",
"copyQuestion": "复制:{question}"
},
"yours": {
@@ -1554,7 +1554,7 @@
"fixPromptLabel": "复制提示词,修复此提交带来的问题",
"fixPromptTitle": "修复此提交带来的问题",
"fixPromptDescription": "一段可直接粘贴的提示词,让你的 AI 智能体在对应的文件和行修复此提交引入或加重的问题,而不撤销该提交。",
- "reviewPromptLabel": "复制审查提示词给你的智能体",
+ "reviewPromptLabel": "复制审查提示词",
"reviewPromptTitle": "AI 提交审查",
"reviewPromptDescription": "一段可直接粘贴的提示词,让你的 AI 智能体审查此提交的变更风险,指出需要仔细检查的地方,并推荐审查者。",
"openFile": "打开文件"
@@ -1578,7 +1578,7 @@
"lastTogether": "最近一次 {date}",
"unexplained": "{count, number} 个文件对没有直接导入({pct}%)",
"allExplained": "全部可解释",
- "promptLabel": "为你的智能体复制提示词",
+ "promptLabel": "复制提示词",
"bulkPromptLabel": "为这 {count, number} 组复制提示词",
"promptTitle": "解耦提示词",
"promptDescription": "一段可直接粘贴的提示词,让你的智能体找出这些区域在彼此没有依赖的情况下为何一起变更,并对偶然产生的耦合进行解耦。",
@@ -1742,7 +1742,7 @@
"promptDescription": "一段可直接粘贴的提示词,引导 AI 智能体确认并修复这条安全发现项。",
"rescan": "重新扫描",
"rescanning": "正在重新扫描…",
- "promptAction": "为你的智能体复制提示词",
+ "promptAction": "复制提示词",
"deadCodeClean": {
"title": "未发现死代码",
"titleScoped": "{files} 个文件中没有死代码",
@@ -2344,12 +2344,14 @@
"essentials": "必备",
"optional": "可选",
"tour": "查看导览",
- "copyPrompt": "复制给智能体的提示词",
+ "copyPrompt": "复制提示词",
"promptDescription": "把它交给你的编程智能体。其中写明了要运行的命令以及如何检查结果。",
- "promptPreview": "提示词预览",
"copied": "已复制",
+ "copyFailed": "无法复制",
"showFiles": "显示文件",
"hideFiles": "隐藏文件",
+ "showDetails": "显示详情",
+ "hideDetails": "收起详情",
"connect": "连接 {agent}",
"disconnect": "断开连接",
"disconnectAgent": "断开 {agent}",
diff --git a/packages/web/src/app/layout.tsx b/packages/web/src/app/layout.tsx
index d63e94f42..ba4b7e3a9 100644
--- a/packages/web/src/app/layout.tsx
+++ b/packages/web/src/app/layout.tsx
@@ -89,7 +89,7 @@ export default async function RootLayout({
<ThemeProvider>
<a
href="#main-content"
- className="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[100] focus:rounded-md focus:bg-[var(--color-bg-elevated)] focus:px-3 focus:py-2 focus:text-sm focus:text-[var(--color-text-primary)] focus:outline focus:outline-2 focus:outline-[var(--color-accent-primary)]"
+ className="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[100] focus:rounded-md focus:bg-[var(--color-bg-elevated)] focus:px-3 focus:py-2 focus:text-sm focus:text-[var(--color-text-primary)] focus:outline focus:outline-2 focus:outline-[var(--color-focus-ring)]"
>
{t("skipToContent")}
</a>
diff --git a/packages/web/src/app/repos/[id]/changes/[changeId]/page.tsx b/packages/web/src/app/repos/[id]/changes/[changeId]/page.tsx
index a713bf2ac..3e82c9574 100644
--- a/packages/web/src/app/repos/[id]/changes/[changeId]/page.tsx
+++ b/packages/web/src/app/repos/[id]/changes/[changeId]/page.tsx
@@ -160,7 +160,7 @@ export default async function ChangeDetailPage({ params }: Props) {
<li key={sha}>
<Link
href={`/repos/${id}/commits?commit=${sha}`}
- className="rounded-sm text-[var(--color-text-secondary)] hover:text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-sm text-[var(--color-text-secondary)] hover:text-[var(--color-accent-primary)] hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{sha}
</Link>
diff --git a/packages/web/src/app/workspace/co-changes/co-changes-explorer.tsx b/packages/web/src/app/workspace/co-changes/co-changes-explorer.tsx
index fb888711d..4c029d01d 100644
--- a/packages/web/src/app/workspace/co-changes/co-changes-explorer.tsx
+++ b/packages/web/src/app/workspace/co-changes/co-changes-explorer.tsx
@@ -30,6 +30,8 @@ import {
import { formatNumber } from "@repowise-dev/ui/lib/format";
import { getWorkspaceCoChangeStructure } from "@/lib/api/workspace";
import { getGitMetadata } from "@/lib/api/git";
+import { FIELD_CLASS } from "@repowise-dev/ui/ui/input";
+import { cn } from "@/lib/utils/cn";
interface Props {
coChanges: WorkspaceCoChangeEntry[];
@@ -363,14 +365,14 @@ export function CoChangesExplorer({
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder={t("files.searchPlaceholder")}
- className="h-8 w-full rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] pl-8 pr-3 font-mono text-xs text-[var(--color-text-primary)] placeholder:font-sans placeholder:text-[var(--color-text-tertiary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "h-8 w-full pl-8 pr-3 font-mono text-xs placeholder:font-sans")}
/>
</label>
{selected && (
<button
type="button"
onClick={() => setSelectedPair(null)}
- className="inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-3 w-3" aria-hidden />
{t("files.clearPair")}
diff --git a/packages/web/src/app/workspace/contracts/contract-filters.tsx b/packages/web/src/app/workspace/contracts/contract-filters.tsx
index 9c693022f..1913516c1 100644
--- a/packages/web/src/app/workspace/contracts/contract-filters.tsx
+++ b/packages/web/src/app/workspace/contracts/contract-filters.tsx
@@ -49,7 +49,7 @@ function typeTabs(
}
const SELECT_CLASS =
- "rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 py-1.5 text-xs text-[var(--color-text-primary)] outline-none focus-visible:border-[var(--color-border-active)] focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] disabled:opacity-60";
+ "rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2.5 py-1.5 text-xs text-[var(--color-text-primary)] outline-none focus-visible:border-[var(--color-border-active)] focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-60";
/**
* The list's controls. State lives in the URL, so a filtered view is linkable
diff --git a/packages/web/src/app/workspace/contracts/contracts-table.tsx b/packages/web/src/app/workspace/contracts/contracts-table.tsx
index afb356ca1..e41fdf938 100644
--- a/packages/web/src/app/workspace/contracts/contracts-table.tsx
+++ b/packages/web/src/app/workspace/contracts/contracts-table.tsx
@@ -42,7 +42,7 @@ const COLUMNS: ResponsiveColumn<ContractRow>[] = [
}
e.preventDefault();
}}
- className="rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<ContractIdentity contractId={c.contract_id} />
</a>
diff --git a/packages/web/src/components/changes/change-prompt-action.tsx b/packages/web/src/components/changes/change-prompt-action.tsx
index 187655540..63f8e0e6d 100644
--- a/packages/web/src/components/changes/change-prompt-action.tsx
+++ b/packages/web/src/components/changes/change-prompt-action.tsx
@@ -9,20 +9,13 @@ import {
changePromptFixes,
type ChangePromptInput,
} from "@repowise-dev/ui/health";
-
-/**
- * Reveal rule for a per-row prompt: hidden at rest, shown on row hover, focus
- * within the row, and where there is no hover. Rows carry `group/row`.
- */
-// Follow-up: replace the quiet branch with L-nav's RowPromptAction (ghost
-// variant) and the modal with L-perf's useAiPromptAction once both merge.
-const ROW_REVEAL =
- "opacity-0 focus-visible:opacity-100 group-hover/row:opacity-100 group-focus-within/row:opacity-100 [@media(hover:none)]:opacity-100";
+import { RowPromptAction } from "@repowise-dev/ui/health/row-prompt-action";
/**
* A change prompt: the shared button and dialog in their own client boundary,
- * so the page around them stays server-rendered. The filled button is the
- * page's one primary action; `quiet` is the per-file row action.
+ * so the page around them stays server-rendered. The outlined button is the
+ * page's one primary action; `quiet` is the per-file row action, revealed on
+ * row hover or focus like every other row prompt.
*/
export function ChangePromptAction({
change,
@@ -44,12 +37,11 @@ export function ChangePromptAction({
: t(fixing ? "promptActionFix" : "promptAction");
return (
<>
- <AiPromptButton
- label={label}
- variant={quiet ? "icon" : "default"}
- className={quiet ? ROW_REVEAL : undefined}
- onClick={() => setOpen(true)}
- />
+ {quiet ? (
+ <RowPromptAction variant="icon" label={label} onClick={() => setOpen(true)} />
+ ) : (
+ <AiPromptButton label={label} onClick={() => setOpen(true)} />
+ )}
<AiPromptModal
open={open}
onOpenChange={setOpen}
diff --git a/packages/web/src/components/changes/changes-table.tsx b/packages/web/src/components/changes/changes-table.tsx
index 1b5173d62..44ad0b50e 100644
--- a/packages/web/src/components/changes/changes-table.tsx
+++ b/packages/web/src/components/changes/changes-table.tsx
@@ -52,7 +52,7 @@ export function ChangesTable({ repoId, rows }: { repoId: string; rows: ChangeLis
</span>
<Link
href={`/repos/${repoId}/changes/${encodeURIComponent(c.id)}`}
- className="min-w-0 rounded-sm text-xs text-[var(--color-text-primary)] [text-wrap:pretty] hover:text-[var(--color-accent-primary)] hover:underline focus-visible:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="min-w-0 rounded-sm text-xs text-[var(--color-text-primary)] [text-wrap:pretty] hover:text-[var(--color-accent-primary)] hover:underline focus-visible:text-[var(--color-accent-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{c.title}
</Link>
diff --git a/packages/web/src/components/code-health/fix-first-section.test.tsx b/packages/web/src/components/code-health/fix-first-section.test.tsx
index 980892919..30c6ba19b 100644
--- a/packages/web/src/components/code-health/fix-first-section.test.tsx
+++ b/packages/web/src/components/code-health/fix-first-section.test.tsx
@@ -149,7 +149,7 @@ describe("FixFirstSection", () => {
getFixFirstItemPrompt.mockResolvedValue({ flavor: "generic", text: "Core prompt text" });
renderSection();
fireEvent.click(await screen.findByRole("button", { name: /Extract lines 60-122/ }));
- fireEvent.click(screen.getAllByRole("button", { name: "Copy prompt for your agent" })[0]!);
+ fireEvent.click(screen.getAllByRole("button", { name: "Copy prompt" })[0]!);
expect(await screen.findByText("Core prompt text")).toBeTruthy();
expect(getFixFirstItemPrompt).toHaveBeenCalledWith("r1", "fix1_a", {
flavor: expect.any(String),
diff --git a/packages/web/src/components/layout/feedback-button.tsx b/packages/web/src/components/layout/feedback-button.tsx
index f9f525852..db55f6937 100644
--- a/packages/web/src/components/layout/feedback-button.tsx
+++ b/packages/web/src/components/layout/feedback-button.tsx
@@ -14,6 +14,8 @@ import { Button } from "@repowise-dev/ui/ui/button";
import { toast } from "sonner";
import { submitFeedback, type FeedbackCategory } from "@/lib/api/feedback";
import { useTranslations } from "next-intl";
+import { FIELD_CLASS } from "@repowise-dev/ui/ui/input";
+import { cn } from "@/lib/utils/cn";
/** The categories in the order they are offered. The labels are read from the
* active locale inside the component, so the list is built there. */
@@ -147,7 +149,7 @@ export function FeedbackButton() {
value={message}
onChange={(e) => setMessage(e.target.value)}
placeholder={t("feedback.messagePlaceholder")}
- className="w-full resize-none rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2.5 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-accent-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "w-full resize-none rounded-lg px-3 py-2.5 text-sm")}
/>
<p className="mt-1 text-right text-[11px] text-[var(--color-text-tertiary)]">
{message.length}/{MAX_LENGTH}
@@ -171,7 +173,7 @@ export function FeedbackButton() {
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="[email protected]"
- className="w-full rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-2 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-accent-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-primary)]"
+ className={cn(FIELD_CLASS, "w-full rounded-lg px-3 py-2 text-sm")}
/>
</div>
</div>
diff --git a/packages/web/src/components/layout/language-switcher.tsx b/packages/web/src/components/layout/language-switcher.tsx
index 4fdedd9af..ae4915c6f 100644
--- a/packages/web/src/components/layout/language-switcher.tsx
+++ b/packages/web/src/components/layout/language-switcher.tsx
@@ -103,7 +103,7 @@ export function LanguageSwitcher({ compact, className }: LanguageSwitcherProps)
type="button"
aria-label={`${t("label")}: ${LOCALE_LABELS[active]}`}
className={cn(
- "inline-flex h-8 min-w-8 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-medium text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "inline-flex h-8 min-w-8 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-medium text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-wash-hover)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
className,
)}
>
@@ -122,7 +122,7 @@ export function LanguageSwitcher({ compact, className }: LanguageSwitcherProps)
aria-current={selected ? "true" : undefined}
lang={locale}
onClick={() => select(locale)}
- className="flex min-h-8 w-full items-center justify-between gap-2 rounded px-2 text-left text-sm text-[var(--color-text-primary)] hover:bg-[var(--color-bg-wash-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex min-h-8 w-full items-center justify-between gap-2 rounded px-2 text-left text-sm text-[var(--color-text-primary)] hover:bg-[var(--color-bg-wash-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{LOCALE_LABELS[locale]}
{selected && <Check className="h-3.5 w-3.5" aria-hidden />}
diff --git a/packages/web/src/components/layout/release-notes.tsx b/packages/web/src/components/layout/release-notes.tsx
index 6fb7797b9..5bf26ae5c 100644
--- a/packages/web/src/components/layout/release-notes.tsx
+++ b/packages/web/src/components/layout/release-notes.tsx
@@ -156,7 +156,7 @@ function HighlightItem({
<Link
href={href}
onClick={onNavigate}
- className={`${MOMENT_CARD} group flex w-full flex-col px-4 py-3 no-underline transition-colors hover:border-[var(--color-border-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]`}
+ className={`${MOMENT_CARD} group flex w-full flex-col px-4 py-3 no-underline transition-colors hover:border-[var(--color-border-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]`}
style={{ borderLeftColor: color }}
>
{body}
@@ -189,7 +189,7 @@ function ChangeSection({ name, items }: { name: string; items: string[] }) {
if (e.currentTarget.open) setOpened(true);
}}
>
- <summary className="flex cursor-pointer list-none items-baseline gap-2 rounded py-2 text-sm text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]">
+ <summary className="flex cursor-pointer list-none items-baseline gap-2 rounded py-2 text-sm text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]">
<span aria-hidden className="text-[var(--color-text-tertiary)] group-open/section:rotate-90 motion-safe:transition-transform">
›
</span>
diff --git a/packages/web/src/components/layout/repo-breadcrumb.tsx b/packages/web/src/components/layout/repo-breadcrumb.tsx
index 67158a2a9..be243e204 100644
--- a/packages/web/src/components/layout/repo-breadcrumb.tsx
+++ b/packages/web/src/components/layout/repo-breadcrumb.tsx
@@ -70,7 +70,7 @@ export function RepoBreadcrumb({
{!onChatPage && (
<Link
href={`/repos/${repoId}/chat`}
- className="inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs 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)]"
+ className="inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<MessageSquare className="h-3.5 w-3.5" aria-hidden />
{ts("ask")}
diff --git a/packages/web/src/components/layout/whats-new-modal.tsx b/packages/web/src/components/layout/whats-new-modal.tsx
index f66c057a5..b022552b5 100644
--- a/packages/web/src/components/layout/whats-new-modal.tsx
+++ b/packages/web/src/components/layout/whats-new-modal.tsx
@@ -117,7 +117,7 @@ export function WhatsNewModal({ open, onOpenChange, version, fresh = false }: Wh
<button
type="button"
onClick={() => setSelected(e.version)}
- className="rounded text-xs 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 text-[var(--color-accent-primary)] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{releaseName(e.version, t("whatsNewModal.nextRelease"))}
{e.label && (
diff --git a/packages/web/src/components/settings/settings-nav.tsx b/packages/web/src/components/settings/settings-nav.tsx
index 0f60c5414..ee315aacb 100644
--- a/packages/web/src/components/settings/settings-nav.tsx
+++ b/packages/web/src/components/settings/settings-nav.tsx
@@ -34,7 +34,7 @@ export function SettingsNav({
href={href}
aria-current={active ? "page" : undefined}
className={cn(
- "flex rounded-md px-2.5 py-1.5 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]",
+ "flex rounded-md px-2.5 py-1.5 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
active
? "bg-[var(--color-bg-wash)] font-medium text-[var(--color-text-primary)]"
: "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-wash)] hover:text-[var(--color-text-primary)]",
diff --git a/packages/web/src/components/setup/hosted-setup-card.tsx b/packages/web/src/components/setup/hosted-setup-card.tsx
index 26df6fab6..f6ac0fdc7 100644
--- a/packages/web/src/components/setup/hosted-setup-card.tsx
+++ b/packages/web/src/components/setup/hosted-setup-card.tsx
@@ -52,7 +52,7 @@ export function HostedSetupCard({ onboarding }: { onboarding: OnboardingState })
onClick={() => void hide("hosted_card_hidden")}
aria-label={t("hide")}
title={t("hide")}
- className="-m-1.5 rounded p-1.5 text-[var(--color-text-tertiary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="-m-1.5 rounded p-1.5 text-[var(--color-text-tertiary)] transition-colors hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-4 w-4" />
</button>
diff --git a/packages/web/src/components/setup/setup-page.test.tsx b/packages/web/src/components/setup/setup-page.test.tsx
index c0e4fc5e2..de8bbce9c 100644
--- a/packages/web/src/components/setup/setup-page.test.tsx
+++ b/packages/web/src/components/setup/setup-page.test.tsx
@@ -2,7 +2,7 @@
import React from "react";
import { SWRConfig } from "swr";
-import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { SetupResponse } from "@/lib/api/setup";
import { doneFixture, setupFixture } from "./setup-fixture";
@@ -73,12 +73,46 @@ describe("SetupPage", () => {
expect(hrefs).toContain("/repos/r1/settings/agents");
});
- it("puts the prompt first on a Needs attention row, with a preview", async () => {
+ it("gives a Needs attention row the copy action, a status for screen readers and no preview box", async () => {
+ const writeText = vi.fn().mockResolvedValue(undefined);
+ Object.assign(navigator, { clipboard: { writeText } });
const s = setupFixture();
renderPage({ ...s, index: { ...s.index, parse_error_count: 1, parse_error_files: ["gen.py"] } });
expect(await screen.findByText("Needs attention")).toBeTruthy();
- expect(screen.getByText("Prompt preview")).toBeTruthy();
- expect(screen.getByText(/gen\.py\. Run repowise doctor --format json to confirm/)).toBeTruthy();
+ expect(screen.queryByText("Prompt preview")).toBeNull();
+ const row = document.querySelector("[data-row='index-parse']") as HTMLElement;
+ expect(row.className).not.toMatch(/warning-muted/);
+ expect(row.querySelector("h3 .sr-only")?.textContent).toContain("1");
+
+ const copy = screen.getByRole("button", { name: "Copy prompt: Files that could not be parsed" });
+ fireEvent.click(copy);
+ await waitFor(() => expect(writeText).toHaveBeenCalled());
+ const prompt = writeText.mock.calls[0]![0] as string;
+ expect(prompt).toContain("repowise reports for orbit-api: Files that could not be parsed.");
+ expect(prompt).toContain("- `gen.py`");
+ expect(prompt).not.toMatch(/to confirm|until I confirm/);
+ expect(await screen.findByText("Copied", { selector: "[aria-live='polite']" })).toBeTruthy();
+ });
+
+ it("clamps long doctor detail to one line behind a Show details toggle", async () => {
+ // jsdom does not lay out text, so report the clamped line as overflowing.
+ const height = vi.spyOn(HTMLElement.prototype, "scrollHeight", "get").mockReturnValue(40);
+ renderPage(
+ setupFixture({
+ checks: [
+ { id: "vector-store", name: "Vector store", level: "fail", detail: "missing (run repowise reindex)", fix: "repowise reindex" },
+ ],
+ }),
+ );
+ await screen.findByText("Vector store");
+ const row = within(document.querySelector("[data-row='check-vector-store']") as HTMLElement);
+ const toggle = row.getByRole("button", { name: "Show details" });
+ expect(toggle.getAttribute("aria-expanded")).toBe("false");
+ // The "(run X)" hint repeats the command chip, so it is gone from the detail.
+ expect(row.getByText("missing")).toBeTruthy();
+ fireEvent.click(toggle);
+ expect(row.getByRole("button", { name: "Hide details" }).getAttribute("aria-expanded")).toBe("true");
+ height.mockRestore();
});
});
diff --git a/packages/web/src/components/setup/setup-pill.tsx b/packages/web/src/components/setup/setup-pill.tsx
index 95ff04fff..fbe256fad 100644
--- a/packages/web/src/components/setup/setup-pill.tsx
+++ b/packages/web/src/components/setup/setup-pill.tsx
@@ -88,7 +88,7 @@ export function SetupPill({ repoId, compact = false }: { repoId: string; compact
href={setupHref(repoId)}
aria-label={label}
title={label}
- className="flex items-center justify-center rounded-md p-2 transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex items-center justify-center rounded-md p-2 transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<SetupRing done={done} />
</Link>
@@ -99,7 +99,7 @@ export function SetupPill({ repoId, compact = false }: { repoId: string; compact
<Link
href={setupHref(repoId)}
aria-label={label}
- className="flex min-w-0 flex-1 items-center gap-2 rounded-full py-1.5 pl-2.5 transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="flex min-w-0 flex-1 items-center gap-2 rounded-full py-1.5 pl-2.5 transition-colors hover:bg-[var(--color-bg-elevated)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<SetupRing done={done} />
<span className="truncate">{t("label")}</span>
@@ -112,7 +112,7 @@ export function SetupPill({ repoId, compact = false }: { repoId: string; compact
onClick={() => void hide("setup_pill_hidden")}
aria-label={t("hide")}
title={t("hide")}
- className="shrink-0 rounded-full p-1 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="shrink-0 rounded-full p-1 text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
<X className="h-3.5 w-3.5" />
</button>
diff --git a/packages/web/src/components/setup/setup-row.tsx b/packages/web/src/components/setup/setup-row.tsx
index 9af24447f..54431cbcd 100644
--- a/packages/web/src/components/setup/setup-row.tsx
+++ b/packages/web/src/components/setup/setup-row.tsx
@@ -1,8 +1,7 @@
"use client";
-import { useState, type ReactNode } from "react";
+import { useLayoutEffect, useRef, useState, type ReactNode } from "react";
import { useTranslations } from "next-intl";
-import { Check } from "lucide-react";
import { AiPromptButton } from "@repowise-dev/ui/health/ai-prompt-button";
import { RowPromptAction } from "@repowise-dev/ui/health/row-prompt-action";
import { buildSetupAiPrompt } from "@repowise-dev/ui/health/ai-prompt-builder";
@@ -18,6 +17,10 @@ const DOT: Record<SetupTone, string> = {
model: "bg-[var(--color-model)]",
};
+/** The same quiet underlined toggle as "Show files". */
+const TOGGLE =
+ "text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px]";
+
/** A `SetupMsg` in the reader's locale; doctor text passes through as is. */
export function useSetupText() {
const t = useTranslations("setup.row");
@@ -50,97 +53,93 @@ interface Props {
}
/**
- * One Setup row: status dot and word, title, one line of detail, then the
- * action column: the primary action, "Copy prompt for your agent" and the
- * terminal command. The prompt shows on hover and focus-within, always on
- * touch screens, and on a "Needs attention" row it is the primary action,
- * with the prompt it copies previewed under the row.
+ * One Setup row, the same for every section: a status dot and the title,
+ * one line of detail (the rest behind "Show details"), then the terminal
+ * command; actions sit on the right. The status word is for screen readers;
+ * the dot carries it on screen. A "Needs attention" row's action copies its
+ * prompt; elsewhere the prompt shows on row hover, focus, and on touch.
*/
export function SetupRowView({ row, action, onOpenPrompt, children }: Props) {
const text = useSetupText();
const attention = row.action?.kind === "prompt";
const title = text(row.title);
- const [copied, setCopied] = useState(false);
return (
<div
data-row={row.id}
- className={cn(
- "group/row grid grid-cols-1 gap-x-4 gap-y-2 border-t border-[var(--color-border-default)] py-3 sm:grid-cols-[124px_minmax(0,1fr)_auto]",
- attention &&
- "-mx-2.5 rounded-lg border-transparent bg-[var(--color-warning-muted)] px-2.5 [&+&]:mt-1",
- )}
+ className="group/row flex flex-col gap-2 border-t border-[var(--color-border-default)] py-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4"
>
- <span className="flex items-center gap-1.5 pt-px text-xs text-[var(--color-text-secondary)]">
- <StatusDot tone={row.tone} />
- {text(row.status)}
- </span>
- <div className="min-w-0">
- <h3 className="text-sm font-semibold text-[var(--color-text-primary)]">{title}</h3>
- <p className="mt-0.5 text-xs text-[var(--color-text-secondary)] [text-wrap:pretty]">
- {text(row.detail)}
- </p>
+ <div className="min-w-0 flex-1">
+ <h3 className="flex items-center gap-2 text-sm font-semibold text-[var(--color-text-primary)]">
+ <StatusDot tone={row.tone} />
+ <span className="min-w-0">{title}</span>
+ <span className="sr-only">: {text(row.status)}</span>
+ </h3>
+ <RowDetail detail={text(row.detail)} />
{children}
+ <div className="mt-1.5">
+ <SetupCommand command={row.command} />
+ </div>
</div>
- <div className="flex flex-wrap items-center gap-2 sm:flex-col sm:flex-nowrap sm:items-end">
- {attention ? <AttentionPrompt row={row} onCopied={() => setCopied(true)} /> : action}
+ <div className="flex shrink-0 flex-wrap items-center gap-2">
+ {attention ? <AttentionPrompt row={row} /> : action}
{!attention && <RowPromptAction onClick={onOpenPrompt} subject={title} />}
- <SetupCommand command={row.command} />
</div>
- {attention && <PromptPreview row={row} copied={copied} />}
</div>
);
}
-/** Copies the prompt on click; the preview under the row says it did. */
-function AttentionPrompt({ row, onCopied }: { row: SetupRow; onCopied: () => void }) {
+/**
+ * The detail on one line, with a toggle when it runs longer. Overflow is
+ * measured, so a short line never grows a toggle it does not need.
+ */
+function RowDetail({ detail }: { detail: string }) {
const t = useTranslations("setup");
- return (
- <AiPromptButton
- label={t("copyPrompt")}
- ariaLabel={`${t("copyPrompt")}: ${row.prompt.title}`}
- onClick={() => {
- void copyText(buildSetupAiPrompt(row.prompt)).then((ok) => ok && onCopied());
- }}
- />
- );
-}
+ const ref = useRef<HTMLParagraphElement>(null);
+ const [open, setOpen] = useState(false);
+ const [overflows, setOverflows] = useState(false);
-async function copyText(value: string): Promise<boolean> {
- try {
- await navigator.clipboard.writeText(value);
- return true;
- } catch {
- // Clipboard blocked: the preview stays selectable.
- return false;
- }
-}
+ useLayoutEffect(() => {
+ const el = ref.current;
+ if (!el || open) return;
+ const measure = () => setOverflows(el.scrollHeight > el.clientHeight + 1);
+ measure();
+ if (typeof ResizeObserver === "undefined") return;
+ const observer = new ResizeObserver(measure);
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, [detail, open]);
-function PromptPreview({ row, copied }: { row: SetupRow; copied: boolean }) {
- const t = useTranslations("setup");
+ if (!detail) return null;
return (
- <div className="col-span-full min-w-0 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] px-3 py-2.5">
- <p className="mb-1 flex items-center justify-between gap-2 text-xs font-medium text-[var(--color-text-primary)]">
- {t("promptPreview")}
- <span aria-live="polite" className="flex items-center gap-1 font-normal text-[var(--color-text-tertiary)]">
- {copied && (
- <>
- <Check className="h-3 w-3 text-[var(--color-success)]" aria-hidden />
- {t("copied")}
- </>
- )}
- </span>
- </p>
- <p className="line-clamp-4 font-mono text-[11px] leading-relaxed text-[var(--color-text-secondary)] [overflow-wrap:anywhere]">
- {previewText(row)}
+ <>
+ <p
+ ref={ref}
+ className={cn(
+ "mt-0.5 text-xs text-[var(--color-text-secondary)] [overflow-wrap:anywhere]",
+ !open && "line-clamp-1",
+ )}
+ >
+ {detail}
</p>
- </div>
+ {(overflows || open) && (
+ <button type="button" aria-expanded={open} onClick={() => setOpen((v) => !v)} className={cn(TOGGLE, "mt-1")}>
+ {open ? t("hideDetails") : t("showDetails")}
+ </button>
+ )}
+ </>
);
}
-/** The part of the prompt worth reading at a glance: what was found, what to run, the ask. */
-export function previewText(row: SetupRow): string {
- const { state, items, fix } = row.prompt;
- const listed = items?.length ? ` ${items.slice(0, 5).join(", ")}${items.length > 5 ? ", ..." : ""}.` : "";
- const ask = fix ? " Do not change anything until I confirm." : "";
- return `In ${row.prompt.repoName}: ${state}${listed} Run ${row.command} to confirm.${ask}`;
+/** Copies the row's prompt; the button itself says "Copied". */
+function AttentionPrompt({ row }: { row: SetupRow }) {
+ const t = useTranslations("setup");
+ return (
+ <AiPromptButton
+ label={t("copyPrompt")}
+ copiedLabel={t("copied")}
+ failedLabel={t("copyFailed")}
+ ariaLabel={`${t("copyPrompt")}: ${row.prompt.title}`}
+ copyText={() => buildSetupAiPrompt(row.prompt)}
+ />
+ );
}
diff --git a/packages/web/src/components/setup/setup-rows.test.ts b/packages/web/src/components/setup/setup-rows.test.ts
index cb6d34fb3..afb7afede 100644
--- a/packages/web/src/components/setup/setup-rows.test.ts
+++ b/packages/web/src/components/setup/setup-rows.test.ts
@@ -49,6 +49,8 @@ describe("deriveSetup", () => {
expect(row.action).toEqual({ kind: "prompt" });
expect(row.files).toEqual(["a.py", "b.py"]);
expect(row.prompt).toMatchObject({ fix: true, verify: "doctor", items: ["a.py", "b.py"] });
+ // The doctor command shows the files; it is not a fix, so the prompt names none.
+ expect(row.prompt.command).toBeUndefined();
// Skipped files do not undo a current index.
expect(view.doneCount).toBe(2);
});
@@ -108,6 +110,37 @@ describe("deriveSetup", () => {
});
});
+ it("drops a closing (run X) from doctor text when it repeats the row command", () => {
+ const view = deriveSetup(
+ setupFixture({
+ checks: [
+ { id: "vector-store", name: "Vector store", level: "fail", detail: "missing (run: repowise reindex)", fix: "repowise reindex" },
+ { id: "config", name: "Config", level: "warn", detail: "stale (run repowise doctor --fix)", fix: "repowise init" },
+ ],
+ }),
+ OPTS,
+ );
+ expect(view.attention[0]!.detail).toEqual({ text: "missing" });
+ expect(view.attention[0]!.prompt).toMatchObject({
+ state: "missing",
+ command: "repowise reindex",
+ fromDoctor: true,
+ fix: true,
+ });
+ // A different command in the hint is information, so it stays.
+ expect(view.attention[1]!.detail).toEqual({ text: "stale (run repowise doctor --fix)" });
+ });
+
+ it("gives a doctor check with no fix a prompt with no command", () => {
+ const view = deriveSetup(
+ setupFixture({ checks: [{ id: "database", name: "Database", level: "fail", detail: "locked" }] }),
+ OPTS,
+ );
+ const row = view.attention[0]!;
+ expect(row.command).toBe("repowise doctor --format json");
+ expect(row.prompt.command).toBeUndefined();
+ });
+
it("offers a discovered coverage report and the model sheet", () => {
const [model, coverage, rewrite] = deriveSetup(setupFixture(), OPTS).optional;
expect(model!.action).toEqual({ kind: "model", hasModel: false });
diff --git a/packages/web/src/components/setup/setup-rows.ts b/packages/web/src/components/setup/setup-rows.ts
index c3d58503e..2cbc2ad59 100644
--- a/packages/web/src/components/setup/setup-rows.ts
+++ b/packages/web/src/components/setup/setup-rows.ts
@@ -120,7 +120,6 @@ function indexParseRow(s: SetupResponse, o: DeriveOptions): SetupRow {
repoName: o.repoName,
title: "Files that could not be parsed",
state: `repowise could not parse ${count} file${count === 1 ? "" : "s"} while indexing, so their symbols are missing from the graph. For each file, tell me whether it should be excluded (exclude_patterns in .repowise/config.yaml) or whether its syntax needs a fix.`,
- command: "repowise doctor --format json",
verify: "doctor",
fix: true,
items: files,
@@ -197,7 +196,6 @@ function agentSilentRow(agent: SetupAgent, o: DeriveOptions): SetupRow {
repoName: o.repoName,
title: "Coding agent has not reached the index",
state: `${agent.display_name} is registered but has not called this repository's index in the day since it connected. It may have opened a different folder: if so, open ${o.repoName} in it, or run \`repowise init\` in the folder it opened.`,
- command,
verify: "doctor",
fix: true,
},
@@ -430,23 +428,35 @@ function rewriteRow(s: SetupResponse, o: DeriveOptions): SetupRow {
};
}
+/** A trailing "(run X)" or "(run: X)" in doctor text, with X captured. */
+const RUN_HINT = /\s*\(run:?\s+`?([^`)]+?)`?\)\s*\.?\s*$/;
+
+/** Doctor text without a closing "(run X)" that repeats the row's command. */
+export function withoutRunHint(detail: string, command: string): string {
+ const hint = RUN_HINT.exec(detail);
+ if (!hint || hint[1]?.trim() !== command.trim()) return detail;
+ return detail.slice(0, hint.index).trimEnd();
+}
+
function checkRow(check: NonNullable<SetupResponse["checks"]>[number], o: DeriveOptions): SetupRow {
const command = check.fix ?? "repowise doctor --format json";
+ const detail = withoutRunHint(check.detail ?? "", command);
return {
id: `check-${check.id}`,
tone: "attention",
status: msg(check.level === "fail" ? "check.statusFail" : "check.statusWarn"),
title: { text: check.name },
- detail: { text: check.detail ?? "" },
+ detail: { text: detail },
action: { kind: "prompt" },
command,
prompt: {
repoName: o.repoName,
title: check.name,
- state: `\`repowise doctor\` reports ${check.level === "fail" ? "a failure" : "a warning"} for "${check.name}": ${check.detail ?? ""}`,
- command,
+ state: detail,
+ ...(check.fix ? { command: check.fix } : {}),
verify: "doctor",
fix: true,
+ fromDoctor: true,
},
};
}
@@ -567,8 +577,7 @@ export function agentListRows(s: SetupResponse, o: DeriveOptions): SetupRow[] {
prompt: {
repoName: o.repoName,
title: "Coding agents",
- state: "repowise could not list the coding agents on this machine.",
- command: "repowise agents",
+ state: "repowise could not list the coding agents on this machine. `repowise agents` shows why.",
verify: "doctor",
fix: true,
},
diff --git a/packages/web/src/components/welcome/welcome-step-agent.tsx b/packages/web/src/components/welcome/welcome-step-agent.tsx
index 54ace6999..f1b1141cf 100644
--- a/packages/web/src/components/welcome/welcome-step-agent.tsx
+++ b/packages/web/src/components/welcome/welcome-step-agent.tsx
@@ -125,11 +125,6 @@ function AgentRow({
}
}
- async function copyPrompt() {
- const prompt = t("prompt", { name, command });
- if (await copyText(prompt)) toast.success(t("promptCopied"));
- }
-
const file = firstConfigFile(agent);
return (
<div className={ROW}>
@@ -161,7 +156,13 @@ function AgentRow({
)
) : (
<span className="flex flex-wrap items-center justify-end gap-1.5 max-[560px]:justify-start">
- <AiPromptButton label={t("copyPrompt")} onClick={() => void copyPrompt()} />
+ <AiPromptButton
+ label={t("copyPrompt")}
+ copiedLabel={t("copied")}
+ failedLabel={t("copyFailed")}
+ ariaLabel={`${t("copyPrompt")}: ${name}`}
+ copyText={() => t("prompt", { name, command })}
+ />
{writesAllowed && (
<Button variant="outline" size="sm" disabled={busy} onClick={() => void connect()}>
{busy ? t("connecting") : t("connect")}
@@ -185,7 +186,7 @@ function CopyQuestion({ text }: { text: string }) {
window.setTimeout(() => setCopied(false), 1600);
}}
aria-label={copied ? t("copied") : t("copyQuestion", { question: text })}
- className="shrink-0 rounded text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="shrink-0 rounded text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{copied ? t("copied") : t("copy")}
</button>
diff --git a/packages/web/src/components/welcome/welcome-step-repo.tsx b/packages/web/src/components/welcome/welcome-step-repo.tsx
index 44e668b1a..e2c15cd55 100644
--- a/packages/web/src/components/welcome/welcome-step-repo.tsx
+++ b/packages/web/src/components/welcome/welcome-step-repo.tsx
@@ -29,7 +29,7 @@ const BAND_DOT: Record<HealthBand, string> = {
};
const LINK =
- "mt-1.5 self-start rounded text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px] hover:decoration-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]";
+ "mt-1.5 self-start rounded text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px] hover:decoration-[var(--color-text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]";
interface CardText {
label: string;
diff --git a/packages/web/src/components/welcome/welcome-step-yours.tsx b/packages/web/src/components/welcome/welcome-step-yours.tsx
index 98736bbe8..a905d667a 100644
--- a/packages/web/src/components/welcome/welcome-step-yours.tsx
+++ b/packages/web/src/components/welcome/welcome-step-yours.tsx
@@ -44,7 +44,7 @@ export function WelcomeStepYours({ repoId, setup }: { repoId: string; setup: Set
href={hostedLink("welcome", "team")}
target="_blank"
rel="noreferrer"
- className="rounded text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)]"
+ className="rounded text-xs font-medium text-[var(--color-text-primary)] underline decoration-[var(--color-border-hover)] underline-offset-[3px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
>
{t("teamLink")}
</a>