Skip to content

feat: Sidebar enhancements#646

Draft
canerakdas wants to merge 1 commit intonodejs:mainfrom
canerakdas:feat/sidebar-enhancements
Draft

feat: Sidebar enhancements#646
canerakdas wants to merge 1 commit intonodejs:mainfrom
canerakdas:feat/sidebar-enhancements

Conversation

@canerakdas
Copy link
Member

Description

With this PR, the links in the Sidebar have been grouped to make it easier for devs to find the content they are looking for.

Additionally, the version select has been changed from the inline variant to the default version. As part of this update, the heights of the selects and the ToC on mobile resolutions have also been aligned to maintain visual consistency

Validation

Before / After

image image
image image
image image

Copilot AI review requested due to automatic review settings March 5, 2026 16:31
@canerakdas canerakdas requested a review from a team as a code owner March 5, 2026 16:31
@vercel
Copy link

vercel bot commented Mar 5, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Mar 5, 2026 4:31pm

Request Review

@avivkeller
Copy link
Member

While I like the idea, I have two concerns:

  1. What about non-core projects? These files won't be defined.
  2. What happens if one of these files has a different path of a file is added.

IMO it makes more sense to, in the future, define a "category" in the YAML metadata of a file, and use that category here.

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 PR enhances the sidebar by grouping navigation links into logical categories (e.g., "Getting Started", "Networking & Protocols") instead of a single flat list, and updates the version select from the inline variant to the default variant for visual consistency.

Changes:

  • New SIDEBAR_GROUPS constant defining categorized page groupings, with uncategorized pages falling back to "Other"
  • buildSideBarGroups function added to map flat docPages into grouped sidebar navigation
  • CSS override to remove the minimum width on the select component in the sidebar

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/generators/web/ui/constants.mjs Adds SIDEBAR_GROUPS array defining navigation group names and their associated page URLs
src/generators/web/ui/components/SideBar/index.jsx Imports SIDEBAR_GROUPS, adds buildSideBarGroups helper, replaces flat group with grouped output, and removes inline prop from Select
src/generators/web/ui/index.css Adds a CSS rule to reset the min-width on the version select's combobox button

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

@avivkeller
Copy link
Member

It's also worth noting that having markdown files supply their own categories will be beneficial for the learn content, which has different categories, and will be processed in doc-kit eventually (once doc kit supports categories + authors)

@canerakdas canerakdas marked this pull request as draft March 5, 2026 16:51
@canerakdas
Copy link
Member Author

  1. What about non-core projects? These files won't be defined.

All files will be listed under "Other" in such cases

  1. What happens if one of these files has a different path of a file is added.

If the file added or the file is not located here, it will still be listed under "Other"

It's also worth noting that having markdown files supply their own categories will be beneficial for the learn content, which has different categories, and will be processed in doc-kit eventually (once doc kit supports categories + authors)

I think grouping things this way makes the most sense.

From the PR side, I can either remove the category creation part and keep other minor changes, or we can mark it as deprecated and keep the feature during a transition period, IDK

I think we might also need this grouping for index.html as well

@avivkeller
Copy link
Member

From the PR side, I can either remove the category creation part and keep other minor changes, or we can mark it as deprecated and keep the feature during a transition period, IDK

How about we do this transition period you mentioned, like we did for the type map.

For now, while the documentation is changing, we use this, but if the documentation provides its category via YAML metadata, we use that? That way, this both satisfies the current documentation, and the future learn content?

@avivkeller
Copy link
Member

e.g.

The YAML metadata in a given file can have a category="My Category"

@avivkeller
Copy link
Member

Which means we build the groups in jsx-ast, and pass them in place of docPages.

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