refactor(ui): rename animated → springContent in ToolCallPanel

Clarifies the confusing animate/animated prop pair. `animate` controls
whether animations are globally enabled (false during backfill).
`springContent` declares that this tool panel wants spring-animated
height transitions for its collapsible content.
This commit is contained in:
Kit Langton
2026-03-03 19:59:26 -05:00
parent 986a6b19e0
commit c0fd605d73
3 changed files with 11 additions and 11 deletions

View File

@@ -49,7 +49,7 @@ interface ToolCallPanelBaseProps {
defer?: boolean
locked?: boolean
watchDetails?: boolean
animated?: boolean
springContent?: boolean
onSubtitleClick?: () => void
}
@@ -148,7 +148,7 @@ function ToolCallPanel(props: ToolCallPanelBaseProps) {
on(
open,
(value) => {
if (!props.defer || props.animated) return
if (!props.defer || props.springContent) return
if (!value) {
cancel()
setReady(false)
@@ -215,7 +215,7 @@ function ToolCallPanel(props: ToolCallPanelBaseProps) {
}
onMount(() => {
if (!props.animated || props.animate === false || !contentRef || !bodyRef) return
if (!props.springContent || props.animate === false || !contentRef || !bodyRef) return
const offChange = heightSpring.on("change", (v) => {
if (!contentRef) return
@@ -253,7 +253,7 @@ function ToolCallPanel(props: ToolCallPanelBaseProps) {
on(
open,
(isOpen) => {
if (!props.animated || props.animate === false || !contentRef) return
if (!props.springContent || props.animate === false || !contentRef) return
if (isOpen) doOpen()
else doClose()
},
@@ -284,11 +284,11 @@ function ToolCallPanel(props: ToolCallPanelBaseProps) {
arrow={!!props.children && !props.hideDetails && !props.locked && !pending()}
/>
</Collapsible.Trigger>
<Show when={props.animated && props.animate !== false && props.children && !props.hideDetails}>
<Show when={props.springContent && props.animate !== false && props.children && !props.hideDetails}>
<div
ref={contentRef}
data-slot="collapsible-content"
data-animated
data-spring-content
style={{
height: initialOpen ? "auto" : "0px",
overflow: "hidden",
@@ -300,7 +300,7 @@ function ToolCallPanel(props: ToolCallPanelBaseProps) {
</div>
</div>
</Show>
<Show when={(!props.animated || props.animate === false) && props.children && !props.hideDetails}>
<Show when={(!props.springContent || props.animate === false) && props.children && !props.hideDetails}>
<Collapsible.Content>
<Show when={!props.defer || ready()}>
<div data-slot="basic-tool-content-inner">{props.children}</div>

View File

@@ -86,7 +86,7 @@
}
/* JS-animated content: overflow managed by animate() */
&[data-animated] {
&[data-spring-content] {
overflow: hidden;
}
}

View File

@@ -1859,7 +1859,7 @@ ToolRegistry.register({
{...props}
icon="console"
animate
animated
springContent
defaultOpen={false}
trigger={
<div data-slot="basic-tool-tool-info-structured">
@@ -1916,7 +1916,7 @@ ToolRegistry.register({
variant="panel"
{...props}
icon="code-lines"
animated
springContent
trigger={
<div data-component="edit-trigger">
<div data-slot="message-part-title-area">
@@ -1987,7 +1987,7 @@ ToolRegistry.register({
variant="panel"
{...props}
icon="code-lines"
animated
springContent
trigger={
<div data-component="write-trigger">
<div data-slot="message-part-title-area">