Skip to content

Give the docs viewer a single scroll context - #21

Merged
BeckettFrey merged 1 commit into
mainfrom
fix-docs-nested-scrolling
Aug 20, 2026
Merged

Give the docs viewer a single scroll context#21
BeckettFrey merged 1 commit into
mainfrom
fix-docs-nested-scrolling

Conversation

@BeckettFrey

Copy link
Copy Markdown
Member

Closes #15.

The nesting

public/docs is a pdoc bundle — already a complete docs site, with a sidebar
pane and a content pane that scroll independently by design. The route wrapped
it in two more scroll contexts:

window            ← scrolled, because <Footer> sat outside the h-screen block
└ iframe card     ← inset by pt-24/pb-8 + rounded border, so it scrolled early
  ├ pdoc nav      ┐ the two pdoc actually intends
  └ pdoc main     ┘

The window layer was the worst of it: <Footer> was a sibling after a
h-screen overflow-hidden div, so the document ran a full viewport plus a
footer. 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 Footer from
this 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; Footer removed.
  • app/globals.cssbody forces overflow-y: scroll site-wide to avoid
    layout 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:

  • Frame points at voxkit.html directly. /docs/index.html is only a
    <meta http-equiv="refresh"> stub. In a frame that hop becomes a session
    history entry, so leaving /docs took two Back presses — the first bounced
    you straight back into the docs.
  • Renders on the server now. The page carried "use client" but held no
    client state, so it gets real metadata (it previously inherited the generic
    site title). Still prerendered — ○ /docs in the build output.

Verified

lint, typecheck, format:check and next build pass; /docs confirmed in
a browser against a production build.

Not in scope

  • layout/Navbar.tsx:20 is position: fixed with no top-0, so it renders at
    its 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-0 would be a no-op for all five current pages.
  • Docs pages still are not deep-linkable: navigating inside the frame does not
    update the address bar. Left for the reimplementation the issue anticipates.

/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
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
voxkit-web Ready Ready Preview Aug 20, 2026 5:42pm

@BeckettFrey
BeckettFrey merged commit 1d0f3a8 into main Aug 20, 2026
5 checks passed
@BeckettFrey
BeckettFrey deleted the fix-docs-nested-scrolling branch August 20, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reimplement Documentation viewing

1 participant