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

Core: Don't include args param in docs mode URL #14494

Merged
merged 2 commits into from Apr 7, 2021
Merged

Core: Don't include args param in docs mode URL #14494

merged 2 commits into from Apr 7, 2021

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Apr 6, 2021

Issue: -

What I did

  • Omit args param on the docs tab, to eliminate some weird behavior when changing args on the docs page while the 2nd or later story is selected.
  • Restore the args param when switching between stories, or navigating from docs to canvas. This means any arg changes made on the docs page will be reflected in the URL when switching back to the canvas.

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

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

@ghengeveld ghengeveld requested a review from shilman April 6, 2021 20:11
@ghengeveld ghengeveld changed the title Don't include URL args in docs mode Core: Don't include URL args in docs mode Apr 6, 2021
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.

Code looks good. I'm not sure I agree with the rationale. Currently what this will do is apply the args to the currently selected story. In the case of DocsPage stories running in --docs mode, this means it will set the controls in ArgsTable and also update the primary (i.e. first) story's args, which makes perfect sense from a UX standpoint. There are plenty of other, more confusing, cases that this fix eliminates. Can we do a quick call to discuss before merging?

@ghengeveld ghengeveld changed the title Core: Don't include URL args in docs mode Core: Don't include args param in docs mode URL Apr 7, 2021
@ghengeveld
Copy link
Member Author

Updated as discussed.

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.

💯

@shilman shilman merged commit 5a9cd8a into next Apr 7, 2021
@shilman shilman deleted the no-docs-args branch April 7, 2021 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants