diff --git a/ui/src/components/task-chat/TaskChatLiveRunPill.test.tsx b/ui/src/components/task-chat/TaskChatLiveRunPill.test.tsx index b990c1fc00a..ce1c8f26de4 100644 --- a/ui/src/components/task-chat/TaskChatLiveRunPill.test.tsx +++ b/ui/src/components/task-chat/TaskChatLiveRunPill.test.tsx @@ -105,4 +105,28 @@ describe("TaskChatLiveRunPill", () => { expect(container.textContent).toContain("Workingfor 2s"); expect(container.querySelector(".shimmer-text")).toBeNull(); }); + + it("only exposes the runner disclosure caret after the run settles", () => { + const render = (status: string) => act(() => { + root.render( + undefined} + />, + ); + }); + + render("running"); + expect(container.querySelector('[data-testid="task-chat-live-run-pill"]')?.tagName).toBe("DIV"); + expect(container.querySelector('[data-testid="task-chat-live-run-pill"] svg')).toBeNull(); + + render("succeeded"); + expect(container.querySelector('[data-testid="task-chat-live-run-pill"]')?.tagName).toBe("BUTTON"); + expect(container.querySelector('[data-testid="task-chat-live-run-pill"] svg')).not.toBeNull(); + }); }); diff --git a/ui/src/components/task-chat/TaskChatLiveRunPill.tsx b/ui/src/components/task-chat/TaskChatLiveRunPill.tsx index 69415b855e1..2d236582797 100644 --- a/ui/src/components/task-chat/TaskChatLiveRunPill.tsx +++ b/ui/src/components/task-chat/TaskChatLiveRunPill.tsx @@ -82,13 +82,15 @@ export function TaskChatLiveRunPill({ <> {verb} {suffix ? {suffix} : null} - + {!active ? ( + + ) : null} ); - return onToggle ? ( + return onToggle && !active ? (