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: add detail to addon-contexts per-story settings #10112

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

tinymachine
Copy link
Contributor

Issue:

The addon-contexts readme currently says, "...you may want to modify the default setups at per story level". But there's no example provided, and it appears that "modifying" is a stretch. You can create per-story contextual environments, and you can disable default setups, but there doesn't seem to be a way to actually modify a setup defined in context.js at the story level.

What I did

Clarified that you can create per-story contexts or disable default (global) contexts defined in contexts.js, and provided sample code for the latter. I also linked to my explanation on Discord of how I went about "modifying" a default setup at the story level, which involved disabling the default setup and creating a new, nearly identical setup with a different default option. Not a lovely solution (and maybe only relevant until addon-toolbars is released), which is why I didn't include the code here in the readme itself.

How to test

  • Is this testable with Jest or Chromatic screenshots? No.
  • Does this need a new example in the kitchen sink apps? No.
  • Does this need an update to the documentation? No -- it is an update to the documentation.

If your answer is yes to any of these, please make sure to include it in your PR.

Clarify that you can create per-story contexts or disable default (global) contexts defined in contexts.js, and provide sample code for the latter.
@tinymachine
Copy link
Contributor Author

(BTW feel free to delete the link to the Discord message, or to make any changes. Just wanted to submit this PR in case it could save other folks some time.)

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Great! Thanks for the update @tinymachine 💯

@shilman shilman added addon: contexts addon: docs patch:yes Bugfix & documentation PR that need to be picked to main branch labels Mar 12, 2020
@shilman shilman added this to the 5.3.x milestone Mar 12, 2020
@shilman shilman merged commit 749dea5 into storybookjs:next Mar 12, 2020
@shilman shilman added documentation patch:done Patch/release PRs already cherry-picked to main/release branch and removed addon: docs labels Mar 12, 2020
shilman added a commit that referenced this pull request Mar 14, 2020
Docs: add detail to addon-contexts per-story settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: contexts 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.

2 participants