fix(site): tighten execute tool duration spacing (#25739)

This commit is contained in:
Danielle Maywood
2026-05-27 16:57:05 +01:00
committed by GitHub
parent 2730a87975
commit 2d40a40c57
2 changed files with 12 additions and 15 deletions
@@ -189,23 +189,20 @@ const ShellCommandLine: React.FC<{
? summarizeParsedCommands(parsedCommands)
: "";
const commandDisplay = summary || command;
const commandLabel = intentLabel
? `${intentLabel} using ${commandDisplay}`
: `Ran ${commandDisplay}`;
const durationSuffix = durationLabel ? ` for ${durationLabel}` : "";
return (
<>
<ToolIcon name="execute" isError={false} />
<span className="block min-w-0 truncate text-[13px] font-normal leading-6 text-current">
{intentLabel ? (
<>
{intentLabel} using {commandDisplay}
</>
) : (
<>Ran {commandDisplay}</>
<span className="min-w-0 truncate text-[13px] font-normal leading-6 text-current">
{commandLabel}
{durationSuffix && (
<span className="text-content-secondary">{durationSuffix}</span>
)}
</span>
{durationLabel && (
<span className="shrink-0 text-[13px] font-normal text-content-secondary">
{intentLabel ? ` for ${durationLabel}` : durationLabel}
</span>
)}
{expanded !== undefined && (
<ChevronDownIcon
className={cn(
@@ -340,7 +340,7 @@ export const ExecuteModelIntentLeadingUsing: Story = {
const commandButton = canvas.getByRole("button", {
name: "Expand command",
});
expect(commandButton).toHaveTextContent(`Ran ${executeCommand}2.3s`);
expect(commandButton).toHaveTextContent(`Ran ${executeCommand} for 2.3s`);
expect(commandButton).not.toHaveTextContent("using git fetch origin using");
},
};
@@ -363,7 +363,7 @@ export const ExecuteSuccess: Story = {
expect(
canvas.queryByRole("img", { name: "Running in background" }),
).not.toBeInTheDocument();
expect(canvas.getByText("47.2s")).toBeVisible();
expect(canvas.getByText(/for 47\.2s/)).toBeVisible();
expect(canvas.queryByText("2 lines")).not.toBeInTheDocument();
},
};
@@ -474,7 +474,7 @@ export const ExecuteLongCommandCollapsed: Story = {
expect(commandButton).toHaveTextContent(`Ran ${longExecuteCommand}`);
expect(commandButton).toHaveAttribute("aria-expanded", "false");
expect(canvas.queryByText("exit 0")).not.toBeInTheDocument();
expect(canvas.getByText("47.2s")).toBeVisible();
expect(canvas.getByText(/for 47\.2s/)).toBeVisible();
expect(canvas.queryByText("61 lines")).not.toBeInTheDocument();
},
};