Skip to content

Conversation

@avivkeller
Copy link
Member

Description

Currently, we have both ProgressionSideBar and SideBar, however, they are very similar, so the code duplication is unnecessarily complex.

Validation

The Stories should look the same, or very similar.

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copilot AI review requested due to automatic review settings June 6, 2025 15:28
@avivkeller avivkeller requested a review from a team as a code owner June 6, 2025 15:28
@vercel
Copy link

vercel bot commented Jun 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jun 6, 2025 9:29pm

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 consolidates the existing SideBar and ProgressionSideBar components into one SideBar with an optional showProgressionIcons flag, and removes the old ProgressionSidebar code.

  • Introduced showProgressionIcons prop across SideBar, SidebarGroup, and SidebarItem
  • Removed all Common/ProgressionSidebar files and updated usages to pass the new prop
  • Updated CSS and Storybook stories to support the unified component

Reviewed Changes

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

Show a summary per file
File Description
packages/ui-components/Containers/Sidebar/index.tsx Added showProgressionIcons prop and propagation
packages/ui-components/Containers/Sidebar/index.stories.tsx Refactored stories and added Progression story
packages/ui-components/Containers/Sidebar/index.module.css Tweaked border CSS
packages/ui-components/Containers/Sidebar/SidebarItem/index.tsx Added showProgressionIcon prop and classNames
packages/ui-components/Containers/Sidebar/SidebarItem/index.module.css Renamed selectors, added SVG styling
packages/ui-components/Containers/Sidebar/SidebarGroup/index.tsx Added showProgressionIcons prop to groups
packages/ui-components/Containers/Sidebar/ProgressionIcon/index.tsx Renamed icon component
apps/site/layouts/Learn.tsx Switched to SideBar and passed progression flag
apps/site/components/withSidebar.tsx Propagated showProgressionIcons through HOC
(Removed) Common/ProgressionSidebar and related files Deleted legacy progression sidebar implementation
Comments suppressed due to low confidence (4)

packages/ui-components/Containers/Sidebar/SidebarItem/index.tsx:16

  • [nitpick] The prop is named showProgressionIcon here but showProgressionIcons elsewhere. Consider using a single consistent name across components to avoid confusion.
showProgressionIcon?: boolean;

packages/ui-components/Containers/Sidebar/index.tsx:15

  • The showProgressionIcons flag adds a new rendering path, but there are no unit tests covering its true/false cases. Add tests for both scenarios to ensure the new icon behavior works as expected.
showProgressionIcons?: boolean;

packages/ui-components/Containers/Sidebar/index.tsx:15

  • [nitpick] The new showProgressionIcons prop isn't documented in JSDoc comments or Storybook controls. Please add documentation or update the prop table to explain its purpose and default behavior.
showProgressionIcons?: boolean;

packages/ui-components/Containers/Sidebar/SidebarItem/index.module.css:47

  • The CSS rule uses &:not(.progression) > .active outside of a nested context, which may produce invalid selectors. It should be nested under .item or rewritten as .item:not(.progression) > .active.
&:not(.progression) > .active {

@codecov
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.44%. Comparing base (ed840c2) to head (30bdca9).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7840      +/-   ##
==========================================
- Coverage   75.46%   75.44%   -0.02%     
==========================================
  Files         101      101              
  Lines        8305     8305              
  Branches      218      218              
==========================================
- Hits         6267     6266       -1     
- Misses       2036     2037       +1     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@avivkeller avivkeller marked this pull request as ready for review June 6, 2025 16:32
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 99 🟢 96 🟢 100 🟠 82 🔗
/en/about/previous-releases 🟢 99 🟢 96 🟢 100 🟠 83 🔗
/en/download 🟢 97 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 99 🟢 100 🟢 96 🟢 92 🔗

@AugustinMauroy
Copy link
Member

FYI, sidebar may have drop down on it like for api docs. Could you add stories to unsure it's possible.

Figma ref:

@avivkeller
Copy link
Member Author

FYI, sidebar may have drop down on it like for api docs. Could you add stories to unsure it's possible.

I planned to open a follow up allowing for children, but it shouldn't be too difficult to just do it here (it certainly makes my life a bit easier, I'll get on that ASAP)

@AugustinMauroy
Copy link
Member

FYI, sidebar may have drop down on it like for api docs. Could you add stories to unsure it's possible.

I planned to open a follow up allowing for children, but it shouldn't be too difficult to just do it here (it certainly makes my life a bit easier, I'll get on that ASAP)

If you implement that here or in the next pr, both will work fine.

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGMT ! thanks aviv

@avivkeller
Copy link
Member Author

Also just FWIW for the select specifically, we know it'll be fine, since we more-or-less use it already on mobile layouts

@avivkeller
Copy link
Member Author

@AugustinMauroy PTAL at the latest commit. I plan to pass the <Select /> write where the empty space is in the image below:
image

@AugustinMauroy
Copy link
Member

that's can work !

@avivkeller avivkeller added the fast-track Fast Tracking PRs label Jun 6, 2025
@avivkeller
Copy link
Member Author

avivkeller commented Jun 6, 2025

@nodejs/nodejs-website Requesting fast track so I can update api-docs-tooling accordingly. Merge when ready

@avivkeller avivkeller enabled auto-merge June 6, 2025 22:15
@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label Jun 6, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jun 6, 2025
@avivkeller avivkeller added this pull request to the merge queue Jun 6, 2025
@avivkeller avivkeller removed this pull request from the merge queue due to a manual request Jun 6, 2025
@avivkeller avivkeller added this pull request to the merge queue Jun 6, 2025
Merged via the queue into main with commit 0bb5d49 Jun 6, 2025
30 checks passed
@avivkeller avivkeller deleted the avivkeller/chore/ui/sidebar branch June 6, 2025 22:25
@ovflowd
Copy link
Member

ovflowd commented Jun 7, 2025

I don't think a PR with 19 file changes should be fast-tracked; Please let's avoid fast-tracking PRs with large changes, I wanted to review this but now feel that I cannot anymore because it got merged LOL.

const mappedSidebarItems =
// If there's only a single navigation key, use it's sub-items
// as our navigation.
(navKeys.length === 1 ? sideNavigation[0][1].items : sideNavigation).map(
Copy link
Member

Choose a reason for hiding this comment

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

This could benefit from useMemo

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

Overall cool code.

@avivkeller
Copy link
Member Author

I don't think a PR with 19 file changes should be fast-tracked; Please let's avoid fast-tracking PRs with large changes, I wanted to review this but now feel that I cannot anymore because it got merged LOL.

Yea, that's on me. It also looks like the css has a little bug, so I need to patch it up today.

@ovflowd
Copy link
Member

ovflowd commented Jun 7, 2025

I don't think a PR with 19 file changes should be fast-tracked; Please let's avoid fast-tracking PRs with large changes, I wanted to review this but now feel that I cannot anymore because it got merged LOL.

Yea, that's on me. It also looks like the css has a little bug, so I need to patch it up today.

Happens! Let's just be mindful of these rules 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track Fast Tracking PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants