mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 01:48:40 +00:00
fix(ui): prevent tool status blank frame (#34547)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
This commit is contained in:
parent
2ace237938
commit
2fe68b5e91
1 changed files with 10 additions and 13 deletions
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue