feat: restore previous and next article navigation - #150
Open
dcavalcante wants to merge 2 commits into
Open
dcavalcante wants to merge 2 commits into
dcavalcante wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 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! 🙏 |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches sidebar leaf ordering and includes comprehensive end-to-end coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Restores previous/next navigation beneath Learn articles using sidebar ordering.
Changes:
- Adds recursive article ordering and cross-links.
- Supports responsive layouts and mobile placeholders.
- Adds end-to-end navigation coverage.
| File | Description |
|---|---|
components/ArticleNavigation/index.jsx |
Implements article cross-links. |
components/ArticleNavigation/index.module.css |
Adds responsive styling. |
components/Layout/index.jsx |
Renders navigation below article content. |
tests/e2e/interactions.spec.mjs |
Tests ordering, boundaries, nesting, and mobile navigation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 1, 2026
This branch was successfully deployed
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.
Description
Restores previous and next article navigation at the bottom of Learn articles.
On smaller screens, the sidebar is replaced by a navigation dropdown near the top of the page. After reading a long article, continuing to the next article currently requires scrolling back to the top. This adds the same sequential navigation at the end of the article.
The links reuse the existing
BaseCrossLinkcomponent and follow the same article order as the sidebar navigation.Background
Previous/next navigation has existed in earlier versions of the Learn experience.
nodejs/doc-kit#928 identified the absence of previous/next links on Node.js Learn after the doc-kit migration as a regression.
Support was subsequently added to doc-kit in nodejs/doc-kit#1012, which introduced opt-in cross-links through navigation.showCrossLinks.
Learn currently overrides doc-kit's default #theme/Layout, so the cross-link rendering provided by doc-kit's default layout is not used.
There is also earlier history for Learn-specific previous/next navigation:
nodejs/nodejs.org#5242 discussed migrating the old pagination component as a Learn-specific PreviousNextLink.
nodejs/nodejs.org#5331 implemented that component.
nodejs/nodejs.org#5705 removed it temporarily while the new website design was being introduced.
nodejs/nodejs.org#5761 and nodejs/nodejs.org#5781 introduced the redesigned CrossLink component that this change now reuses.
Implementation
ArticleNavigationcomponent beneath article content.BaseCrossLinkfor the existing Previous/Next design.site.jsonas the navigation source of truth.The recursive flattening is intentional because Learn contains nested sidebar sections such as Diagnostics and Node-API.
Validation
Added Playwright coverage for:
Locally verified with:
All 20 end-to-end tests pass.