fix(tui): restore showDetails check removed in Permission rework (#7285)

This commit is contained in:
ryanwyler
2026-01-08 13:30:41 -07:00
committed by GitHub
parent 72062d22a0
commit eacf3ad361

View File

@@ -1303,8 +1303,16 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess
// Pending messages moved to individual tool pending functions
function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMessage }) {
const ctx = use()
const sync = useSync()
// Hide tool if showDetails is false and tool completed successfully
const shouldHide = createMemo(() => {
if (ctx.showDetails()) return false
if (props.part.state.status !== "completed") return false
return true
})
const toolprops = {
get metadata() {
return props.part.state.status === "pending" ? {} : (props.part.state.metadata ?? {})
@@ -1329,6 +1337,7 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
}
return (
<Show when={!shouldHide()}>
<Switch>
<Match when={props.part.tool === "bash"}>
<Bash {...toolprops} />
@@ -1376,6 +1385,7 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
<GenericTool {...toolprops} />
</Match>
</Switch>
</Show>
)
}