mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 09:41:04 +01:00
fix(runner): defer activity caret until settled
This commit is contained in:
1 parent
cc19675b28
commit
47b3429a7f
2 files changed
+31
-5
No files matched your search
@@ -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(
|
||||
<TaskChatLiveRunPill
|
||||
status={status}
|
||||
startedAtMs={1_000}
|
||||
finishedAtMs={status === "succeeded" ? 3_000 : null}
|
||||
toolSummary={null}
|
||||
runnerStyle
|
||||
expanded={false}
|
||||
onToggle={() => 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();
|
||||
});
|
||||
});
|
||||
@@ -82,13 +82,15 @@ export function TaskChatLiveRunPill({
|
||||
<>
|
||||
<span className="text-sm font-medium text-foreground/80">{verb}</span>
|
||||
{suffix ? <span className="text-sm text-muted-foreground">{suffix}</span> : null}
|
||||
<ChevronRight
|
||||
className={cn("ml-auto h-3.5 w-3.5 text-muted-foreground transition-transform", expanded && "rotate-90")}
|
||||
aria-hidden
|
||||
/>
|
||||
{!active ? (
|
||||
<ChevronRight
|
||||
className={cn("ml-auto h-3.5 w-3.5 text-muted-foreground transition-transform", expanded && "rotate-90")}
|
||||
aria-hidden
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
return onToggle ? (
|
||||
return onToggle && !active ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onToggle}
|
||||
|
||||
Reference in new issue
Block a user