Give the docs viewer a single scroll context - #21
Merged
Conversation
/docs inset the pdoc bundle in a bordered card inside a viewport-height region, then hung the Footer off the end of it. pdoc already ships two scrolling panes of its own, so that stacked a third: the window scrolled to reach the Footer, and doing so slid the whole docs card out of view. Hand the bundle the full viewport below the navbar and drop the Footer from this route, leaving only the two panes pdoc intends. Point the frame at voxkit.html directly -- index.html is a meta-refresh stub, and in a frame that hop lands in session history and swallows the first Back press. The page no longer needs client state, so it renders on the server with real metadata. Closes #15
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes #15.
The nesting
public/docsis a pdoc bundle — already a complete docs site, with a sidebarpane and a content pane that scroll independently by design. The route wrapped
it in two more scroll contexts:
The window layer was the worst of it:
<Footer>was a sibling after ah-screen overflow-hiddendiv, so the document ran a full viewport plus afooter. Scrolling to reach the footer slid the entire docs card off-screen
while the docs themselves stayed put.
The fix
Give the bundle the whole viewport under the navbar and drop the
Footerfromthis route, so the only scrollbars left are pdoc's own two. The window can no
longer scroll at all.
app/docs/page.tsx— full-bleed frame;Footerremoved.app/globals.css—bodyforcesoverflow-y: scrollsite-wide to avoidlayout shift. On a page that fits the viewport exactly there is nothing to
shift and nothing to scroll, so that renders a second, dead scrollbar beside
pdoc's real one. Added a
body:has([data-full-viewport])opt-out.Two things fixed along the way:
voxkit.htmldirectly./docs/index.htmlis only a<meta http-equiv="refresh">stub. In a frame that hop becomes a sessionhistory entry, so leaving
/docstook two Back presses — the first bouncedyou straight back into the docs.
"use client"but held noclient state, so it gets real
metadata(it previously inherited the genericsite title). Still prerendered —
○ /docsin the build output.Verified
lint,typecheck,format:checkandnext buildpass;/docsconfirmed ina browser against a production build.
Not in scope
layout/Navbar.tsx:20isposition: fixedwith notop-0, so it renders atits static position and only lands at the top when it is the first child of an
unpadded parent. This route follows that convention, but it is a trap worth
hardening separately —
top-0would be a no-op for all five current pages.update the address bar. Left for the reimplementation the issue anticipates.