diff --git a/packages/cli/src/ui/components/AskUserDialog.tsx b/packages/cli/src/ui/components/AskUserDialog.tsx index 3201ac394d..d81cbca09c 100644 --- a/packages/cli/src/ui/components/AskUserDialog.tsx +++ b/packages/cli/src/ui/components/AskUserDialog.tsx @@ -791,7 +791,11 @@ const ChoiceQuestionView: React.FC = ({ : undefined; const maxQuestionHeight = question.unconstrainedHeight && listHeight - ? Math.max(1, listHeight - DIALOG_PADDING - selectionItems.length * 2) + ? // When unconstrained, give the question a majority of the vertical space (e.g., 70%). + // The options list will take the remaining space and scroll if necessary. + // This is more robust than calculating based on `selectionItems.length`, + // which can incorrectly shrink the question if there are many options. + Math.max(1, Math.floor(listHeight * 0.7)) : 15; const questionHeight = listHeight && !isAlternateBuffer diff --git a/packages/cli/src/ui/components/ToolConfirmationQueue.test.tsx b/packages/cli/src/ui/components/ToolConfirmationQueue.test.tsx index 7b45bd0458..26d3baeca6 100644 --- a/packages/cli/src/ui/components/ToolConfirmationQueue.test.tsx +++ b/packages/cli/src/ui/components/ToolConfirmationQueue.test.tsx @@ -282,7 +282,8 @@ describe('ToolConfirmationQueue', () => { // hideToolIdentity is true for ask_user -> subtracts 4 instead of 6 // availableContentHeight = 19 - 4 = 15 // ToolConfirmationMessage handlesOwnUI=true -> returns full 15 - // AskUserDialog uses 15 lines to render its multi-line question and options. + // AskUserDialog allocates maxQuestionHeight = floor(15 * 0.7) = 10. + // 10 lines is enough for the 6-line question + padding. await waitFor(() => { expect(lastFrame()).toContain('Line 6'); expect(lastFrame()).not.toContain('lines hidden'); 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 54884fecdd..8a39f4acae 100644 --- a/packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/ExitPlanModeDialog.test.tsx.snap @@ -11,7 +11,10 @@ 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__/ -... last 5 lines hidden (Ctrl+O to show) ... + +Files to Modify + +... last 2 lines hidden (Ctrl+O to show) ... 1. Yes, automatically accept edits Approves plan and allows tools to run automatically @@ -34,7 +37,10 @@ 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__/ -... last 5 lines hidden (Ctrl+O to show) ... + +Files to Modify + +... last 2 lines hidden (Ctrl+O to show) ... ● 1. Yes, automatically accept edits Approves plan and allows tools to run automatically @@ -62,7 +68,10 @@ 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 -... last 26 lines hidden (Ctrl+O to show) ... + 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 +... last 23 lines hidden (Ctrl+O to show) ... ● 1. Yes, automatically accept edits Approves plan and allows tools to run automatically @@ -85,7 +94,10 @@ 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__/ -... last 5 lines hidden (Ctrl+O to show) ... + +Files to Modify + +... last 2 lines hidden (Ctrl+O to show) ... ● 1. Yes, automatically accept edits Approves plan and allows tools to run automatically