Skip to content

Commit 33c63be

Browse files
ariane-emoryactions-useropencode-agent[bot]rekram1-node
authored
feat: persist thinking blocks display to KV and indicate its current display state in the command_list (resolves #4582) (#4810)
Co-authored-by: GitHub Action <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
1 parent b6efca4 commit 33c63be

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export function Autocomplete(props: {
239239
},
240240
{
241241
display: "/thinking",
242-
description: "toggle thinking blocks",
242+
description: "toggle thinking visibility",
243243
onSelect: () => command.trigger("session.toggle.thinking"),
244244
},
245245
)

‎packages/opencode/src/cli/cmd/tui/routes/session/index.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function Session() {
111111
const dimensions = useTerminalDimensions()
112112
const [sidebar, setSidebar] = createSignal<"show" | "hide" | "auto">(kv.get("sidebar", "auto"))
113113
const [conceal, setConceal] = createSignal(true)
114-
const [showThinking, setShowThinking] = createSignal(true)
114+
const [showThinking, setShowThinking] = createSignal(kv.get("thinking_visibility", true))
115115
const [showTimestamps, setShowTimestamps] = createSignal(kv.get("timestamps", "hide") === "show")
116116

117117
const wide = createMemo(() => dimensions().width > 120)
@@ -430,11 +430,15 @@ export function Session() {
430430
},
431431
},
432432
{
433-
title: "Toggle thinking blocks",
433+
title: showThinking() ? "Hide thinking" : "Show thinking",
434434
value: "session.toggle.thinking",
435435
category: "Session",
436436
onSelect: (dialog) => {
437-
setShowThinking((prev) => !prev)
437+
setShowThinking((prev) => {
438+
const next = !prev
439+
kv.set("thinking_visibility", next)
440+
return next
441+
})
438442
dialog.clear()
439443
},
440444
},

0 commit comments

Comments
 (0)