Fix modal height with max-height constraint
Let me look at the fuzzy-picker to see how it constrains height, and check the handoff flow widget:
The FuzzyPicker doesn't seem to enforce a specific height. Let me search for how modals constrain their dimensions:
I see customFlowDimensions: { width: 120, height: 30 } is used for limiting modal sizes. Let me look at the command-palette-wrapper to see how that's applied:
Now I understand the pattern. The command palette wrapper applies BoxConstraints.loose(width, height) to constrain the modal. But for the mysterious message modal, it's rendered directly (not through the command palette), so I need to fix the constraints in the modal itself.
Looking at the current implementation, the issue is that maxAllowedHeight = screenHeight - 4 allows it to expand to almost the full screen. I need to set a fixed max height like 20. Let me create a test program first:
I can see the modal is indeed stretching to full screen height. Now let me fix it by changing the max height from screenHeight - 4 to a fixed value like 20:
The modal is now constrained to 20 lines max height with a scrollbar visible. Let me test scrolling:
Scrolling works. Let me close and cleanup:
Now let me run the typecheck to verify everything is correct:
Let me also clean up the test file:
The fix is complete. The modal is now constrained to a maximum height of 20 lines (or less if the screen is smaller), with content scrollable when it exceeds this limit. The change was minimal - just calculating maxAllowedHeight as Math.min(fixedMaxHeight, screenHeight - 4) instead of just screenHeight - 4.