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

docs(addon-controls): custom matchers are no longer default #18726

Merged
merged 3 commits into from
Nov 23, 2022

Conversation

JReinhold
Copy link
Contributor

Issue:

A PR at #14182 removed the default custom regex matchers for colors and dates Controls, and instead made the CLI generate the matchers in the preview configuration when initialising Storybook.

However the docs don't reflect this change, and felt quite confusing for me working in a project that didn't use a recent version of the CLI to initialise the project, and therefore didn't have the "default" matchers from the CLI.

What I did

I've tried to change the wording to reflect that they are only "defaults" if the reader actually sees them in their .storybook/preview.js file.

I'm open to inputs on wording, or basically anything.

A PR at storybookjs#14182 removed the default custom regex matchers for colors and dates Controls, and instead added them to the generated output from the CLI.
However the docs don't reflect this change, and felt quite confusing for me working in a project that didn't use a recent version of the CLI, and therefore didn't have the "default" matchers from the CLI.

I've tried to change the wording to reflect that they are only "defaults" if the reader actually sees them in the `.storybook/preview.js` file.

I'm open to inputs on wording, or basically anything.
@nx-cloud
Copy link

nx-cloud bot commented Jul 16, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8cc06ac. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.


| Data type | Default regex | Description |
| :-------: | :-----------------------: | :-------------------------------------------------------: |
| **color** | `/(background\|color)$/i` | Will display a color picker UI for the args that match it |
| **color** | `/(background|color)$/i` | Will display a color picker UI for the args that match it |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks like a regex typo to me, but a pretty weird one so I might be wrong on that. It works without the \, but not with.

@yannbf
Copy link
Member

yannbf commented Jul 18, 2022

Hey @JReinhold thanks for your contribution! That makes total sense. I'll let @kylegach give his opinion to get this going!

@yannbf yannbf added documentation patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jul 18, 2022
Copy link
Contributor

@jonniebigodes jonniebigodes left a comment

Choose a reason for hiding this comment

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

@JReinhold, just a small tweak to this, and this should be good to go on my end. Thanks for following up on that pull request and updating the documentation accordingly. Appreciate it.

Let me know once it's done.

docs/essentials/controls.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jonniebigodes jonniebigodes left a comment

Choose a reason for hiding this comment

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

@JReinhold, thanks for addressing the feedback so promptly. Appreciate it. On my end, this is good and going to merge it.

@jonniebigodes jonniebigodes merged commit 6b6a860 into storybookjs:next Nov 23, 2022
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Nov 27, 2022
shilman pushed a commit that referenced this pull request Nov 27, 2022
docs(addon-controls): custom matchers are no longer default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants