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 <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
Ariane Emory 2025-11-28 16:01:05 -05:00 committed by GitHub
parent b6efca42b4
commit 33c63be980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -239,7 +239,7 @@ export function Autocomplete(props: {
},
{
display: "/thinking",
description: "toggle thinking blocks",
description: "toggle thinking visibility",
onSelect: () => command.trigger("session.toggle.thinking"),
},
)

View file

@ -111,7 +111,7 @@ export function Session() {
const dimensions = useTerminalDimensions()
const [sidebar, setSidebar] = createSignal<"show" | "hide" | "auto">(kv.get("sidebar", "auto"))
const [conceal, setConceal] = createSignal(true)
const [showThinking, setShowThinking] = createSignal(true)
const [showThinking, setShowThinking] = createSignal(kv.get("thinking_visibility", true))
const [showTimestamps, setShowTimestamps] = createSignal(kv.get("timestamps", "hide") === "show")
const wide = createMemo(() => dimensions().width > 120)
@ -430,11 +430,15 @@ export function Session() {
},
},
{
title: "Toggle thinking blocks",
title: showThinking() ? "Hide thinking" : "Show thinking",
value: "session.toggle.thinking",
category: "Session",
onSelect: (dialog) => {
setShowThinking((prev) => !prev)
setShowThinking((prev) => {
const next = !prev
kv.set("thinking_visibility", next)
return next
})
dialog.clear()
},
},