feat(desktop/cli): add expand_thinking config toggle and persist /verbose (#3303 #3312)#3396
Conversation
|
@esengine @SivanCola can you take a look at this I have pushed the changes for 3 issues |
dea52a7 to
035af29
Compare
esengine
left a comment
There was a problem hiding this comment.
The expand_thinking work itself looks good — config field, mutator following the SetDesktopCloseBehavior pattern, and the Message.tsx default wiring are all clean.
One thing before merge: this PR bundles three independent changes under a title that only mentions #3303:
expand_thinkingdefault toggle (#3303) — the stated change/verbosepersistence viaUI.ShowReasoning- a brand-new
/sandboxstatus command (closes #3316)
The /sandbox command (#3316) is unrelated to thinking-section display and pulls in the sandbox package + new slash command, help, and completion entries. Bundling two separately-tracked issues makes the history harder to revert and review.
Please split /sandbox (#3316) into its own PR. This one can keep #3303 plus the /verbose persistence (both about reasoning display, so they belong together). Once split, I'll merge this promptly.
|
seems like a good idea let me do it after that we can merge |
035af29 to
6388762
Compare
Also persists /verbose toggle across CLI sessions (esengine#3312). Closes esengine#3303 Closes esengine#3312
6388762 to
fa4144d
Compare
Closes #3303
Closes #3312
Problem
#3303 — Every AI response that includes reasoning shows a collapsible "thinking" section in the desktop app. It was hardcoded to collapsed —
useState(false)in Message.tsx. Users who always want to see the reasoning had to click expand every single time, on every single message.#3312 — The
/verbosetoggle (Ctrl+O) resets on every CLI session. Users who prefer seeing reasoning text must re-toggle it each time they start a chat.Solution
#3303 — Adds a
[desktop].expand_thinkingconfig option that controls the default expand/collapse state of the reasoning section. Collapsed by default (no behavior change for existing users).#3312 — Adds a
[ui].show_reasoningconfig option. The/verbosetoggle now persists across sessions by writing to config.Changes
#3303 — Desktop expand_thinking toggle
Go (config layer)
DesktopConfig.ExpandThinking— bool field with TOML tagexpand_thinking, default falseConfig.SetExpandThinking(bool)— mutator in edit.go, follows the same pattern as SetDesktopCloseBehaviorrender.go— TOML output includesexpand_thinkingwith inline commentGo (desktop bridge)
SettingsView.ExpandThinking— bool JSON field, populated from config inSettings()App.SetExpandThinking(bool)— Wails-bound method, writes viaapplyConfigOnly(no controller rebuild — display-only setting)Frontend (types + bridge)
SettingsViewin types.ts — addedexpandThinking: booleanAppBindingsin bridge.ts — addedSetExpandThinking(on: boolean): Promise<void>Frontend (UI)
AssistantMessagein Message.tsx — acceptsdefaultExpandedprop →ProcessCard defaultOpen={item.streaming || defaultExpanded}Transcript.tsx— threadsdefaultExpandThinkingthrough hot/warm/cold zones (LiveAssistantMessage,WarmZone,WarmTurnItems)App.tsx— fetches setting on startup, stores inexpandThinkingstate, passes to TranscriptSettingsPanel.tsx— two-button segmented control using<SettingsField>in General tab ("Collapsed" / "Expanded")i18n
en.ts— "settings.expandThinking", "settings.expandThinking.expanded", "settings.expandThinking.collapsed"zh.ts— "思考过程显示", "默认展开", "默认折叠"#3312 — CLI /verbose persistence
Go (config layer)
UIConfig.ShowReasoning— bool field with TOML tagshow_reasoning, default falseConfig.SetShowReasoning(bool)— mutator in edit.gorender.go— TOML output for[ui]sectionGo (CLI)
chat_tui.go—cfg *config.Configfield,toggleVerboseReasoningnow callscfg.SetShowReasoning+cfg.Save()cli.go— initshowReasoningfrom config on startuphelp_view.go— added/verbosetobuiltinHelpItems()Config example
Behavior notes
ProcessCard defaultOpen={item.streaming || defaultExpanded}— streaming messages always open; non-streaming messages respect the setting on mountdefaultExpandThinking)Testing
go test ./internal/...— passesgo vet ./internal/...— cleangofmt -l— clean on all changed Go filesgo test -race ./internal/config/... ./internal/cli/...— clean