Skip to content

Conversation

@im3dabasia
Copy link
Contributor

This PR is under development and testing.

  1. I have added docs-manifest.json.
  2. I have Refactored the exports for ToggleGroupControl to align them as suggested here and in this docs
  3. Changed <ToggleGroupControlOption> to <ToggleGroupControl.Option> and <ToggleGroupControlOptionIcon> to <ToggleGroupControl.OptionIcon> This change is as per the Menu, Tabs pattern Ref

To Do:

  1. Work on adding disabled prop filter logic as suggested here

What?

Convert the Tabs README to an auto-generated one.

Supplementary information in the current README.md has been shifted to stories/best-practices.mdx

Related/Follow-up to: #69715 (comment)

Why?

To decrease maintenance cost and consolidate the canonical docs for our audience.

How?

Testing Instructions

  1. In your IDE, check imports of ToggleGroupControl.Option and ToggleGroupControl.OptionIcon for example, and see that the JSDoc includes the subcomponent description.
  2. npm run docs:components to regenerate READMEs.
  3. See Storybook docs for ToggleGroupControl
Screen.Recording.2025-04-23.at.5.16.36.PM.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!

I think this PR includes a lot of changes, and there are many things that need to be discussed or decided.

Additionally, this PR removes the __experimentalToggleGroupControlOption and __experimentalToggleGroupControlOptionIcon components, breaking backward compatibility. At this point, we may also want to consider stabilizing the components (Example: Stabilized Navigator component).

In my opinion, it would be better to split the task into PRs like this and have discussions and decisions on each PR:

  1. Stabilize the ToggleGroupControl component and export the ToggleGroupControl.Option and ToggleGroupControlOption.Icon, subcomponents
  2. Update Storybook and add the best-practices readme
  3. Replace the use of __experimentalToggleGroupControlOption and __experimentalToggleGroupControlOptionIcon with the stabilized ToggleGroupControl.Option and ToggleGroupControlOption.Icon.
  4. Deprecate the __experimentalToggleGroupControl, __experimentalToggleGroupControlOption, and __experimentalToggleGroupControlOptionIcon compoentns (Should we add a deprecation warning, or do we keep it "Soft deprecated"?)
  5. Auto-Generate readme

The important point might be whether we can stabilize the component. In WordPress 6.8, the ButtonGroup component has been deprecated in favor of the ToogleGroupControl component. However, it seems a bit strange to see a component with the experimental prefix being recommended.

cc @WordPress/gutenberg-components

@im3dabasia
Copy link
Contributor Author

I think this PR includes a lot of changes, and there are many things that need to be discussed or decided.

@t-hamano, Thanks for the review 🙇 ,

I will stop active work related to this PR, let some discussion happen related to the changes you have proposed above, and once a decision is made, we can start with the development work.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. Needs Decision Needs a decision to be actionable or relevant [Package] Components /packages/components labels Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Decision Needs a decision to be actionable or relevant [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants