Skip to content

Storybook: Add TabbedSidebar stories and improve docs#68118

Merged
t-hamano merged 3 commits intoWordPress:trunkfrom
Sukhendu2002:enhancement/tabbed-sidebar-story
Jan 3, 2025
Merged

Storybook: Add TabbedSidebar stories and improve docs#68118
t-hamano merged 3 commits intoWordPress:trunkfrom
Sukhendu2002:enhancement/tabbed-sidebar-story

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
@github-actions
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 <sukhendu2002@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.

@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
@github-actions github-actions bot added this to the Gutenberg 20.1 milestone Jan 3, 2025
bph pushed a commit to bph/gutenberg that referenced this pull request Jan 8, 2025
* Add stories and improve TabbedSidebar docs

* Refactor TabbedSidebar story

* Make TabbedSidebar story props controllable

Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Gulamdastgir-Momin pushed a commit to Gulamdastgir-Momin/gutenberg that referenced this pull request Jan 23, 2025
* Add stories and improve TabbedSidebar docs

* Refactor TabbedSidebar story

* Make TabbedSidebar story props controllable

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