Skip to content

StoryBook: Add story for ColorGradientControl#68675

Open
im3dabasia wants to merge 6 commits intoWordPress:trunkfrom
im3dabasia:storybook/color-gradient-control
Open

StoryBook: Add story for ColorGradientControl#68675
im3dabasia wants to merge 6 commits intoWordPress:trunkfrom
im3dabasia:storybook/color-gradient-control

Conversation

@im3dabasia
Copy link
Contributor

Part of #67165

What?

This PR will add stories for ColorGradientControl component in the Storybook.

Testing Instructions

  1. Run npm run storybook:dev
  2. Open the storybook on http://localhost:50240/
  3. Check the ColorGradientControl story.

Screenshots or screencast

image
Screen.Recording.2025-01-15.at.12.13.17.PM.mov

@Mamaduka Mamaduka added [Type] Developer Documentation Documentation for developers Storybook Storybook and its stories for components labels Jan 15, 2025
@im3dabasia im3dabasia marked this pull request as ready for review January 15, 2025 09:46
@im3dabasia im3dabasia requested a review from ellatrix as a code owner January 15, 2025 09:46
@github-actions
Copy link

github-actions bot commented Jan 15, 2025

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: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@im3dabasia
Copy link
Contributor Author

Hi @t-hamano ,

When you have a moment please review my PR

@im3dabasia im3dabasia force-pushed the storybook/color-gradient-control branch from 7603a17 to 22457a7 Compare June 9, 2025 09:06
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.

Sorry for the late reply. Don't we need stories for the following three exposed components?

  • __experimentalColorGradientControl
  • __experimentalColorGradientSettingsDropdown
  • __experimentalPanelColorGradientSettings

@im3dabasia im3dabasia force-pushed the storybook/color-gradient-control branch from 22457a7 to f67ae0f Compare June 12, 2025 16:54
@im3dabasia im3dabasia force-pushed the storybook/color-gradient-control branch from f67ae0f to 616a1c7 Compare June 16, 2025 13:12
@im3dabasia
Copy link
Contributor Author

Thanks @t-hamano for the feedback

I agree that adding stories for the other two components makes this much more complete.

I have now added the stories for __experimentalColorGradientSettingsDropdown and __experimentalPanelColorGradientSettings

There is some redundant code in the new stories, especially since both of these components are essentially wrappers around __experimentalColorGradientControl. Because they share many of the same props, I think there’s an opportunity to extract and reuse parts of the code—like the meta object, onChange handlers, and even Default.args.

Do you think it would be a good idea to generalize and share those parts across the three stories? Or would you prefer keeping things simple and explicit for ease of readability and understanding?

Looking forward to your thoughts!

@im3dabasia im3dabasia requested a review from t-hamano June 20, 2025 12:37
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