fix(plan): reserve minimum height for selection list in AskUserDialog (#23280)

This commit is contained in:
ruomeng
2026-03-23 14:27:08 -04:00
committed by GitHub
parent 447a854ad9
commit 5a65610fa6
3 changed files with 49 additions and 1 deletions
@@ -849,11 +849,19 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
? Math.max(1, availableHeight - overhead)
: undefined;
// Reserve space for at least 3 items if more selectionItems available.
const reservedListHeight = Math.min(selectionItems.length * 2, 6);
const questionHeightLimit =
listHeight && !isAlternateBuffer
? question.unconstrainedHeight
? Math.max(1, listHeight - selectionItems.length * 2)
: Math.min(15, Math.max(1, listHeight - DIALOG_PADDING))
: Math.min(
15,
Math.max(
1,
listHeight - Math.max(DIALOG_PADDING, reservedListHeight),
),
)
: undefined;
const maxItemsToShow =