diff --git a/frontend/components/chat/workspace-pane.test.tsx b/frontend/components/chat/workspace-pane.test.tsx new file mode 100644 index 00000000..b7fb931f --- /dev/null +++ b/frontend/components/chat/workspace-pane.test.tsx @@ -0,0 +1,16 @@ +import { expect, test } from "bun:test"; +import { renderToStaticMarkup } from "react-dom/server"; +import { WorkpieceTabStrip } from "./workspace-pane"; + +test("the tab and the close button carry the focus ring", () => { + const html = renderToStaticMarkup( + {}} + onClose={() => {}} + />, + ); + const rings = html.match(/focus-visible:ring-border-focus-ring/g) ?? []; + expect(rings.length).toBe(2); +}); diff --git a/frontend/components/chat/workspace-pane.tsx b/frontend/components/chat/workspace-pane.tsx index f2e4f617..0dc0b2e8 100644 --- a/frontend/components/chat/workspace-pane.tsx +++ b/frontend/components/chat/workspace-pane.tsx @@ -92,7 +92,7 @@ export function WorkpieceTabStrip({ type="button" onClick={() => onSelect(tab.id)} aria-current={active} - className="flex h-7 min-w-0 items-center gap-1.5 outline-none" + className="flex h-7 min-w-0 items-center gap-1.5 rounded outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring" > {unseen ? ( <> @@ -109,7 +109,7 @@ export function WorkpieceTabStrip({ onClick={() => onClose(tab.id)} aria-label={`Close ${tab.name}`} title="Close" - className="grid size-5 place-items-center rounded text-foreground-icon-tertiary hover:bg-background-tertiary-default hover:text-text-primary" + className="grid size-5 place-items-center rounded text-foreground-icon-tertiary hover:bg-background-tertiary-default hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring" > @@ -306,7 +306,7 @@ function WorkpieceEditorView({ /> {editor.actionContract.edit && (
- + What edits are preserved