fix(website): close the docs shell's nav-height and column-measure defects - #942
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
…fects Polish pass over the /docs single-pane reading experience, following the footer removal in #932. Three real defects, each measured rather than inferred, plus the parity gap on the one route that wore no chrome. --nav-h was wrong by 15px from 768px to 1023px. The nav has three heights, not two: padding steps at md (768) but the tall `hidden lg:flex` link row only appears at lg (1024), leaving a 66px nav in between. The variable jumped straight to 81px at md, so every offset in that band overshot — dead space above the docs column, and the mobile drawer (top: nav-h - 1px) hanging 14px below the nav it attaches to. This is the nav-height coupling the migration comment in pages.css deferred; it lived in chrome.css, not in the docs shell, and it is site-wide. The article's `overflow-x-hidden` is removed rather than relocated. It was redundant — global.css already clips the body — and it was the very mistake that rule's own comment warns about: `overflow-x: hidden` computes `overflow-y: auto`, so it made every docs article a scroll container. All 123 docs URLs were swept at 375px with it removed; none overflow. The breadcrumb/page-header block now shares the article's md:max-w-3xl measure, which the article and the prev/next rail already used. It had stretched to the full content width, floating PageActions ~500px right of its column (1272px against 768px at 1920). /docs/choosing-an-adapter gains the TOC rail. It carries as many headings as any library page but had no rail. It stays library-neutral, so it takes no breadcrumb or page header — both are keyed to a library it deliberately has not picked. Tests: e2e/nav-height.spec.ts pins --nav-h to the rendered nav at all six breakpoint edges (jsdom cannot measure layout, so a real browser is the only place these can be compared). e2e/docs-shell.spec.ts covers the TOC rail, which had no tests at all, and the shared column edge. The existing horizontal-overflow guard in website.spec.ts was vacuous: it measured documentElement.scrollWidth, which the global body clip pins to the viewport, so its 24 assertions could never fail. It now measures whether content escapes its own column, exempting content inside its own horizontal scroller. Every new and rewritten guard was mutation-tested against the defect it describes. Verified: 447 unit tests pass (unchanged), 72 e2e pass (59 pre-existing + 13 new), lint 0 errors, production build succeeds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove
force-pushed
the
blove/docs-single-pane-polish
branch
from
September 1, 2026 23:15
dd0fe38 to
c1dde39
Compare
Contributor
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.
Polish pass over the
/docssingle-pane reading experience, picking up where the footer removal in #932 left off. I audited the shell end to end across 360–1920px before changing anything; three of the things I found are real defects, one is a parity gap, and several suspicions turned out to be fine and are left alone.--nav-hwas wrong by 15px from 768px to 1023pxThe nav has three heights, not two. Padding steps at
md(768px), but the tallhidden lg:flexlink row only appears atlg(1024px), leaving a 66px nav in between:--nav-h(before)Everything that offsets against the nav reads this one variable, so the whole tablet band overshot: dead space above the docs column, and the mobile drawer (
top: calc(var(--nav-h) - 1px)) hanging 14px below the nav it is supposed to attach to — measured at 900px wide, nav bottom 66px, drawer top 80px.This is the nav-height coupling that the migration comment in
pages.cssdeferred to "a later project". It turned out to live inchrome.css, not in the docs shell, and it is site-wide rather than docs-only.After: the breadcrumb moves from y=105 to y=90 at 900px, and the drawer sits flush.
overflow-x-hiddenon the article: removed, not relocatedThe fear behind keeping it is already covered —
global.csssetsbody { overflow-x: clip }, with a comment explaining thathiddenwas rejected there precisely because it creates a scroll container and kills sticky descendants. The article'shiddenmade that same mistake locally:overflow-x: hiddencomputesoverflow-y: auto, so every docs article was a scroll container (verified: computedoverflow-ywasautowith the class,visiblewithout).Before trusting the removal I swept all 123 docs URLs at 375px with the class removed — zero horizontal overflow. Wide code blocks and tables scroll inside their own
overflow-x: autocontainers, which is where the containment belongs.The other half of that stale comment is also updated: the
paddingTop: 80hardcode was already replaced withvar(--nav-h), andmin-h-screen+padding-topdon't stack under the globalbox-sizing: border-box.One column edge
The breadcrumb/page-header block had no max-width while the article and prev/next rail both sat at
max-w-3xl, soPageActionsfloated ~500px right of the column it belongs to (header right edge 1648 vs prose 1096 at 1920px). It now shares the same measure — header and prev/next right edges both land on 1048./docs/choosing-an-adaptergains the TOC railIt carries as many headings as any library page (7 H2s plus H3s) but had no rail. It stays library-neutral, so it takes no breadcrumb or page header — both are keyed to a library it deliberately has not picked.
Audited and left alone
top: --nav-hthrough a full 7723px scroll;align-self: flex-startintact; the sidebar pane scrolls internally (1335 vs 819).requestAnimationFrame, so the rAF-gated update never ran, andwindow.scrollTothere movesscrollYwithout emitting a scroll event at all. In a real browser it tracks correctly, and there is now a test proving it..docs-index-bodyis a marker class with no CSS; the spec pinning it is untouched.Tests
e2e/nav-height.spec.tspins--nav-hto the rendered nav at all six breakpoint edges — jsdom cannot measure layout, so a real browser is the only place these two can be compared.e2e/docs-shell.spec.tscovers the TOC rail (which had no tests at all) and the shared column edge.The existing horizontal-overflow guard in
website.spec.tswas vacuous: it measureddocumentElement.scrollWidth, which the global body clip pins to the viewport width, so its 24 assertions could never fail — that is the test that supposedly protected the class removed here. It now measures whether content escapes its own column, exempting content inside its own horizontal scroller.Every new and rewritten guard was mutation-tested against the defect it describes: reverting
--nav-hfails 4 tablet-band tests; injecting a 2000px element fails the overflow guard by name; dropping the measure fails the column-edge test.Verification
npx vitest run— 447 passed / 59 files (unchanged from baseline)npx nx e2e website— 72 passed (59 pre-existing + 13 new)npx nx lint website— 0 errors, 27 pre-existing warningsnpx nx build website— succeeds, production bundle budgets included🤖 Generated with Claude Code