From 2fe68b5e91abda916cceebe27d9814c345dcb262 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 30 Jun 2026 12:26:04 +1000 Subject: [PATCH] fix(ui): prevent tool status blank frame (#34547) Co-authored-by: opencode-agent[bot] --- .../src/components/tool-status-title.tsx | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/session-ui/src/components/tool-status-title.tsx b/packages/session-ui/src/components/tool-status-title.tsx index 589effc1f0..ef9ef6da61 100644 --- a/packages/session-ui/src/components/tool-status-title.tsx +++ b/packages/session-ui/src/components/tool-status-title.tsx @@ -59,24 +59,21 @@ export function ToolStatusTitle(props: { const animate = () => { const first = contentWidth(widthRef) + const next = props.active finish() + setState("active", next) + if (!first) return + setState("animating", true) - setState("active", props.active) - const last = contentWidth(props.active ? activeRef : doneRef) - if (!first || !last) { - finish() - return - } - setState("width", first) - if (first === last) { - finishTimer = setTimeout(finish, 600) - return - } - frame = requestAnimationFrame(() => { frame = undefined - setState("width", last) + const last = contentWidth(next ? activeRef : doneRef) + if (!last) { + finish() + return + } + if (first !== last) setState("width", last) finishTimer = setTimeout(finish, 600) }) }