-
Notifications
You must be signed in to change notification settings - Fork 198
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
docs(popover, progresscircle, radio, rating, sidenav): site docs to storybook #2883
Conversation
|
File metricsSummaryTotal size: 4.10 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. |
🚀 Deployed on https://pr-2883--spectrum-css.netlify.app |
feb27f8
to
aff1f2a
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 was a HUGE effort! I think this is pretty close but I have a few component-specific callouts in addition to the comments I left:
Popover
This is a great improvement! This documentation is really nice and includes all the information from the Docs site, but it works much more nicely and is clearer than the Docs site, plus little things like the vertical transition on open/close work now. ⭐
I occasionally saw a hairline/border on the tip within the tip story (not on Docs), but it wasn't consistent. It would disappear sometimes, and I only saw it on my monitor (not my laptop screen). I didn't notice this with the same story on prod. It might be worth investigating and maybe making a bug card for?
Popover Controls
- There are no controls for nested - this is intentional, right? Would we want to remove controls for the “Positioning options” story too? Do we want to keep that story (with the grid view) in the sidebar? It looks ✨amazing✨ but it keeps crashing my browser tab if I open the story (however it works fine in the Docs page). Maybe keep it on the Docs page and for Chromatic?
- Portions of the "Positioning" options depend on having the tip visible. For instance, without the tip visible, there's no difference between "top-left" and "top-right". This is not a huge deal, but it is a little confusing.
Rating
This was probably just about the first time I’ve ever looked at this component, and I didn’t realize that if there is a rating selected, there’s an indicator only under the selected (and not disabled/read only) rating if the component is hovered. I think the way the docs site has the selected/not selected variants communicates in a useful way, and Storybook would benefit from having some of those selected/unselected variants, for example Default and Default selected, Disabled and Disabled selected.
Side nav
Make sure to use the appropriate variant for the context and user needs. Don’t mix behavior, styles, or variations together in a single navigation menu.
Do you think this is important to retain from the docs site? I didn’t see it communicated in Storybook.
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.
These components are looking much better! All of the additions are much needed and really amp up how useful storybook can be. And I love it all getting into one place. I did find a few things I think need to be tweaked, and then I mainly left you questions. 👏 👏 👏
Really small, random note: want to add progress circle to the title of this PR?
aff1f2a
to
dd49221
Compare
Thanks for the thorough reviews! I'm almost done resolving all of the comments here, after that big rebase. I'll re-request a review once they're finished. To your comments Rise:
I'll make a bug card for that. I think it's reproducible if you resize the browser height; it happens on every other (odd?) pixel?
I've removed it from the sidebar, since you were having that performance issue. It's probably a lot faster and less problematic now that it's only loading text content and not a Menu in each one, but I think keeping it off the sidebar is probably best.
I also just realized that the underline not appearing on the star you hover is a feature and not a bug (highlighting the currently selected star value). This component definitely needs extra coverage for the hovered with underline state, and could have all its stories combined into one Chromatic-only template, though we were trying to exclude that refactoring from this work, which is why I kept this as a light touch. I've added a todo about condensing and increasing coverage. I don't think we need to show empty stars and some filled stars as separate stories as it's a bit duplicative, if you were suggesting that? Looking at this did surface a bug in our template that I've fixed in the latest commit; disabled was not showing filled stars! Two classes were being excluded for disabled and readonly that shouldn't have been. Also of note, there is an existing bug related to the hovering in the backlog, CSS-735.
I left this out, as it doesn't seem very helpful and is somewhat inaccurate in our context. For example, it's saying not to mix variations, but you can show headings while also showing icons. Where this sentence originated is already covered with more explanation in the guidelines. |
dd49221
to
2b02ab4
Compare
All of the comments should be addressed now and this is ready for re-review. Note that I've added todo comments for radio and rating that need followup work for increased VRT coverage and use of the I'd also like to update this line before merge, once the fix from #2833 is merged in. |
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.
Thanks for working through all the feedback, Josh! This looks great!
To follow up on a couple of things:
- For Popover, I'm going to note here that hairline bug is definitely visible on prod too, so not a bug introduced here as I'd thought!
- Rating looks good with the changes! I can see how having both unselected and selected can be a little duplicative, and I think it's fine not to have both on the Docs page.
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.
I think you took care of all of our previous feedback, so now I just looked through everything with the the modes work & some future work we know is happening in mind! Great work!
2b02ab4
to
c42aff5
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.
Let's get this merged! Thanks for all your hard work on this!
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.
A few changes noted in progresscircle and popover. I can review the rest at a later date but I'm seeing a few overlaps there too.
customClasses: ["spectrum-Dialog--small"], | ||
isDismissable: false, | ||
heading: "Example heading", | ||
content: [ |
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.
Might be a todo for later but it seems like the Dialog content should automatically wrap in the Typography component. If we push it through the renderContent
utility exported from @spectrum-css/preview/decorators
? We might need to update that function to use Typography styles if the content entry is a string?
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.
I'm not sure if this completely still applies after the latest set of changes. Let me know if you think there is something that needs updating for this PR.
c3ceff5
to
db534a9
Compare
I've finished reworking these changes after the rebase with the changes to
|
87a95ff
to
380629b
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 was another beast of a rebase!! Thanks for sticking with this one! I did note a couple places where we could probably remove older custom templates we were making in favor of the new utilities that have merged. I have a few more
For sidenav- did we need to move this migration note on the docs site to the changelog or is it already there? (I didn't check!)
"Core token migration work and design updates added a span tag wrapping the link text."
For the position: left
and possibly the position: start
& end
popover tests: should we add wrapperStyles["align-items"] = "center";? The
position: right` case has that same line. I think that would fix this view up:
Those are the only 3 that didn't have a specified wrapperStyles["align-items"]
bit. And there might be a reason we don't need to add that, but then do we remove the same line from position: right
?
380629b
to
430e663
Compare
Radios displayed with the Sizes() template were no longer grouped and showing a selected radio within in group, because they all had the same name. This addition to the ArgGrid() function makes sure that the id and name args used for attributes have a unique string appended when the template is rendered multiple times within the grid.
Add stories to include the variants from the docs site.
Migrate docs page variants and relevant notes to Storybook Docs, for the Radio component. Separates disabled, read-only, and emphasized options out into their own Docs stories for the user's view, as single radios would not have those options mixed in a group of radios.
The field group was missing the role="radiogroup" for radios, and role="group" for checkboxes, as displayed on the docs site. Also adds the aria-readonly attribute when readonly, for radios; the attribute 'readonly' is not a native attribute for individual radio and checkbox inputs, but the aria-readonly attribute can be used for role="radiogroup".
Adjust some stories and controls to improve documentation and make sure that any docs site documentation is represented. docs(rating): fix disabled stars not showing in storybook The Storybook template was excluding the is-selected and is-currentValue classes for disabled and read-only, when it shouldn't have been; this now matches the markup on the docs site and fixes the disabled rating not showing filled stars.
- Migrates some of the story descriptions from the docs page. - Adds additional description to document disabled and selected. - Adjusts story content to clarify what is being displayed. - Corrects and documents the display of icons. Icons should now appear on all first level nav items when the associated control is true.
Moves and re-organizes all of the docs site documentation for Popover to Storybook, and creates new stories to represent missing examples from the docs. Also adds the dialog popover example to the VRT tests. This option should be tested as its provided and documented in SWC.
HTML inputs of type range do not support the readonly attribute. This removes that attribute from the input field used in the rating component's storybook template.
The focused class was named wrong and was being applied to the wrong element.
430e663
to
64cba0e
Compare
Description
This continues the migration work to move the documentation from the deprecated docs site to Storybook, covering the components Popover, ProgressCircle, Radio, Rating, and Sidenav. Variants shown on the docs site for these components have been added to Storybook as new stories if they did not already exist. No custom MDX files were needed for these components.
Component specific changes and notes:
role="radiogroup"
and to make use ofaria-readonly
for radios.Other overall Storybook updates:
Sizes()
ArgGrid
Radios displayed with the Sizes() template were no longer grouped and showing a selected radio within in group, because they all had the same name. This addition to the ArgGrid() function makes sure that the id and name args used for attributes have a unique string appended when the template is rendered multiple times within the grid.
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
Regression testing
Some expected VRT changes:
Validate:
To-do list