fix(tui): hide reasoning panels immediately

Make /reasoning hide update the thinking section visibility so existing and live reasoning blocks disappear without waiting for config sync.
This commit is contained in:
Brooklyn Nicholson 2026-04-29 15:23:14 -05:00
parent 456955c2e4
commit d8afafd22b
5 changed files with 78 additions and 2 deletions

View file

@ -332,7 +332,29 @@ export const sessionCommands: SlashCommand[] = [
ctx.gateway
.rpc<ConfigSetResponse>('config.set', { key: 'reasoning', session_id: ctx.sid, value: arg })
.then(ctx.guarded<ConfigSetResponse>(r => r.value && ctx.transcript.sys(`reasoning: ${r.value}`)))
.then(
ctx.guarded<ConfigSetResponse>(r => {
if (!r.value) {
return
}
if (r.value === 'hide') {
patchUiState(state => ({
...state,
sections: { ...state.sections, thinking: 'hidden' },
showReasoning: false
}))
} else if (r.value === 'show') {
patchUiState(state => ({
...state,
sections: { ...state.sections, thinking: 'expanded' },
showReasoning: true
}))
}
ctx.transcript.sys(`reasoning: ${r.value}`)
})
)
}
},

View file

@ -711,6 +711,7 @@ export function useMainApp(gw: GatewayClient) {
const anyPanelVisible = SECTION_NAMES.some(
s => sectionMode(s, ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden'
)
const thinkingPanelVisible = sectionMode('thinking', ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden'
const showProgressArea = useTurnSelector(state =>
anyPanelVisible
@ -723,7 +724,7 @@ export function useMainApp(gw: GatewayClient) {
state.tools.length ||
state.todos.length ||
state.turnTrail.length ||
hasReasoning ||
(thinkingPanelVisible && hasReasoning) ||
state.activity.length
)
: state.activity.some(item => item.tone !== 'info')