Conversation
PageContainer's sx lands on its outer Box, and the Container between that and the children emits no display and no height, so the list's flex: 1 had nothing to size against: the page stacked from the top instead of filling. contentSx is the prop for that half. The regression test waits for the loaded state first — the loading branch is a different PageContainer, and asserting synchronously measures that one instead. Closes #298 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (fix/glossary-fill-height) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
ReviewSmall, well-scoped fix — verified against Correctness
Test coverage
Scope
Security / performance
Overall: looks correct, consistent with existing conventions, and has a regression test that actually would have caught the bug (per the before/after repro in the description). No blocking issues. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #348 +/- ##
=======================================
Coverage 86.78% 86.78%
=======================================
Files 221 221
Lines 6205 6205
Branches 1879 1879
=======================================
Hits 5385 5385
Misses 820 820
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Closes #298.The bug
PageContainerputssxon its outerBox, then renders aContainerbetween that and the children. TheContaineremits nodisplayand noheight, so a child relying onflex: 1has a block-level parent and is inert. Glossary's term list is exactly that child (sx={{ flex: 1, minHeight: 0 }}atGlossary.tsx:155), so the page stacked from the top instead of filling.Reproduced before fixing:
and after:
The fix
One prop —
contentSx, whichPageContaineralready applies to theContainer. The issue offered two options; its "with Glossary's MUI port" branch is the applicable one now that Tailwind is gone, socontentSxrather thancontentClassName(which no longer exists — it was removed in #346 as dead API).The test, and a trap worth recording
Glossary.test.tsxgains one test, confirmed to fail without the prop.Writing it caught me out twice, both worth knowing for this suite:
PageContainer— one withalignItems: centerand nocontentSx. Its terms arrive from an async supabase mock, so a synchronous assertion measures the loading tree and seesdisplay: blockon the middle element. The test waits for a term first.getComputedStyle(...).minHeightreturns'0', not'0px', so the assertion parses it.Scope
Long-standing, and predates the migration — the pre-MUI
ui/page-container.tsxhad the same plain inner div, as the issue notes.TestResultReviewis the only other caller that needs this, and it already passescontentSx.Full suite: 203 files / 3849 tests. Typecheck 152. Lint clean.
Closes #298