-
Notifications
You must be signed in to change notification settings - Fork 200
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
refactor(menu): improve chromatic coverage #2757
Conversation
🦋 Changeset detectedLatest commit: 1ca8dc1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Deployed on https://pr-2757--spectrum-css.netlify.app |
File metricsSummaryTotal size: 4.65 MB* 🎉 No changes detected in any packages * Size determined by adding together the size of the main file for all packages in the library.* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
7466cde
to
ca6bf04
Compare
b01b447
to
dfe313c
Compare
dfe313c
to
7380e7d
Compare
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.
Just a few initial thoughts!
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 is looking great! Thanks for all your work here to get this organized and capturing more variants.
Two ideas for more things that might be good to have in the VRT:
- Wrapping text on the section header
- Also including the icon and the checkmark in/after "Sizes" for the "Menu Item Only" story.
7380e7d
to
4040886
Compare
d544c07
to
dcd1f77
Compare
dcd1f77
to
aa2796c
Compare
be40103
to
ecf7e11
Compare
Updates since last reviews: Hide standard with dividers story
Use is-focus-visible class to display focus state
Adjust Chromatic testing view
Adjust switches and controls
|
ecf7e11
to
2460b61
Compare
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 looks great 👍 The requested changes from my last review are all resolved.
- refactor menu item - create single menu item story - create menu with variants story - build chromatic testing views for menu item and menu with variants - remove extra stories in favor of using menu with variants - fix to prevent multiselect checkbox and icon clash CSS-614
2460b61
to
1ca8dc1
Compare
Description
Previously, there were 13 different variants for menu, and the only component-level controls were for size, max inline-size, and truncation. This work eliminates some variants (down to 5 from 13) in favor of showing multiple menu variants in a the Menu with Variants menu and adding more controls to show various states and variants, which are displayed individually in the Chromatic testing preview.
Single menu item refactor
It was also previously difficult to understand the different options available for a menu item within the menu, in both Storybook and the code. Here, the code has been refactored to render each area of a menu item separately, potentially making the code easier to understand and change as we migrate to Spectrum 2. A story specifically dedicated to display a single menu item has been created, with controls to display combinations of variants relevant to a single menu item (such as displaying the icon, item selected status, whether switches or checkboxes are used to indicate selected status on a multi-select item, and focus state). This single menu item story also aligns more closely with the S1 design spec and S2 design spec, showing all the variants, making it easier to validate.
Chromatic coverage
Chromatic coverage for the single menu item and menu item with variants stories has been expanded in order to align more closely with the testing views that have recently been added to other components and to make all states and variants visible in a single testing view (the "kitchen sink" testing strategy), reducing the number of snapshots needed for visual regression testing the component.
Other changes
The Collapsible menu story and Tray submenu story have been left almost completely unchanged as these variants differ from most others. These two variants also do not have a different Chromatic testing view, but I'm open to opinions on either of these!
This work also includes one minor bug fix that prevents the overlap of a multi-select checkbox and an icon should they both be present--this is the only CSS change.
CSS-614
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Check both stories' testing previews - open Storybook to check out the stories for Menu
Regression testing
Validate:
Screenshots
Chromatic testing view for Single Menu Item

Default view mode for Menu with Variants menu, includes many different menu item options in a single menu

To-do list