diff --git a/e2e/agentComposerIcons.spec.ts b/e2e/agentComposerIcons.spec.ts index 88f32c4d0..b9a0bf1d6 100644 --- a/e2e/agentComposerIcons.spec.ts +++ b/e2e/agentComposerIcons.spec.ts @@ -62,4 +62,33 @@ for (const theme of ["light", "dark"] as const) { await page.keyboard.press("Escape"); await expect(menu).toBeHidden(); }); + + test(`${theme}: running session Stop button is frameless with a 16px icon`, async ({ workbench: page }, testInfo) => { + await page.evaluate( + async ({ task, theme }) => { + const storePath = "/src/features/agents/store.ts"; + const themePath = "/src/workbench/theme.ts"; + const store = await import(storePath); + await (await import(themePath)).setTheme(theme); + store.useAgents.setState({ + loaded: true, + error: null, + tasks: new Map([[task.id, { ...task, status: "running" }]]), + entries: new Map([[task.id, []]]), + sessionLocation: "editor", + }); + store.openTask(task.id); + }, + { task, theme }, + ); + + await expect(page.locator("html")).toHaveAttribute("data-theme", theme); + const stop = page.getByRole("button", { name: "Stop" }); + await expect(stop).toBeVisible(); + await expect(stop).toHaveCSS("background-color", "rgba(0, 0, 0, 0)"); + await expect(stop).toHaveCSS("box-shadow", "none"); + await expect(stop.locator("svg")).toHaveCSS("width", "16px"); + await expect(stop.locator("svg")).toHaveCSS("height", "16px"); + await stop.locator("..").screenshot({ path: testInfo.outputPath(`stop-${theme}.png`), animations: "disabled" }); + }); } diff --git a/src/features/agents/SubmitButton.module.css b/src/features/agents/SubmitButton.module.css index 2059cae84..aabf09e85 100644 --- a/src/features/agents/SubmitButton.module.css +++ b/src/features/agents/SubmitButton.module.css @@ -9,3 +9,16 @@ color: var(--fg-faint); box-shadow: none; } + +.submit.stop { + background: transparent; + box-shadow: none; +} + +.submit.stop:not(:disabled):hover { + background: var(--bg-toolbar-hover); +} + +.submit.stop:not(:disabled):active { + background: var(--bg-toolbar-pressed); +} diff --git a/src/features/agents/SubmitButton.tsx b/src/features/agents/SubmitButton.tsx index 97288668b..cd0566c5a 100644 --- a/src/features/agents/SubmitButton.tsx +++ b/src/features/agents/SubmitButton.tsx @@ -1,3 +1,4 @@ +import clsx from "clsx"; import { useTx } from "@/platform/i18n"; import { Button, Icon, Spinner, tooltipAttrs, type ButtonProps } from "@/ui"; import styles from "./SubmitButton.module.css"; @@ -13,16 +14,17 @@ export function SubmitButton({ }) { const tx = useTx(); const name = tx(label); + const stop = label === "Stop"; return ( ); }