fix(ui): animate immediate tool subtitles on first reveal

This commit is contained in:
Kit Langton
2026-03-03 17:13:24 -05:00
parent 4ef8ae9ddb
commit bb8b850b5f

View File

@@ -1474,13 +1474,11 @@ const TOOL_WIPE_MASK =
"linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 60%, rgba(0,0,0,0) 100%)"
function useToolReveal(pending: () => boolean, animate?: () => boolean) {
const [live, setLive] = createSignal(pending())
const enabled = () => animate?.() ?? true
const [live, setLive] = createSignal(pending() || enabled())
createEffect(() => {
if (pending()) setLive(true)
})
const enabled = () => animate?.() ?? true
return () => enabled() && live()
}
@@ -1643,7 +1641,9 @@ function ToolTriggerRow(props: {
)
const detail = createMemo(() => [props.subtitle, ...(props.args ?? [])].filter((x): x is string => !!x).join(" "))
const detailAnimate = createMemo(() => {
if (props.revealOnMount) return props.animate !== false
if (props.animate === false) return false
if (props.revealOnMount) return true
if (!props.pending && !reveal()) return true
return reveal()
})