Skip to content

fix: enable independent scrolling in sidebar navigation#8846

Open
7487 wants to merge 1 commit intonodejs:mainfrom
7487:fix/sidebar-scroll
Open

fix: enable independent scrolling in sidebar navigation#8846
7487 wants to merge 1 commit intonodejs:mainfrom
7487:fix/sidebar-scroll

Conversation

@7487
Copy link
Copy Markdown

@7487 7487 commented Apr 26, 2026

Description

When sidebar content overflows on desktop, users cannot scroll to see hidden items. This PR adds flex-1, overflow-y-auto, and scroll-smooth to the .navigation class so each sidebar section scrolls independently within the sticky page layout.

Changes

  • packages/ui-components/src/Containers/Sidebar/index.module.css: add flex-1 overflow-y-auto scroll-smooth to .navigation

When sidebar content overflows on desktop, users cannot scroll to see hidden items.
Add flex-1 + overflow-y-auto + scroll-smooth to the .navigation class so each sidebar
section scrolls independently within the sticky page layout.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Copilot AI review requested due to automatic review settings April 26, 2026 03:02
@7487 7487 requested a review from a team as a code owner April 26, 2026 03:02
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

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

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Apr 26, 2026 3:03am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 26, 2026

PR Summary

Low Risk
Low risk CSS-only change that alters sidebar layout/scroll behavior; main risk is unintended overflow or flex sizing regressions on desktop breakpoints.

Overview
Fixes an issue where overflowing desktop sidebar items were not reachable by making the .navigation area within Sidebar a flex child (flex-1) with its own vertical scrolling (overflow-y-auto) and smooth scroll behavior (scroll-smooth).

Minor formatting/indentation adjustments were made in the same CSS module.

Reviewed by Cursor Bugbot for commit 0f23806. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Codeowner Review Request

The 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! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables independent scrolling within the desktop sidebar navigation by making the navigation sections flex to fill available space and become vertically scrollable.

Changes:

  • Updated sidebar .navigation styles to use flex-1 and overflow-y-auto for scrollable sections.
  • Added smooth scrolling behavior to the navigation scroll container.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@apply ml:flex
flex-1
overflow-y-auto
scroll-smooth
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scroll-smooth applies smooth scrolling even when the user has prefers-reduced-motion enabled. Elsewhere in the codebase smooth scrolling is gated behind motion-safe: (e.g., packages/ui-components/src/styles/base.css:14, Containers/Article/index.module.css:39). Consider switching this to motion-safe:scroll-smooth for consistency and accessibility.

Suggested change
scroll-smooth
motion-safe:scroll-smooth

Copilot uses AI. Check for mistakes.
.navigation {
@apply ml:flex
.navigation {
@apply ml:flex
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a flex column layout, flex-1 + overflow-y-auto often requires min-h-0 on the flex item to allow it to shrink and actually become scrollable. There’s an existing example of this pattern in Common/Search/Suggestions/index.module.css:3-9. Without min-h-0 here, the navigation may still overflow its parent instead of scrolling.

Suggested change
@apply ml:flex
@apply ml:flex
min-h-0

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +27
flex-1
overflow-y-auto
scroll-smooth
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.wrapper already applies ml:overflow-auto, and .navigation now adds overflow-y-auto. This creates nested scroll containers on desktop, which commonly leads to double scrollbars / scroll-wheel trapping. If the intent is for the navigation sections to handle scrolling, consider removing or changing the wrapper’s desktop overflow (e.g., to ml:overflow-hidden) so only the intended element scrolls.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to 6
@apply ml:max-w-xs
ml:overflow-auto
ml:border-r
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation in this file is inconsistent with the surrounding CSS module conventions (generally two-space indentation for @apply blocks, e.g. Containers/Footer/index.module.css:4). The extra leading spaces here look accidental and make the file harder to scan; please normalize indentation in this block.

Copilot uses AI. Check for mistakes.
@mikeesto
Copy link
Copy Markdown
Member

Assuming this is related to #8828 ?

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.

3 participants