Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
128dc99
fix(cli): prevent plan truncation in approval dialog by supporting un…
Adib234 Mar 3, 2026
36b06f7
address bot comment
Adib234 Mar 4, 2026
0f88ddb
address bot comments
Adib234 Mar 4, 2026
ec2d0a8
update to height based on all available height module fix overflow
Adib234 Mar 5, 2026
e5d9719
update snapshot
Adib234 Mar 5, 2026
c397c72
fix
Adib234 Mar 5, 2026
633ef48
update snapshot
Adib234 Mar 5, 2026
05b50f4
update snapshots
Adib234 Mar 5, 2026
f5c0253
plz work
Adib234 Mar 5, 2026
7490f28
update snapshots
Adib234 Mar 6, 2026
d879da6
test: update snapshots for AskUserDialog and ExitPlanModeDialog
Adib234 Mar 6, 2026
8cfc314
revert file change
Adib234 Mar 6, 2026
55cc847
use question.unconstrainedHeight again
Adib234 Mar 6, 2026
0a6fb84
prevent radio button area from getting truncated
Adib234 Mar 6, 2026
53a3fc9
address feedback from/review frontend
Adib234 Mar 6, 2026
5f0464d
make sure usually at most 1 line of history is present above plan con…
Adib234 Mar 7, 2026
c387024
make sure exit plan dialog takes up available height only when there'…
Adib234 Mar 9, 2026
e37954a
test: fix variable name in comment
jacob314 Mar 9, 2026
4216232
update minListHeight
Adib234 Mar 10, 2026
bd7aa56
remove changes to uiAvailableHeight
Adib234 Mar 10, 2026
a27a134
remove changes to uiAvailableHeight
Adib234 Mar 10, 2026
457ca8e
add unconstrainedHeight as false to exit plan mode dialog
Adib234 Mar 10, 2026
0aab89e
Merge branch 'main' into fix/askuserdialog-height
jacob314 Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions packages/cli/src/ui/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1389,11 +1389,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
// Compute available terminal height based on controls measurement
const availableTerminalHeight = Math.max(
0,
terminalHeight -
controlsHeight -
staticExtraHeight -
2 -
backgroundShellHeight,
terminalHeight - controlsHeight - backgroundShellHeight - 1,
);

config.setShellExecutionConfig({
Expand Down
15 changes: 10 additions & 5 deletions packages/cli/src/ui/components/AskUserDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -807,24 +807,29 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
const TITLE_MARGIN = 1;
const FOOTER_HEIGHT = 2; // DialogFooter + margin
const overhead = HEADER_HEIGHT + TITLE_MARGIN + FOOTER_HEIGHT;

const listHeight = availableHeight
? Math.max(1, availableHeight - overhead)
: undefined;
const questionHeight =

const questionHeightLimit =
listHeight && !isAlternateBuffer
? Math.min(15, Math.max(1, listHeight - DIALOG_PADDING))
? question.unconstrainedHeight
? Math.max(1, listHeight - selectionItems.length * 2)
: Math.min(15, Math.max(1, listHeight - DIALOG_PADDING))
: undefined;

const maxItemsToShow =
listHeight && questionHeight
? Math.max(1, Math.floor((listHeight - questionHeight) / 2))
listHeight && questionHeightLimit
? Math.max(1, Math.floor((listHeight - questionHeightLimit) / 2))
: selectionItems.length;

return (
<Box flexDirection="column">
{progressHeader}
<Box marginBottom={TITLE_MARGIN}>
<MaxSizedBox
maxHeight={questionHeight}
maxHeight={questionHeightLimit}
maxWidth={availableWidth}
overflowDirection="bottom"
>
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/ui/components/ExitPlanModeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export const ExitPlanModeDialog: React.FC<ExitPlanModeDialogProps> = ({
],
placeholder: 'Type your feedback...',
multiSelect: false,
unconstrainedHeight: false,
},
]}
onSubmit={(answers) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ 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 questionHeight = availableHeight - overhead - DIALOG_PADDING.
// listHeight = 15 - overhead (Header:0, Margin:1, Footer:2) = 12.
// maxQuestionHeight = listHeight - 4 = 8.
// 8 lines is enough for the 6-line question.
await waitFor(() => {
expect(lastFrame()).toContain('Line 6');
expect(lastFrame()).not.toContain('lines hidden');
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/confirmation-bus/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,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 {
Expand Down
Loading