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
@@ -66,6 +66,33 @@ describe('ToolConfirmationMessage', () => {
expect(lastFrame()).toMatchSnapshot();
});
it('should display multiple commands for exec type when provided', () => {
const confirmationDetails: ToolCallConfirmationDetails = {
type: 'exec',
title: 'Confirm Multiple Commands',
command: 'echo "hello"', // Primary command
rootCommand: 'echo',
rootCommands: ['echo'],
commands: ['echo "hello"', 'ls -la', 'whoami'], // Multi-command list
onConfirm: vi.fn(),
};
const { lastFrame } = renderWithProviders(
<ToolConfirmationMessage
confirmationDetails={confirmationDetails}
config={mockConfig}
availableTerminalHeight={30}
terminalWidth={80}
/>,
);
const output = lastFrame();
expect(output).toContain('echo "hello"');
expect(output).toContain('ls -la');
expect(output).toContain('whoami');
expect(output).toMatchSnapshot();
});
describe('with folder trust', () => {
const editConfirmationDetails: ToolCallConfirmationDetails = {
type: 'edit',