mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-15 22:07:29 -07:00
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:
@@ -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(
|
||||
() =>
|
||||
|
||||
Reference in New Issue
Block a user