Skip to content

docs(accordion,actionbar,actionmenu,alertdialog): site docs to storybook#2770

Merged
castastrophe merged 8 commits into
mainfrom
mdt2/css-759-docs-to-storybook-pt1
May 22, 2024
Merged

docs(accordion,actionbar,actionmenu,alertdialog): site docs to storybook#2770
castastrophe merged 8 commits into
mainfrom
mdt2/css-759-docs-to-storybook-pt1

Conversation

@mdt2
Copy link
Copy Markdown
Collaborator

@mdt2 mdt2 commented May 20, 2024

Description

This migrates the documentation from the deprecated docs site over to Storybook, including showing the variants on the Storybook Docs page.

  • Accordion - got a new MDX page and some MDX-only stories
  • Actionbar - got a new MDX page and one MDX-only story
  • Actionmenu - doesn't require it's own MDX page since the DocumentationTemplate already covers the only variant, so just got an update to the description to include some additional details from the docs site.
  • Alertdialog - got a new MDX page and one MDX-only story. Also got a small update to the template.js so that I could pass a custom height for the scroll story example

Also includes an addition to the storybook/manager.js to hide stories from the sidebar that have the tag is-hidden-story.

This PR shouldn't need a changeset since it's docs-only.

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

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2024

⚠️ No Changeset found

Latest commit: 3d53441

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2024

File metrics

Summary

Total size: 4.64 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2024

🚀 Deployed on https://pr-2770--spectrum-css.netlify.app

@mdt2 mdt2 added the run_vrt For use on PRs looking to kick off VRT label May 20, 2024
@mdt2 mdt2 force-pushed the mdt2/css-759-docs-to-storybook-pt1 branch from a8ee1ab to 5e5197c Compare May 20, 2024 19:00
Copy link
Copy Markdown
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

This is a really strong start for this card! The variants are displayed like they are on the docs site and I didn't notice any information that was lost. I had a few questions only:

  • For Action Menu - is there a way to expand the size of the canvas? It would be nice to see all of the menu if this is an option (doing a quick search there was a fullscreen parameter, I don't know if that would work?), but it's also ok as is.
image
  • For Action Bar--I didn't check it off in the validation, I noticed that the docs site displayed 3 "subvariants" (if they can be called that)--just label, label with icon, and just icon:
image

This doesn't seem to work in Storybook (or maybe it does, I only took a really quick look), and I'm not sure if it was a deliberate decision that was made at some point historically or whether that was unintentional. It might be out of scope if it's something that needs to be addressed, and that's ok too, but I wanted to bring it up here.

I also noticed that in Josh's work on Button and Alert Banner that he removed the controls, what are your thoughts on this? I think the argument could be made either way. 🙂

@mdt2 mdt2 force-pushed the mdt2/css-759-docs-to-storybook-pt1 branch from b0ffa93 to 421b2c5 Compare May 21, 2024 14:17
@mdt2 mdt2 added skip_vrt Add to a PR to skip running VRT (but still pass the action) and removed run_vrt For use on PRs looking to kick off VRT labels May 21, 2024
@mdt2
Copy link
Copy Markdown
Collaborator Author

mdt2 commented May 21, 2024

@rise-erpelding thanks for your feedback!

  • Actionmenu - great catch, I used parameters to update this and you should see the whole component now. I continued using the Default story without an MDX page because the parameters don't seem to affect the Default story page itself.
  • Actionbar - another great catch. After some investigation, I found that this is because actiongroup, which is a child of actionbar, doesn't have label setup on the Storybook side. Since we're saving actiongroup for later because of the S2 migration, I put a note in the docs migration card to include this expansion of actionbar when actiongroup gets updated to include label:
    • Screen Shot 2024-05-21 at 10 03 48 AM

@mdt2 mdt2 requested a review from rise-erpelding May 21, 2024 14:32
Copy link
Copy Markdown
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

Checked it out locally since the build is not building, but I can see those changes to Action Menu! Nice work!

Comment thread components/accordion/stories/accordion.stories.js
Comment thread .storybook/manager.js Outdated
docs: {
story: {
inline: false,
iframeHeight: 250,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh interesting! Great job catching this fix. Is this a best practice we should document for any component using a popover or that uses a certain type of positioning?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the first time we've used it, but I do think it will be necessary to use on the Docs page of any component that uses absolute positioning. It helps us ensure that the whole component can show in the preview frame for Docs.

Comment thread components/alertdialog/stories/alertdialog.stories.js
@castastrophe castastrophe force-pushed the mdt2/css-759-docs-to-storybook-pt1 branch from 421b2c5 to 9cc00a1 Compare May 22, 2024 16:02
@mdt2 mdt2 force-pushed the mdt2/css-759-docs-to-storybook-pt1 branch from 9cc00a1 to 45556d7 Compare May 22, 2024 17:02
@castastrophe castastrophe force-pushed the mdt2/css-759-docs-to-storybook-pt1 branch from 45556d7 to fa4a884 Compare May 22, 2024 17:54

## Controls

<Controls />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since these controls aren't working on any of the canvas', let's use the <ArgTypes of={AccordionStories} /> instead so that's a static representation of the API.

https://storybook.js.org/docs/api/doc-block-argtypes

@castastrophe castastrophe merged commit 1d19c7a into main May 22, 2024
@castastrophe castastrophe deleted the mdt2/css-759-docs-to-storybook-pt1 branch May 22, 2024 18:17
@mdt2 mdt2 mentioned this pull request May 22, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip_vrt Add to a PR to skip running VRT (but still pass the action)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants