diff --git a/packages/cli/src/ui/components/AskUserDialog.tsx b/packages/cli/src/ui/components/AskUserDialog.tsx index d81cbca09c..b5651f79bb 100644 --- a/packages/cli/src/ui/components/AskUserDialog.tsx +++ b/packages/cli/src/ui/components/AskUserDialog.tsx @@ -795,7 +795,7 @@ const ChoiceQuestionView: React.FC = ({ // 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)) + Math.max(5, 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 26d3baeca6..adf631bfff 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 allocates maxQuestionHeight = floor(15 * 0.7) = 10. + // AskUserDialog allocates questionHeight = Math.min(maxQuestionHeight, Math.max(5, listHeight - DIALOG_PADDING)). + // maxQuestionHeight = floor(15 * 0.7) = 10. // 10 lines is enough for the 6-line question + padding. await waitFor(() => { expect(lastFrame()).toContain('Line 6');