feat(cli): enhance tool confirmation UI and selection layout (#24376)

This commit is contained in:
Gal Zahavi
2026-04-03 18:32:35 -07:00
committed by GitHub
parent 21a3925f99
commit 7311e242ec
24 changed files with 2435 additions and 1953 deletions
@@ -70,7 +70,7 @@ describe('ToolConfirmationQueue', () => {
const confirmingTool = {
tool: {
callId: 'call-1',
name: 'ls',
name: 'run_shell_command',
description: 'list files',
status: CoreToolCallStatus.AwaitingApproval,
confirmationDetails: {
@@ -98,15 +98,12 @@ describe('ToolConfirmationQueue', () => {
);
const output = lastFrame();
expect(output).toContain('Action Required');
expect(output).toContain('1 of 3');
expect(output).toContain('ls'); // Tool name
expect(output).toContain('list files'); // Tool description
expect(output).toContain("Allow execution of: 'ls'?");
expect(output).toContain('Allow execution of [ls]?');
expect(output).toMatchSnapshot();
const stickyHeaderProps = vi.mocked(StickyHeader).mock.calls[0][0];
expect(stickyHeaderProps.borderColor).toBe(theme.status.warning);
unmount();
});
@@ -183,7 +180,7 @@ describe('ToolConfirmationQueue', () => {
// availableContentHeight = Math.max(9 - 6, 4) = 4
// MaxSizedBox in ToolConfirmationMessage will use 4
// It should show truncation message
await waitFor(() => expect(lastFrame()).toContain('49 hidden (Ctrl+O)'));
await waitFor(() => expect(lastFrame()).toContain('48 hidden (Ctrl+O)'));
expect(lastFrame()).toMatchSnapshot();
unmount();
});