refactor(cli): unify shell confirmation dialogs (#16828)

This commit is contained in:
N. Taylor Mullen
2026-01-16 15:06:52 -08:00
committed by GitHub
parent 608da23393
commit 1681ae1842
14 changed files with 102 additions and 446 deletions
@@ -11,7 +11,6 @@ import { Text } from 'ink';
import { type UIState } from '../contexts/UIStateContext.js';
import { type RestartReason } from '../hooks/useIdeTrustListener.js';
import { type IdeInfo } from '@google/gemini-cli-core';
import { type ShellConfirmationRequest } from '../types.js';
// Mock child components
vi.mock('../IdeIntegrationNudge.js', () => ({
@@ -23,9 +22,6 @@ vi.mock('./LoopDetectionConfirmation.js', () => ({
vi.mock('./FolderTrustDialog.js', () => ({
FolderTrustDialog: () => <Text>FolderTrustDialog</Text>,
}));
vi.mock('./ShellConfirmationDialog.js', () => ({
ShellConfirmationDialog: () => <Text>ShellConfirmationDialog</Text>,
}));
vi.mock('./ConsentPrompt.js', () => ({
ConsentPrompt: () => <Text>ConsentPrompt</Text>,
}));
@@ -79,7 +75,6 @@ describe('DialogManager', () => {
proQuotaRequest: null,
shouldShowIdePrompt: false,
isFolderTrustDialogOpen: false,
shellConfirmationRequest: null,
loopDetectionConfirmationRequest: null,
confirmationRequest: null,
isThemeDialogOpen: false,
@@ -130,15 +125,6 @@ describe('DialogManager', () => {
'IdeIntegrationNudge',
],
[{ isFolderTrustDialogOpen: true }, 'FolderTrustDialog'],
[
{
shellConfirmationRequest: {
commands: [],
onConfirm: vi.fn(),
} as unknown as ShellConfirmationRequest,
},
'ShellConfirmationDialog',
],
[
{ loopDetectionConfirmationRequest: { onComplete: vi.fn() } },
'LoopDetectionConfirmation',