Skip to content

Commit 746f924

Browse files
committed
fix(webapp): the agent spinner keeps spinning across status changes
- AgentSpinner rests on the playlist's first shape, so mounting shows no logo-head flash — a spinner is born spinning - the pending indicator keeps one stable element across tool changes: the label swaps, the animation never restarts
1 parent 76a27b6 commit 746f924

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

apps/webapp/app/components/dashboard-agent/DashboardAgentMessages.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ function renderDashboardPart(
179179
// One spinner at a time: an in_progress investigation card in this turn
180180
// already shows its own progress pill.
181181
if (options?.suppressPendingPill) return null;
182-
return <ChatPendingTool key={i} label={`${toolPendingLabel(type.slice(5))}…`} />;
182+
// Stable key across tool changes: only the LABEL changes from call to
183+
// call, so the spinner keeps spinning instead of remounting (and
184+
// restarting its animation) on every new tool.
185+
return <ChatPendingTool key="agent-pending" label={`${toolPendingLabel(type.slice(5))}…`} />;
183186
}
184187
if (p.state === "output-error") return renderPart(part, i);
185188
return null;

apps/webapp/app/components/primitives/Spinner.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,16 @@ export function SpinnerWhite({ className }: { className?: string }) {
8585
* loading. `size` is the logo's pixel size (the matrix does not scale from CSS).
8686
*/
8787
export function AgentSpinner({ size = 16 }: { size?: number }) {
88-
return <AgentDotMatrix size={size} active palette="mono" restColor="#ffffff" decorative />;
88+
return (
89+
<AgentDotMatrix
90+
size={size}
91+
active
92+
// A spinner is born spinning: resting on the playlist's first shape means
93+
// the initial frame is already mid-cycle — no logo-head flash on mount.
94+
restShape="square"
95+
palette="mono"
96+
restColor="#ffffff"
97+
decorative
98+
/>
99+
);
89100
}

0 commit comments

Comments
 (0)