fix(docs): stop the sidebar drifting when page content resizes - #6301
Conversation
The sidebar used fumadocs' `sticky` positioning, and a sticky box is bottom-limited by its containing block. #nd-docs-layout ends ~660px above the document bottom because the site footer is a sibling of the layout rather than a grid child, so across the whole footer the sidebar was pushed progressively upward. Any content-height change while the reader sat in that zone then moved it: expanding one FAQ row shifted the sidebar 16.8px at a fixed scroll offset, and collapsing it shifted it back. Pin the sidebar and its divider to the viewport instead. A fixed box ignores both the container's end and the document height, so neither the drift nor the jump can happen. The grid columns are explicit (`0px 300px 1fr 268px 0px`), so taking the placeholder out of flow leaves its track intact and the content column does not move. The footer is already opaque and now out-stacks both, so it slides over them at the end of the page. Measured with Playwright before and after: sidebar delta on expand/collapse 16.8px/-16.8px -> 0px/0px, content column left and width unchanged, and the sidebar holds top:92px at the page bottom on the docs, API-reference, academy and integrations layouts. Mobile is untouched (the rule is desktop-only).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview On desktop ( The footer gets Reviewed by Cursor Bugbot for commit 94d9235. Configure here. |
Greptile SummaryThe PR pins the desktop docs sidebar and divider to the viewport to prevent content-resize drift, while moving footer stacking onto the footer component.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/docs/app/global.css | Pins the desktop sidebar and divider to viewport-derived positions and removes grid declarations made inert by fixed positioning. |
| apps/docs/components/footer/footer.tsx | Adds a documented stacking level so the footer paints over the fixed sidebar and divider. |
Reviews (2): Last reviewed commit: "refactor(docs): drop dead grid placement..." | Re-trigger Greptile
… component Review follow-ups. The divider's `grid-row`/`grid-column` stopped doing anything the moment it became `position: fixed` — a fixed box is out of grid layout entirely — so they and the comment explaining the grid span were describing positioning that no longer happens. Verified inert: the divider still computes to left 300px / width 1px / z-index 21 without them. The footer's stacking context also belongs on the footer, not in a global rule matching every desktop `footer` element, so it moves to the component as `relative z-[22]` with the reason in its TSDoc.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 94d9235. Configure here.
Summary
stickypositioning, and a sticky box is bottom-limited by its containing block.#nd-docs-layoutends ~660px above the document bottom because the site footer is a sibling of the layout, not a grid child. So across the entire footer the sidebar was pushed progressively upward, and any content-height change while the reader was in that zone moved it.Why this is safe
0px 300px 1fr 268px 0px), so taking the placeholder out of flow leaves its track intact — the content column does not move.left/widthare restated because a fixed box no longer derives them from its grid cell;top/heightstill come from fumadocs' own utility classes.bg-[var(--bg)]) and now out-stacks the sidebar (z-20) and divider (z-21) at z-22, so it slides over them at the end of the page.min-width: 1024px) — mobile is untouched.Testing
Measured with Playwright, before and after:
topat page bottomInteraction regression suite, all passing: sidebar link navigates, sidebar folder expands, content link clickable (the naive
position: fixedattempt broke this — a full-width fixed aside intercepted every click), FAQ toggles, ToC link clickable, language selector still hidden.Verified
top: 92pxholds at the page bottom on the docs, API-reference, academy and integrations layouts, with zero page errors. Screenshots checked in light and dark at top/middle/bottom, plus mobile. Production build passes (4,281 static pages), typecheck and biome clean.Type of Change
Checklist