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 TabbedSidebar stories and improve docs #68118

Merged

Conversation

Sukhendu2002
Copy link
Contributor

@Sukhendu2002 Sukhendu2002 commented Dec 19, 2024

Part of: #67165

What?

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

Testing Instructions

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

Screenshots or screencast

image

@Sukhendu2002 Sukhendu2002 marked this pull request as ready for review December 19, 2024 09:27
Copy link

github-actions bot commented Dec 19, 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: Sukhendu2002 <[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.

@Sukhendu2002
Copy link
Contributor Author

Hi @t-hamano 👋 I've added Storybook stories for TabbedSidebar and updated its documentation. Would appreciate your review when you have a moment. Thank you!

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 also think the typo fixes and improvements in the README are great.

@Sukhendu2002
Copy link
Contributor Author

Thank you for the feedback. I've updated the PR accordingly.

@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers Storybook Storybook and its stories for components labels Jan 2, 2025
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 update! Finally, it's a good idea to make some props controllable:

diff --git a/packages/block-editor/src/components/tabbed-sidebar/stories/index.story.js b/packages/block-editor/src/components/tabbed-sidebar/stories/index.story.js
index ec4621ced7..49825be19b 100644
--- a/packages/block-editor/src/components/tabbed-sidebar/stories/index.story.js
+++ b/packages/block-editor/src/components/tabbed-sidebar/stories/index.story.js
@@ -55,7 +55,7 @@ const meta = {
                        description: 'The ID of the currently selected tab.',
                },
                tabs: {
-                       control: { type: null },
+                       control: { type: 'array' },
                        table: {
                                type: { summary: 'array' },
                        },
@@ -63,7 +63,7 @@ const meta = {
                                'Array of tab objects. Each tab should have: name (string), title (string), panel (React.Node), and optionally panelRef (React.Ref).',
                },
                closeButtonLabel: {
-                       control: { type: null },
+                       control: { type: 'text' },
                        table: {
                                type: { summary: 'string' },
                        },

image

@Sukhendu2002
Copy link
Contributor Author

Thanks for the feedback! I've updated the PR accordingly.

@t-hamano t-hamano self-requested a review January 3, 2025 10:33
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 merged commit 0f2a584 into WordPress:trunk Jan 3, 2025
63 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.1 milestone Jan 3, 2025
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.

2 participants