Skip to content
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

Storybook: Add stories for the TextDecorationControl component #67337

Merged

Conversation

himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented Nov 27, 2024

Part of #67165

What?

This PR improves the Storybook stories for the TextDecorationControl component in the block editor. It includes stories demonstrating different text-decoration states.

Why?

As part of the ongoing effort to improve component documentation and testing (tracked in #22891), we need comprehensive stories for all Block Editor components.

Testing Instructions

  • Start Storybook by running npm run storybook:dev
  • Open Storybook at http://localhost:50240/
  • Navigate to "BlockEditor/TextDecorationControl" in the Storybook sidebar
  • Test the following stories:
    • Default (no decoration)
    • WithUnderline (underline decoration)
    • WithStrikethrough (strikethrough decoration)
    • WithCustomClass (custom class name)

Screencast

text-decoration-control-story.mov

@himanshupathak95 himanshupathak95 marked this pull request as ready for review November 27, 2024 08:33
Copy link

github-actions bot commented Nov 27, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: himanshupathak95 <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@akasunil akasunil added [Type] Developer Documentation Documentation for developers Storybook Storybook and its stories for components labels Nov 28, 2024
@himanshupathak95 himanshupathak95 changed the title Storybook: Add stories for the text-decoration-control component Storybook: Add stories for the TextDecorationControl component Nov 28, 2024
@miminari miminari requested review from mirka and t-hamano and removed request for ellatrix November 29, 2024 00:13
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I would like to make two suggestions.

  • It looks like you are adding as many variations as possible as individual stories, but this seems redundant. All these props can be changed from the Controls panel. Also, if we go ahead with this approach, we will probably add similar variations to all other block editor components 😅
  • It is certainly easier to understand with demo text, but Storybook is for testing and developing a single component itself. How this component interacts with the outside world is the responsibility of the developer who uses this component, and I think it is better not to include it in the story.

With that in mind, I think it would be best to focus on just the following two improvements for this PR. What do you think?

  • Add the missing propsI (value, className) to argTypes
  • Convert to CSF3 format (See this comment)

@himanshupathak95
Copy link
Contributor Author

Thanks, @t-hamano for the suggestions.

I have addressed all the comments. Please let me if we can improve further.

Screen.Recording.2024-12-11.at.16.17.33.mov

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! It looks almost good, but I'd like to give you some additional feedback 🙏

@himanshupathak95
Copy link
Contributor Author

I have addressed all the comments. Thanks a lot, @t-hamano for the additional suggestion and for improving the overall structure of the story 🙌🏻

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@t-hamano t-hamano self-requested a review December 20, 2024 05:39
@t-hamano t-hamano merged commit 910c38f into WordPress:trunk Dec 20, 2024
66 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storybook Storybook and its stories for components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants