fix(landing-nav): scroll to top on route change in shared shells#4676
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Mounts this component in the shared layouts for blog, integrations, and models so route changes within these shells reliably reset scroll position. Reviewed by Cursor Bugbot for commit 7e926fe. Configure here. |
Greptile SummaryThis PR introduces a
Confidence Score: 5/5Safe to merge — the change is a small, well-scoped client component that renders nothing and only calls The component is minimal and isolated: it uses standard Next.js hooks, correctly short-circuits on hash anchors, and the three layout files each add a single import and one JSX element with no logic changes. No data, auth, or rendering paths are affected. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User navigates to new pathname] --> B[usePathname change triggers useEffect]
B --> C{window.location.hash\nnon-empty?}
C -- Yes --> D[Return early\nBrowser handles anchor scroll natively]
C -- No --> E[window.scrollTo 0, 0\nReset to top of page]
E --> F[User sees page from the top]
D --> G[User lands at hash target]
Reviews (8): Last reviewed commit: "refactor(landing-nav): simplify scroll-t..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@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 1f67317. Configure here.
|
@greptile |
|
@cursor review |
|
@greptile |
|
@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 7e926fe. Configure here.
Summary
<ScrollToTop />client component in the blog, integrations, and models shared layouts to reset scroll onusePathnamechangeType of Change
Testing
Tested manually — recommend smoke testing listing → detail and detail → listing on blog, integrations, and models, plus browser back/forward
Checklist