Skip to content

Update sidenav to scroll down to current page when necessary#16349

Open
coolguyzone wants to merge 8 commits intomasterfrom
nav-scroll-update
Open

Update sidenav to scroll down to current page when necessary#16349
coolguyzone wants to merge 8 commits intomasterfrom
nav-scroll-update

Conversation

@coolguyzone
Copy link
Contributor

@coolguyzone coolguyzone commented Feb 10, 2026

DESCRIBE YOUR PR

Keeps the scroll depth of the nav in sync with the page you are on. See it on pages buried in the nav, e.g. https://sentry-docs-git-nav-scroll-update.sentry.dev/concepts/otlp/otlp-traces/

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

@vercel
Copy link

vercel bot commented Feb 10, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Feb 11, 2026 10:09pm
sentry-docs Ready Ready Preview, Comment Feb 11, 2026 10:09pm

Request Review

@coolguyzone coolguyzone requested review from a team and Copilot and removed request for a team February 10, 2026 22:00
Copy link
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

This pull request updates the sidebar navigation scroll behavior to automatically scroll the active link into view when necessary. The changes refactor the component from using a hardcoded aside element selector to dynamically finding the actual scrollable container, and adds automatic scrolling for the active link when there's no stored position (e.g., on page load or refresh).

Changes:

  • Introduced a findScrollContainer helper function to dynamically locate the scrollable container instead of hardcoding aside element lookups
  • Refactored both useEffect hooks to use the dynamic scroll container
  • Added automatic scrolling behavior using scrollIntoView when no previous position is stored in sessionStorage
  • Wrapped the second useEffect's logic in requestAnimationFrame to ensure DOM is fully rendered

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

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

@sfanahata sfanahata left a comment

Choose a reason for hiding this comment

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

👏 Bless you

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.

2 participants