fix(cli): prevent suppression of history items during tool confirmation

Updates the history item suppression logic in MainContent to ensure that
intermediate turns and narration text remain visible while a tool
confirmation (like ask_user) is active. This prevents items from
unexpectedly disappearing from the UI during interactive tool execution.

- Modified MainContent.tsx to skip suppression when showConfirmationQueue is true.
- Updated MainContent.test.tsx with a default mock for useConfirmingTool.
This commit is contained in:
Jarrod Whelan
2026-04-07 12:52:58 -07:00
parent ab3075feb9
commit 75adad8018
2 changed files with 9 additions and 4 deletions
@@ -66,7 +66,7 @@ vi.mock('../hooks/useAlternateBuffer.js', () => ({
}));
vi.mock('../hooks/useConfirmingTool.js', () => ({
useConfirmingTool: vi.fn(),
useConfirmingTool: vi.fn(() => null),
}));
vi.mock('./AppHeader.js', () => ({
@@ -123,20 +123,25 @@ export const MainContent = () => {
// Rule 2: Suppress text in intermediate turns (turns containing non-topic
// tools) to hide mechanical narration.
if (turnIsIntermediate) {
if (turnIsIntermediate && !showConfirmationQueue) {
flags[i] = true;
}
// Rule 3: Suppress text that precedes a topic tool in the same turn,
// as the topic tool "replaces" it.
if (hasTopicToolInTurn) {
if (hasTopicToolInTurn && !showConfirmationQueue) {
flags[i] = true;
}
}
}
}
return flags;
}, [uiState.history, pendingHistoryItems, topicUpdateNarrationEnabled]);
}, [
uiState.history,
pendingHistoryItems,
topicUpdateNarrationEnabled,
showConfirmationQueue,
]);
const augmentedHistory = useMemo(
() =>