fix: sidebar last items hidden behind header on scroll#8852
fix: sidebar last items hidden behind header on scroll#8852system-conf wants to merge 1 commit intonodejs:mainfrom
Conversation
Fixes nodejs#8521 The sidebar container was using `h-svh` (100svh) with `top-0`, making it exactly viewport height but starting from the top where the header overlaps. This caused the last sidebar items to be clipped when scrolled down. Changes: - Set sidebar top to `var(--header-height)` to position it below the header - Set sidebar height to `calc(100svh - var(--header-height))` to account for the header's vertical space - Removed unnecessary `pb-[var(--header-height)]` padding from sidebar wrapper since the container now correctly sizes itself Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Removes the sidebar wrapper’s extra bottom padding ( Reviewed by Cursor Bugbot for commit 473584e. Bugbot is set up for automated code reviews on this repo. Configure here. |
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
avivkeller
left a comment
There was a problem hiding this comment.
The code makes sense to me, but I'm not sure if we accept contributions entirely written by Artificial Intelligence, cc @nodejs/web-admins
|
https://ai-coding-assistants-policy.openjsf.org/ does not restrict how much of a submission is written by AI, just that it must be correctly attributed to AI and not violate license restrictions, and that the human submitter is taking responsibility (the human opened the PR here, not the AI, so that seems like a valid sign). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8852 +/- ##
==========================================
- Coverage 73.23% 73.22% -0.02%
==========================================
Files 102 102
Lines 8623 8623
Branches 313 313
==========================================
- Hits 6315 6314 -1
- Misses 2307 2308 +1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Summary
Fixes #8521
The sidebar navigation clips the last items when scrolled down. The root cause is that the sidebar container uses
h-svh(100% of small viewport height) withtop-0, but the NavBar sits at the top consuming ~4rem of vertical space. This means the last sidebar items are pushed below the visible viewport area.Changes
packages/ui-components/src/Containers/Article/index.module.css:ml:top-0→ml:top-[var(--header-height)]— positions sidebar below the headerml:h-svh→ml:h-[calc(100svh-var(--header-height))]— sizes sidebar to remaining viewportpackages/ui-components/src/Containers/Sidebar/index.module.css:ml:pb-[var(--header-height)]— no longer needed since the container now correctly accounts for header heightHow to test
/en/learn/getting-started/introduction-to-nodejs)Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com