fix(tui): ignore hidden reasoning stream segments

Only keep the live progress area mounted for stream segments that can render under the current detail section visibility.
This commit is contained in:
Brooklyn Nicholson 2026-04-29 15:50:02 -05:00
parent d8afafd22b
commit f7abcb4f01

View file

@ -712,6 +712,7 @@ export function useMainApp(gw: GatewayClient) {
s => sectionMode(s, ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden' s => sectionMode(s, ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden'
) )
const thinkingPanelVisible = sectionMode('thinking', ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden' const thinkingPanelVisible = sectionMode('thinking', ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden'
const toolsPanelVisible = sectionMode('tools', ui.detailsMode, ui.sections, ui.detailsModeCommandOverride) !== 'hidden'
const showProgressArea = useTurnSelector(state => const showProgressArea = useTurnSelector(state =>
anyPanelVisible anyPanelVisible
@ -719,7 +720,16 @@ export function useMainApp(gw: GatewayClient) {
ui.busy || ui.busy ||
state.outcome || state.outcome ||
state.streamPendingTools.length || state.streamPendingTools.length ||
state.streamSegments.length || state.streamSegments.some(segment => {
const thinking = Boolean(segment.thinking?.trim())
const tools = Boolean(segment.tools?.length)
if (segment.kind === 'trail' && !segment.text) {
return (thinkingPanelVisible && thinking) || (toolsPanelVisible && tools)
}
return Boolean(segment.text?.trim()) || (thinkingPanelVisible && thinking) || (toolsPanelVisible && tools)
}) ||
state.subagents.length || state.subagents.length ||
state.tools.length || state.tools.length ||
state.todos.length || state.todos.length ||