Skip to content

Commit 2ee9ef4

Browse files
committed
Let a page taller than the window be read
Every screen built on PageShell was cut off at the fold with no scrollbar to say so. The templates gallery is 5763px of content in a 900px viewport; the template's own reading page is 6546px, of which four of fourteen sections could be reached. Skills was doing it too, quietly, at 1376px. The two layouts that host these screens disagree about who scrolls, and PageShell answered for neither. `_app.tsx` is `h-svh overflow-hidden` and says in its own comment that panes scroll inside it, so a pane providing no scroller is simply clipped. `admin` is ordinary flow, where the document scrolls and a pane needs to do nothing. Both worked until a page got tall, and the feature that made pages tall was this one: a catalogue of twenty-seven, and a reading page that shows a stranger's prose in full rather than through a twelve-line porthole. PageShell now owns the pane scroller, which satisfies both hosts. Under `_app` it is the flex child that fills the viewport and scrolls inside it. Under `admin` nothing constrains its height, so `overflow-y-auto` never engages and the document scrolls as it always did. `min-h-0` is the load-bearing half and the easiest to drop: a flex child defaults to `min-height: auto`, refuses to shrink below its content, and hands the overflow straight back to the parent that has already hidden it. Measured on every PageShell screen rather than eyeballed on one.
1 parent f1efd52 commit 2ee9ef4

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

app/src/components/layout/page-shell.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,26 @@ export function PageShell({
5757
};
5858
}) {
5959
return (
60-
<>
60+
/*
61+
* THE PANE'S OWN SCROLLER, and without it this component cannot show a long page.
62+
*
63+
* The two layouts that host these screens disagree about who scrolls, and PageShell used to
64+
* answer for neither. `_app.tsx` is `h-svh overflow-hidden` and says so in its own comment —
65+
* "one viewport, never scrolls: panes scroll inside it" — so a pane that provides no scroller
66+
* is simply cut off at the fold, silently, with no scrollbar to suggest anything is missing.
67+
* `admin` is ordinary flow, where the document scrolls and a pane needs to do nothing.
68+
*
69+
* This satisfies both. Under `_app` it is the flex child that fills the viewport and scrolls
70+
* inside it; under `admin` nothing constrains its height, so `overflow-y-auto` never engages
71+
* and the document scrolls as before. `min-h-0` is the part that is easy to drop and is
72+
* load-bearing: a flex child defaults to `min-height: auto`, which refuses to shrink below its
73+
* content and hands the overflow back to a parent that has already hidden it.
74+
*
75+
* Measured rather than eyeballed, because this failed quietly: the templates gallery was 5763px
76+
* of content in a 900px viewport and the template reading page 6546px, with four of its fourteen
77+
* sections reachable and no scrollbar anywhere.
78+
*/
79+
<div className="flex min-h-0 flex-1 flex-col overflow-y-auto">
6180
{!!backButton && (
6281
<div className="max-w-7xl w-full h-14 flex items-center px-3">
6382
<Button
@@ -90,7 +109,7 @@ export function PageShell({
90109
</header>
91110
{children}
92111
</div>
93-
</>
112+
</div>
94113
);
95114
}
96115

0 commit comments

Comments
 (0)