fix(portal-admin): html/body overflow-y hidden as a shell shield #176
Reference in New Issue
Block a user
Delete Branch "fix/admin-shell-overflow-shield"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tiny follow-up to #175 — the bar / donut / stacked-bar charts on the audit-log Charts tab still surfaced a phantom body scrollbar plus an empty band below the footer in some viewport widths. The lib-side overflow constraints from #175 hold for the cases tested, but the symptom can re-appear from any future layout escape (a wider downstream component, a third-party iframe, an unforeseen flex bug).
This PR adds a
html, body { overflow-y: hidden }shield at the global stylesheet so any vertical overflow at the document level — wherever it comes from — stops at the shell boundary instead of producing a phantom scrollbar. Element-level scrolling on<main>(the only surface that should scroll) is unaffected.What lands
apps/portal-admin/src/styles.css:That's the whole change. The admin shell already commits to the "fills the viewport, never scrolls the body" layout —
<app-root>is locked atheight: 100vhand<main>owns its ownoverflow-y: auto. Anything that escapes that contract is, by design, a bug to fix at the source. The shield is a safety net, not a load-bearing layout rule.Notes for the reviewer
portal-shell's app.scss carries the exact sameheight: 100vh+<main> overflow-y: autoshape, so the same shield would make sense there too. Holding it back to a separate PR because portal-shell hasn't actually demonstrated the symptom and the audit-log chantier is the immediate motivation — a one-line shield to the public-facing app deserves its own minute of consideration. Trivial to extend if/when we want symmetry.height: 100vhand let the document scroll naturally? The admin shell deliberately keeps the header, sidebar, and footer pinned while only the content area scrolls — that's a deliberate UX choice for a dense admin surface (long audit-log tables, future CMS editors), not an accident. Keeping the 100vh contract and adding the shield preserves the intent.<main>. Post-shield, the body scrollbar is gone;<main>'s internal scrollbar still works for the table page below the fold.Test plan
pnpm nx build portal-admin— clean.pnpm nx test portal-admin— 62 specs pass (no behavioural change).pnpm nx lint portal-admin— same three pre-existing warnings, no new ones.pnpm nx serve portal-admin, sign in withPortal.Admin:/admin/audit, switch to Charts — no body scrollbar, no gap under the footer, charts still render at the column width.(max-width: 800px)breakpoint — body still doesn't scroll;<main>still does where it should.<main>scrolls internally as expected; the shield does not prevent legitimate content scrolling.What's next
apps/portal-shell/src/styles.cssif/when a layout escape shows up there. Tracked indocs/decisions/0020-portal-admin-app.mdfollow-ups.