fix(ui): shell-rolling-results formatting cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4795806b13
commit
4e46d98156
1 changed files with 13 additions and 20 deletions
|
|
@ -8,14 +8,7 @@ import { Icon } from "./icon"
|
||||||
import { IconButton } from "./icon-button"
|
import { IconButton } from "./icon-button"
|
||||||
import { TextShimmer } from "./text-shimmer"
|
import { TextShimmer } from "./text-shimmer"
|
||||||
import { Tooltip } from "./tooltip"
|
import { Tooltip } from "./tooltip"
|
||||||
import {
|
import { animate, clearFadeStyles, clearMaskStyles, FAST_SPRING, GROW_SPRING, WIPE_MASK } from "./motion"
|
||||||
animate,
|
|
||||||
clearFadeStyles,
|
|
||||||
clearMaskStyles,
|
|
||||||
FAST_SPRING,
|
|
||||||
GROW_SPRING,
|
|
||||||
WIPE_MASK,
|
|
||||||
} from "./motion"
|
|
||||||
import { useSpring } from "./motion-spring"
|
import { useSpring } from "./motion-spring"
|
||||||
import { busy, createThrottledValue, useToolFade } from "./tool-utils"
|
import { busy, createThrottledValue, useToolFade } from "./tool-utils"
|
||||||
|
|
||||||
|
|
@ -78,14 +71,16 @@ export function ShellRollingResults(props: { part: ToolPart; animate?: boolean }
|
||||||
// a 2s timer sets it false to trigger the collapse. This avoids the flash caused by
|
// a 2s timer sets it false to trigger the collapse. This avoids the flash caused by
|
||||||
// holdOpen being set in a late-running effect.
|
// holdOpen being set in a late-running effect.
|
||||||
const [autoOpen, setAutoOpen] = createSignal(pending())
|
const [autoOpen, setAutoOpen] = createSignal(pending())
|
||||||
createEffect(on(pending, (isPending, wasPending) => {
|
createEffect(
|
||||||
if (isPending) {
|
on(pending, (isPending, wasPending) => {
|
||||||
setAutoOpen(true)
|
if (isPending) {
|
||||||
} else if (wasPending && !userToggled()) {
|
setAutoOpen(true)
|
||||||
const timer = setTimeout(() => setAutoOpen(false), 2000)
|
} else if (wasPending && !userToggled()) {
|
||||||
onCleanup(() => clearTimeout(timer))
|
const timer = setTimeout(() => setAutoOpen(false), 2000)
|
||||||
}
|
onCleanup(() => clearTimeout(timer))
|
||||||
}))
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
const effectiveOpen = createMemo(() => {
|
const effectiveOpen = createMemo(() => {
|
||||||
if (pending()) return true
|
if (pending()) return true
|
||||||
if (userToggled()) return userOpen()
|
if (userToggled()) return userOpen()
|
||||||
|
|
@ -164,9 +159,7 @@ export function ShellRollingResults(props: { part: ToolPart; animate?: boolean }
|
||||||
<span data-slot="shell-rolling-title">
|
<span data-slot="shell-rolling-title">
|
||||||
<TextShimmer text={i18n.t("ui.tool.shell")} active={pending()} />
|
<TextShimmer text={i18n.t("ui.tool.shell")} active={pending()} />
|
||||||
</span>
|
</span>
|
||||||
<Show when={subtitle()}>
|
<Show when={subtitle()}>{(text) => <ShellRollingSubtitle text={text()} animate={props.animate} />}</Show>
|
||||||
{(text) => <ShellRollingSubtitle text={text()} animate={props.animate} />}
|
|
||||||
</Show>
|
|
||||||
<Show when={!pending()}>
|
<Show when={!pending()}>
|
||||||
<span data-slot="shell-rolling-actions">
|
<span data-slot="shell-rolling-actions">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|
@ -196,7 +189,7 @@ export function ShellRollingResults(props: { part: ToolPart; animate?: boolean }
|
||||||
items={rows()}
|
items={rows()}
|
||||||
fixed={fixed()}
|
fixed={fixed()}
|
||||||
fixedHeight={22}
|
fixedHeight={22}
|
||||||
rows={5}
|
rows={userToggled() && userOpen() ? 10 : 5}
|
||||||
rowHeight={22}
|
rowHeight={22}
|
||||||
rowGap={0}
|
rowGap={0}
|
||||||
open={effectiveOpen()}
|
open={effectiveOpen()}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue