summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorryanwyler <[email protected]>2026-01-08 13:30:41 -0700
committerGitHub <[email protected]>2026-01-08 14:30:41 -0600
commiteacf3ad3616c10a4bbf944d3b2605e3aafca17aa (patch)
tree244d7bb8393e6e550beb751213cfa0b59f135555
parent72062d22a0154306f8197285e062888c2c9197e7 (diff)
downloadopencode-eacf3ad3616c10a4bbf944d3b2605e3aafca17aa.tar.gz
opencode-eacf3ad3616c10a4bbf944d3b2605e3aafca17aa.zip
fix(tui): restore showDetails check removed in Permission rework (#7285)
-rw-r--r--packages/opencode/src/cli/cmd/tui/routes/session/index.tsx104
1 files changed, 57 insertions, 47 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
index 3c96ae997..5c34fd4ad 100644
--- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
+++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
@@ -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,53 +1337,55 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
}
return (
- <Switch>
- <Match when={props.part.tool === "bash"}>
- <Bash {...toolprops} />
- </Match>
- <Match when={props.part.tool === "glob"}>
- <Glob {...toolprops} />
- </Match>
- <Match when={props.part.tool === "read"}>
- <Read {...toolprops} />
- </Match>
- <Match when={props.part.tool === "grep"}>
- <Grep {...toolprops} />
- </Match>
- <Match when={props.part.tool === "list"}>
- <List {...toolprops} />
- </Match>
- <Match when={props.part.tool === "webfetch"}>
- <WebFetch {...toolprops} />
- </Match>
- <Match when={props.part.tool === "codesearch"}>
- <CodeSearch {...toolprops} />
- </Match>
- <Match when={props.part.tool === "websearch"}>
- <WebSearch {...toolprops} />
- </Match>
- <Match when={props.part.tool === "write"}>
- <Write {...toolprops} />
- </Match>
- <Match when={props.part.tool === "edit"}>
- <Edit {...toolprops} />
- </Match>
- <Match when={props.part.tool === "task"}>
- <Task {...toolprops} />
- </Match>
- <Match when={props.part.tool === "patch"}>
- <Patch {...toolprops} />
- </Match>
- <Match when={props.part.tool === "todowrite"}>
- <TodoWrite {...toolprops} />
- </Match>
- <Match when={props.part.tool === "question"}>
- <Question {...toolprops} />
- </Match>
- <Match when={true}>
- <GenericTool {...toolprops} />
- </Match>
- </Switch>
+ <Show when={!shouldHide()}>
+ <Switch>
+ <Match when={props.part.tool === "bash"}>
+ <Bash {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "glob"}>
+ <Glob {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "read"}>
+ <Read {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "grep"}>
+ <Grep {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "list"}>
+ <List {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "webfetch"}>
+ <WebFetch {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "codesearch"}>
+ <CodeSearch {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "websearch"}>
+ <WebSearch {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "write"}>
+ <Write {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "edit"}>
+ <Edit {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "task"}>
+ <Task {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "patch"}>
+ <Patch {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "todowrite"}>
+ <TodoWrite {...toolprops} />
+ </Match>
+ <Match when={props.part.tool === "question"}>
+ <Question {...toolprops} />
+ </Match>
+ <Match when={true}>
+ <GenericTool {...toolprops} />
+ </Match>
+ </Switch>
+ </Show>
)
}