mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
address feedback from/review frontend
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
||||
useEffect,
|
||||
useReducer,
|
||||
useContext,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { Box, Text } from 'ink';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
@@ -783,8 +782,6 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
|
||||
}
|
||||
}, [customOptionText, isCustomOptionSelected, question.multiSelect]);
|
||||
|
||||
const [actualQuestionHeight, setActualQuestionHeight] = useState(0);
|
||||
|
||||
const HEADER_HEIGHT = progressHeader ? 2 : 0;
|
||||
const TITLE_MARGIN = 1;
|
||||
const FOOTER_HEIGHT = 2; // DialogFooter + margin
|
||||
@@ -794,38 +791,19 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
|
||||
? Math.max(1, availableHeight - overhead)
|
||||
: undefined;
|
||||
|
||||
const idealOptionsHeight = selectionItems.reduce(
|
||||
(acc, item) => acc + (item.value.description ? 2 : 1),
|
||||
0,
|
||||
);
|
||||
|
||||
// Use remaining height for the question, reserving space for the options list
|
||||
const maxQuestionHeight =
|
||||
question.unconstrainedHeight && listHeight
|
||||
? Math.max(5, listHeight - Math.min(idealOptionsHeight, 10))
|
||||
: 15;
|
||||
const minListHeight = 6; // Reserve ~6 lines for options list to avoid squishing
|
||||
|
||||
const questionHeightLimit =
|
||||
listHeight && !isAlternateBuffer
|
||||
? Math.min(maxQuestionHeight, listHeight)
|
||||
? question.unconstrainedHeight
|
||||
? Math.max(1, listHeight - minListHeight)
|
||||
: Math.min(15, Math.max(1, listHeight - DIALOG_PADDING))
|
||||
: undefined;
|
||||
|
||||
let maxItemsToShow = selectionItems.length;
|
||||
if (listHeight && actualQuestionHeight) {
|
||||
const remainingHeight = Math.max(0, listHeight - actualQuestionHeight);
|
||||
let linesUsed = 0;
|
||||
let itemsThatFit = 0;
|
||||
for (const item of selectionItems) {
|
||||
const itemLines = item.value.description ? 2 : 1;
|
||||
if (linesUsed + itemLines <= remainingHeight) {
|
||||
linesUsed += itemLines;
|
||||
itemsThatFit++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
maxItemsToShow = Math.max(1, itemsThatFit);
|
||||
}
|
||||
const maxItemsToShow =
|
||||
listHeight && questionHeightLimit
|
||||
? Math.max(1, Math.floor((listHeight - questionHeightLimit) / 2))
|
||||
: selectionItems.length;
|
||||
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
@@ -835,7 +813,6 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
|
||||
maxHeight={questionHeightLimit}
|
||||
maxWidth={availableWidth}
|
||||
overflowDirection="bottom"
|
||||
onHeightChange={setActualQuestionHeight}
|
||||
>
|
||||
<Box flexDirection="column">
|
||||
<MarkdownDisplay
|
||||
|
||||
@@ -30,8 +30,6 @@ exports[`AskUserDialog > Scroll Arrows (useAlternateBuffer: false) > shows scrol
|
||||
Description 1
|
||||
2. Option 2
|
||||
Description 2
|
||||
3. Option 3
|
||||
Description 3
|
||||
▼
|
||||
|
||||
Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
|
||||
@@ -74,8 +74,7 @@ Implementation Steps
|
||||
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
|
||||
9. Implement session timeout handling in src/auth/SessionManager.ts
|
||||
... last 21 lines hidden (Ctrl+O to show) ...
|
||||
... last 22 lines hidden (Ctrl+O to show) ...
|
||||
|
||||
● 1. Yes, automatically accept edits
|
||||
Approves plan and allows tools to run automatically
|
||||
|
||||
@@ -26,7 +26,6 @@ interface MaxSizedBoxProps {
|
||||
maxHeight?: number;
|
||||
overflowDirection?: 'top' | 'bottom';
|
||||
additionalHiddenLinesCount?: number;
|
||||
onHeightChange?: (height: number) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,7 +38,6 @@ export const MaxSizedBox: React.FC<MaxSizedBoxProps> = ({
|
||||
maxHeight,
|
||||
overflowDirection = 'top',
|
||||
additionalHiddenLinesCount = 0,
|
||||
onHeightChange,
|
||||
}) => {
|
||||
const id = useId();
|
||||
const { addOverflowingId, removeOverflowingId } = useOverflowActions() || {};
|
||||
@@ -82,18 +80,6 @@ export const MaxSizedBox: React.FC<MaxSizedBoxProps> = ({
|
||||
? effectiveMaxHeight - 1
|
||||
: effectiveMaxHeight;
|
||||
|
||||
const actualHeight =
|
||||
visibleContentHeight !== undefined
|
||||
? Math.min(contentHeight, visibleContentHeight)
|
||||
: contentHeight;
|
||||
|
||||
const totalActualHeight =
|
||||
actualHeight + (isOverflowing && effectiveMaxHeight !== undefined ? 1 : 0);
|
||||
|
||||
useEffect(() => {
|
||||
onHeightChange?.(totalActualHeight);
|
||||
}, [totalActualHeight, onHeightChange]);
|
||||
|
||||
const hiddenLinesCount =
|
||||
visibleContentHeight !== undefined
|
||||
? Math.max(0, contentHeight - visibleContentHeight)
|
||||
|
||||
Reference in New Issue
Block a user