mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(site): tighten execute tool duration spacing (#25739)
This commit is contained in:
@@ -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();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user