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

fix: Fixes selected story changing when editing the story file #224

Merged

Conversation

lauriharpf
Copy link
Contributor

Issue: #219

What I did

Fixed issue that could be repeated with the following steps:

  1. Run the React Native examples (under examples/native)
  2. Select a story, e.g. "Boolean control - Basic" (Boolean.stories.tsx)
  3. Edit that story file (e.g. change the "on" argument to false in Boolean.stories.tsx)

What happened before this fix

The entire app reloaded and the currently selected story was changed. See video below:

125520359-da2fe881-c503-47b5-b78b-04152ad990aa.mov

What happens now after the fix

The entire app reloads, but the selected story persists. This improves the developer UX (don't need to always re-select the story after changes).

fixed-branch.mov

Unlike PR #222 this also works with stories that are in storiesOf format:

Screen.Recording.2021-07-14.at.18.41.53.mov

How to test

See example steps under "What I did".

  • Does this need a new example in examples/native? no, not in my opinion
  • Does this need an update to the documentation? *no', not in my opinion

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

1. Run the React Native examples (under examples/native)
2. Select a story, e.g. "Boolean control - Basic" (Boolean.stories.tsx)
3. Edit that story file (e.g. change the "on" argument to false in Boolean.stories.tsx)

## What happened before this fix
The entire app reloaded and the currently selected story was changed.

## What happens now after the fix
The entire app reloads, but the selected story persists. This improves the developer UX (don't need to always re-select the story after changes).
Copy link
Member

@dannyhw dannyhw left a comment

Choose a reason for hiding this comment

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

Seems to work well, definitely improves a lot on the current behaviour.

Thanks again 🙏

@dannyhw dannyhw merged commit 4af80ed into storybookjs:next-6.0 Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants