Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions frontend/components/chat/workspace-pane.test.tsx
Original file line number Diff line number Diff line change
@@ -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(
<WorkpieceTabStrip
tabs={[{ id: "notes", name: "notes.md" }]}
activeId="notes"
onSelect={() => {}}
onClose={() => {}}
/>,
);
const rings = html.match(/focus-visible:ring-border-focus-ring/g) ?? [];
expect(rings.length).toBe(2);
});
6 changes: 3 additions & 3 deletions frontend/components/chat/workspace-pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<>
Expand All @@ -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"
>
<RiCloseLine aria-hidden className="size-3.5" />
</button>
Expand Down Expand Up @@ -306,7 +306,7 @@ function WorkpieceEditorView({
/>
{editor.actionContract.edit && (
<details className="shrink-0 border-t border-border-button-default px-3 py-1.5">
<summary className="cursor-pointer text-caption-1-medium text-text-secondary outline-none marker:text-text-tertiary hover:text-text-primary">
<summary className="cursor-pointer rounded text-caption-1-medium text-text-secondary outline-none marker:text-text-tertiary hover:text-text-primary focus-visible:ring-2 focus-visible:ring-border-focus-ring">
What edits are preserved
</summary>
<div className="pt-2">
Expand Down
Loading