diff --git a/web/CarouselPicker.tsx b/web/CarouselPicker.tsx index e5881d0..aca0075 100644 --- a/web/CarouselPicker.tsx +++ b/web/CarouselPicker.tsx @@ -70,7 +70,19 @@ export const CarouselPicker = ({ return ( !next && onClose()}> - + {/* + Bounded, and the list scrolls inside it. + + `max-h-[80svh]` on the dialog and `min-h-0 overflow-y-auto` on the list. Both are needed: a + flex child will not shrink below its content without `min-h-0`, so the list pushes the dialog + taller than the screen and the overflow never engages — which is what happened here. There are + twenty-odd carousels now and the list ran off the bottom of the window with no way to reach the + end of it. + + `svh` rather than `vh` because on a phone `vh` is the viewport with the browser chrome hidden, + so a dialog sized in it is taller than what you can actually see. + */} + Choose a carousel @@ -92,7 +104,7 @@ export const CarouselPicker = ({

)} -
+
{carousels?.map((carousel) => { const count = Array.isArray(carousel.items) ? carousel.items.length : 0; const current = carousel.id === selected; diff --git a/web/sections/AddComponentDialog.tsx b/web/sections/AddComponentDialog.tsx index 893c1e2..e2ae16a 100644 --- a/web/sections/AddComponentDialog.tsx +++ b/web/sections/AddComponentDialog.tsx @@ -132,12 +132,15 @@ export const AddComponentDialog = ({ template?: boolean; }) => ( !next && onCancel()}> - + {/* Bounded and scrolling, for the same reason CarouselPicker is: the list of kinds has grown to a + dozen and would otherwise run off a short screen with no way to reach the end. `min-h-0` on the + grid is what lets it shrink and the overflow engage. */} + Add a component -
+
{/* `kind === null` is a choice that is not built yet — never a subject block, and it must not be filtered out by a list that only knows about the ones that are. */} {CHOICES.filter((choice) => template || choice.kind === null || !SUBJECT_KINDS.includes(choice.kind)).map(