refactor(core): remove shell description input (#32823)

This commit is contained in:
Aiden Cline 2026-06-22 21:18:06 -05:00 committed by GitHub
commit d29f5eba92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 124 additions and 161 deletions

View file

@ -1,4 +1,4 @@
import { createEffect, For, Match, on, onCleanup, onMount, Show, Switch, type JSX } from "solid-js"
import { createEffect, For, Match, on, onCleanup, onMount, Show, Switch, type Accessor, type JSX } from "solid-js"
import { animate, type AnimationPlaybackControls } from "motion"
import { useI18n } from "../context/i18n"
import { createStore } from "solid-js/store"
@ -24,7 +24,7 @@ const isTriggerTitle = (val: any): val is TriggerTitle => {
export interface BasicToolProps {
icon: IconProps["name"]
trigger: TriggerTitle | JSX.Element
trigger: TriggerTitle | JSX.Element | ((open: Accessor<boolean>) => JSX.Element)
children?: JSX.Element
status?: string
hideDetails?: boolean
@ -89,6 +89,7 @@ export function BasicTool(props: BasicToolProps) {
const ready = () => state.ready
const pending = () => props.status === "pending" || props.status === "running"
const hasChildren = () => (props.defer ? "children" in props : props.children)
const dynamicTrigger = typeof props.trigger === "function" ? props.trigger(open) : undefined
let cancelReady: (() => void) | undefined
@ -187,6 +188,7 @@ export function BasicTool(props: BasicToolProps) {
<div data-slot="basic-tool-tool-trigger-content">
<div data-slot="basic-tool-tool-info">
<Switch>
<Match when={dynamicTrigger !== undefined}>{dynamicTrigger}</Match>
<Match when={isTriggerTitle(props.trigger) && props.trigger}>
{(title) => (
<div data-slot="basic-tool-tool-info-structured">

View file

@ -422,7 +422,7 @@ export function getToolInfo(
return {
icon: "console",
title: i18n.t("ui.tool.shell"),
subtitle: input.description,
subtitle: input.command,
}
case "edit":
return {
@ -1905,18 +1905,18 @@ ToolRegistry.register({
<BasicTool
{...props}
icon="console"
trigger={
trigger={(open) => (
<div data-slot="basic-tool-tool-info-structured">
<div data-slot="basic-tool-tool-info-main">
<span data-slot="basic-tool-tool-title">
<TextShimmer text={i18n.t("ui.tool.shell")} active={pending()} />
</span>
<Show when={!pending() && props.input.description}>
<ShellSubmessage text={props.input.description} animate={sawPending} />
<Show when={!pending() && !open() && props.input.command}>
<ShellSubmessage text={props.input.command} animate={sawPending} />
</Show>
</div>
</div>
}
)}
>
<div data-component="bash-output">
<div data-slot="bash-copy">

View file

@ -316,10 +316,10 @@ const TOOL_SAMPLES = {
},
bash: {
tool: "bash",
input: { command: "bun test --filter session", description: "Run session tests" },
input: { command: "bun test --filter session" },
output:
"bun test v1.3.14\n\n✓ session-turn.test.tsx (3 tests) 45ms\n✓ message-part.test.tsx (7 tests) 120ms\n\nTest Suites: 2 passed, 2 total\nTests: 10 passed, 10 total\nTime: 0.89s",
title: "Run session tests",
title: "bun test --filter session",
metadata: { command: "bun test --filter session" },
},
edit: {