Truncation Logic Refinement

Nucleic-Session: FE1E2C94-7945-4827-AF56-74525A9BD434
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 04:22:41 -07:00
co-authored by Nucleic
parent 9d350d4924
commit bc5b9928f8
@@ -95,6 +95,17 @@ struct AskUserQuestionCardView: View {
} }
.padding() .padding()
.glassSurface(cornerRadius: 20) .glassSurface(cornerRadius: 20)
// A hard ceiling on the whole card so it can never exceed the screen; `nil` (before the
// height is measured) leaves it unconstrained.
.frame(maxHeight: availableHeight > 0 ? availableHeight - 12 : nil, alignment: .bottom)
}
/// The height the scrolling question region may take before it starts scrolling — the screen
/// minus a reserve for the header and the button row, so those always have room. Falls back to
/// a roomy default before the height is measured.
private var middleMaxHeight: CGFloat {
let base = availableHeight > 0 ? availableHeight - 12 : 640
return max(160, base - 170)
} }
// MARK: - Wizard state // MARK: - Wizard state