Skip to content

Commit ca0db7e

Browse files
gemini-cli-robotAdib234jacob314
authored
fix(patch): cherry-pick e5615f4 to release/v0.33.0-preview.12-pr-21037 to patch version v0.33.0-preview.12 and create version 0.33.0-preview.13 (#21922)
Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com> Co-authored-by: jacob314 <jacob314@gmail.com>
1 parent 524a84b commit ca0db7e

5 files changed

Lines changed: 18 additions & 11 deletions

File tree

packages/cli/src/ui/AppContainer.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,11 +1382,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
13821382
// Compute available terminal height based on controls measurement
13831383
const availableTerminalHeight = Math.max(
13841384
0,
1385-
terminalHeight -
1386-
controlsHeight -
1387-
staticExtraHeight -
1388-
2 -
1389-
backgroundShellHeight,
1385+
terminalHeight - controlsHeight - backgroundShellHeight - 1,
13901386
);
13911387

13921388
config.setShellExecutionConfig({

packages/cli/src/ui/components/AskUserDialog.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,24 +786,29 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
786786
const TITLE_MARGIN = 1;
787787
const FOOTER_HEIGHT = 2; // DialogFooter + margin
788788
const overhead = HEADER_HEIGHT + TITLE_MARGIN + FOOTER_HEIGHT;
789+
789790
const listHeight = availableHeight
790791
? Math.max(1, availableHeight - overhead)
791792
: undefined;
792-
const questionHeight =
793+
794+
const questionHeightLimit =
793795
listHeight && !isAlternateBuffer
794-
? Math.min(15, Math.max(1, listHeight - DIALOG_PADDING))
796+
? question.unconstrainedHeight
797+
? Math.max(1, listHeight - selectionItems.length * 2)
798+
: Math.min(15, Math.max(1, listHeight - DIALOG_PADDING))
795799
: undefined;
800+
796801
const maxItemsToShow =
797-
listHeight && questionHeight
798-
? Math.max(1, Math.floor((listHeight - questionHeight) / 2))
802+
listHeight && questionHeightLimit
803+
? Math.max(1, Math.floor((listHeight - questionHeightLimit) / 2))
799804
: selectionItems.length;
800805

801806
return (
802807
<Box flexDirection="column">
803808
{progressHeader}
804809
<Box marginBottom={TITLE_MARGIN}>
805810
<MaxSizedBox
806-
maxHeight={questionHeight}
811+
maxHeight={questionHeightLimit}
807812
maxWidth={availableWidth}
808813
overflowDirection="bottom"
809814
>

packages/cli/src/ui/components/ExitPlanModeDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ export const ExitPlanModeDialog: React.FC<ExitPlanModeDialogProps> = ({
247247
],
248248
placeholder: 'Type your feedback...',
249249
multiSelect: false,
250+
unconstrainedHeight: false,
250251
},
251252
]}
252253
onSubmit={(answers) => {

packages/cli/src/ui/components/ToolConfirmationQueue.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ describe('ToolConfirmationQueue', () => {
282282
// hideToolIdentity is true for ask_user -> subtracts 4 instead of 6
283283
// availableContentHeight = 19 - 4 = 15
284284
// ToolConfirmationMessage handlesOwnUI=true -> returns full 15
285-
// AskUserDialog uses 15 lines to render its multi-line question and options.
285+
// AskUserDialog allocates questionHeight = availableHeight - overhead - DIALOG_PADDING.
286+
// listHeight = 15 - overhead (Header:0, Margin:1, Footer:2) = 12.
287+
// maxQuestionHeight = listHeight - 4 = 8.
288+
// 8 lines is enough for the 6-line question.
286289
await waitFor(() => {
287290
expect(lastFrame()).toContain('Line 6');
288291
expect(lastFrame()).not.toContain('lines hidden');

packages/core/src/confirmation-bus/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ export interface Question {
162162
multiSelect?: boolean;
163163
/** Placeholder hint text. For type='text', shown in the input field. For type='choice', shown in the "Other" custom input. */
164164
placeholder?: string;
165+
/** Allow the question to consume more vertical space instead of being strictly capped. */
166+
unconstrainedHeight?: boolean;
165167
}
166168

167169
export interface AskUserRequest {

0 commit comments

Comments
 (0)