-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(ui-components): add ChangeHistory
#7869
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
feat(ui-components): add ChangeHistory
#7869
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 #7869 +/- ##
=======================================
Coverage 75.46% 75.46%
=======================================
Files 101 101
Lines 8306 8306
Branches 218 218
=======================================
Hits 6268 6268
Misses 2036 2036
Partials 2 2 ☔ View full report in Codecov by Sentry. |
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 introduces a new stateless ChangeHistory component to display version change logs in a non-JS dropdown, along with associated styles and Storybook stories.
- Adds
ChangeHistory
React component with customizable label, alignment, and change entries - Includes CSS module for styling the dropdown and summary states
- Provides Storybook stories demonstrating default, no‐changes, left‐aligned, and large history scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/ui-components/Common/ChangeHistory/index.tsx | New ChangeHistory component implementation |
packages/ui-components/Common/ChangeHistory/index.module.css | Styles for the summary button and dropdown menu |
packages/ui-components/Common/ChangeHistory/index.stories.tsx | Storybook demos covering various component states |
Comments suppressed due to low confidence (1)
packages/ui-components/Common/ChangeHistory/index.tsx:50
- [nitpick] This
ariaLabel
variable shadows the outerariaLabel
prop name, which can be confusing. Consider renaming it to something likeitemAriaLabel
to improve clarity.
const ariaLabel = `${change.label}: ${change.versions.join(', ')}`;
ChangeHistory
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.
Almost there!
Lighthouse Results
|
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Signed-off-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com>
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Signed-off-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com>
Co-authored-by: Caner Akdas <canerakdas@gmail.com> Signed-off-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com>
Co-authored-by: Caner Akdas <canerakdas@gmail.com> Signed-off-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com>
Description
Adding a stateless version of ChangeHistory component which can be potentially be used without JavaScript enabled.

Validation
Tested by rendering a few different versions in Storybook
Related Issues
Related to nodejs/api-docs-tooling#10 (comment)
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.