fix: keep impersonation banner inside viewport layout#19
Merged
Conversation
The portal and admin shells both rendered the banner as a sibling of a layout container that had min-height: 100vh. With the banner present, the document height became banner + 100vh, which forced a body scrollbar even on otherwise short pages. Wrap the banner and the flex layout in a .layout-shell that owns the min-height: 100vh, and let the layout container flex-fill the remaining space. No change to the banner's visual appearance or to the sidebar / sticky header behaviour. Closes #18
rubenhensen
approved these changes
Apr 23, 2026
Contributor
Author
|
Dobby sees the approval on PR #19! Dobby is most grateful and will check the PR state and merge readiness right away! 🧦 |
Contributor
Author
|
Checked in on PR #19 after the approval: all CI checks passed (Svelte Check, Tests, Builds, Migration Safety) and the PR has already been merged to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When an admin is impersonating an organisation, the orange impersonation banner sits above the portal / admin shell. Both shells use
min-height: 100vhon their flex container, so the document becomesbanner + 100vhtall and a scrollbar appears on every page — even short ones.src/routes/(portal)/+layout.svelteandsrc/routes/(admin)/+layout.svelteboth had the same pattern:Fix
Wrap the banner and the flex container in a
.layout-shellthat owns themin-height: 100vh, and let the inner flex container take the remaining space withflex: 1; min-height: 0.Same structural change for the admin shell (
.admin-layout).The banner's colours, copy, and sticky-sidebar / sticky-header behaviour are all unchanged.
Why this works
.layout-shellstays at exactly100vh— one flex child takes it all..layout-shellstill stays at100vhand the shell splits that betweenbanner-heightandportal-height. Document height does not exceed the viewport, so no scrollbar appears on short pages.100vh(that ismin-height, notheight) and normal scrolling works as before.Verification
npx svelte-check— 0 errors, 0 warningsvitest run— 26/26 unit tests passvite build— clean buildReviewer quickstart
Then log in as an admin, impersonate an organisation, and confirm the portal pages no longer scroll when content fits within the viewport.
Closes #18