From 128dc99927c8b8261ea6d33b4d37ec1a0891ae47 Mon Sep 17 00:00:00 2001 From: "A.K.M. Adib" Date: Tue, 3 Mar 2026 17:16:12 -0500 Subject: [PATCH] fix(cli): prevent plan truncation in approval dialog by supporting unconstrained heights Fixes #20716 --- .../cli/src/ui/components/AskUserDialog.tsx | 6 ++++- .../src/ui/components/ExitPlanModeDialog.tsx | 1 + .../ExitPlanModeDialog.test.tsx.snap | 24 ++++--------------- packages/core/src/confirmation-bus/types.ts | 2 ++ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/packages/cli/src/ui/components/AskUserDialog.tsx b/packages/cli/src/ui/components/AskUserDialog.tsx index 9606513510..3201ac394d 100644 --- a/packages/cli/src/ui/components/AskUserDialog.tsx +++ b/packages/cli/src/ui/components/AskUserDialog.tsx @@ -789,9 +789,13 @@ const ChoiceQuestionView: React.FC = ({ const listHeight = availableHeight ? Math.max(1, availableHeight - overhead) : undefined; + const maxQuestionHeight = + question.unconstrainedHeight && listHeight + ? Math.max(1, listHeight - DIALOG_PADDING - selectionItems.length * 2) + : 15; const questionHeight = listHeight && !isAlternateBuffer - ? Math.min(15, Math.max(1, listHeight - DIALOG_PADDING)) + ? Math.min(maxQuestionHeight, Math.max(1, listHeight - DIALOG_PADDING)) : undefined; const maxItemsToShow = listHeight && questionHeight diff --git a/packages/cli/src/ui/components/ExitPlanModeDialog.tsx b/packages/cli/src/ui/components/ExitPlanModeDialog.tsx index 39e1b8a155..677bc479be 100644 --- a/packages/cli/src/ui/components/ExitPlanModeDialog.tsx +++ b/packages/cli/src/ui/components/ExitPlanModeDialog.tsx @@ -247,6 +247,7 @@ export const ExitPlanModeDialog: React.FC = ({ ], placeholder: 'Type your feedback...', multiSelect: false, + unconstrainedHeight: true, }, ]} onSubmit={(answers) => { diff --git a/packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap index 073c106ceb..54884fecdd 100644 --- a/packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap @@ -11,11 +11,7 @@ Implementation Steps 2. Add session storage in src/storage/SessionStore.ts 3. Update src/commands/index.ts to check auth status 4. Add tests in src/auth/__tests__/ - -Files to Modify - - - src/index.ts - Add auth middleware - - src/config.ts - Add auth configuration options +... last 5 lines hidden (Ctrl+O to show) ... 1. Yes, automatically accept edits Approves plan and allows tools to run automatically @@ -38,11 +34,7 @@ Implementation Steps 2. Add session storage in src/storage/SessionStore.ts 3. Update src/commands/index.ts to check auth status 4. Add tests in src/auth/__tests__/ - -Files to Modify - - - src/index.ts - Add auth middleware - - src/config.ts - Add auth configuration options +... last 5 lines hidden (Ctrl+O to show) ... ● 1. Yes, automatically accept edits Approves plan and allows tools to run automatically @@ -70,11 +62,7 @@ Implementation Steps 2. Add session storage in src/storage/SessionStore.ts 3. Update src/commands/index.ts to check auth status 4. Add OAuth2 provider support in src/auth/providers/OAuth2Provider.ts - 5. Add SAML provider support in src/auth/providers/SAMLProvider.ts - 6. Add LDAP provider support in src/auth/providers/LDAPProvider.ts - 7. Create token refresh mechanism in src/auth/TokenManager.ts - 8. Add multi-factor authentication in src/auth/MFAService.ts -... last 22 lines hidden (Ctrl+O to show) ... +... last 26 lines hidden (Ctrl+O to show) ... ● 1. Yes, automatically accept edits Approves plan and allows tools to run automatically @@ -97,11 +85,7 @@ Implementation Steps 2. Add session storage in src/storage/SessionStore.ts 3. Update src/commands/index.ts to check auth status 4. Add tests in src/auth/__tests__/ - -Files to Modify - - - src/index.ts - Add auth middleware - - src/config.ts - Add auth configuration options +... last 5 lines hidden (Ctrl+O to show) ... ● 1. Yes, automatically accept edits Approves plan and allows tools to run automatically diff --git a/packages/core/src/confirmation-bus/types.ts b/packages/core/src/confirmation-bus/types.ts index aefafe0fa0..544571913c 100644 --- a/packages/core/src/confirmation-bus/types.ts +++ b/packages/core/src/confirmation-bus/types.ts @@ -162,6 +162,8 @@ export interface Question { multiSelect?: boolean; /** Placeholder hint text. For type='text', shown in the input field. For type='choice', shown in the "Other" custom input. */ placeholder?: string; + /** Allow the question to consume more vertical space instead of being strictly capped. */ + unconstrainedHeight?: boolean; } export interface AskUserRequest {