-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore(ui): merge SideBar and ProgressionSideBar #7840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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
showProgressionIconsprop acrossSideBar,SidebarGroup, andSidebarItem - Removed all
Common/ProgressionSidebarfiles 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
showProgressionIconhere butshowProgressionIconselsewhere. Consider using a single consistent name across components to avoid confusion.
showProgressionIcon?: boolean;
packages/ui-components/Containers/Sidebar/index.tsx:15
- The
showProgressionIconsflag 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
showProgressionIconsprop 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) > .activeoutside of a nested context, which may produce invalid selectors. It should be nested under.itemor rewritten as.item:not(.progression) > .active.
&:not(.progression) > .active {
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ 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. |
|
Lighthouse Results
|
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. |
AugustinMauroy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT ! thanks aviv
|
Also just FWIW for the select specifically, we know it'll be fine, since we more-or-less use it already on mobile layouts |
|
@AugustinMauroy PTAL at the latest commit. I plan to pass the |
|
that's can work ! |
|
@nodejs/nodejs-website Requesting fast track so I can update |
|
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( |
There was a problem hiding this comment.
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
ovflowd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall cool code.
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 🙈 |


Description
Currently, we have both
ProgressionSideBarandSideBar, 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
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.