fix(agents): render the composer stop button without a secondary border (#7682)

While an agent runs with an empty draft, the composer's submit button turns into Stop but kept the secondary variant, wrapping the outlined stop icon in a bordered box and shrinking it to 14px. The Stop state is now frameless at rest with toolbar hover/pressed backgrounds and the 16px stop icon, like the composer's other toolbar buttons and the IDE's Run/Debug stop buttons.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-12-03 14:51:21 +08:00
1 джерело 87b659b3ac
коміт 00aef16862
3 files changed
+46 -2

No files matched your search

+29
Переглянути файл
@@ -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" });
});
}
+13
Переглянути файл
@@ -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);
}
+4 -2
Переглянути файл
@@ -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 (
<Button
{...props}
variant={variant}
size="small"
className={styles.submit}
className={clsx(styles.submit, stop && styles.stop)}
aria-label={name}
{...tooltipAttrs(name)}
>
{pending ? <Spinner size={12} /> : <Icon name={label === "Stop" ? "stop" : "arrow-up"} size={14} />}
{pending ? <Spinner size={12} /> : <Icon name={stop ? "stop" : "arrow-up"} size={stop ? 16 : 14} />}
</Button>
);
}