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: Save from controls #26827

Merged
merged 218 commits into from May 2, 2024
Merged

Core: Save from controls #26827

merged 218 commits into from May 2, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Apr 12, 2024

Closes #26657

What I did

  • Add a backend node API utilizing the serverChannel to allow the frontend to save args to story files, as well as to create a clone of the current story with updated args.
  • Add new UI to the control addon panel, a bottom bar that's shown when args have deviated via controls.
  • A new generic component: the Modal.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This feature only works with stories defined in CSF3!

  • Create a sandbox (or upgrade a storybook to the canary)
  • Verify you have a story file written in CSF3 (it must have controls and args)
  • Visit that story in dev mode
  • Edit the controls
  • Expect a new bar at the bottom of the controls panel to appear.
  • Press the "Save/Update" button.
  • Expect your story file to have changed, no errors in the browser console, no errors in the node terminal.
  • Press the "Clone/Duplicate" button.
  • Expect a new story to be written to the bottom of the file.

Documentation

I don't think this feature needs to have any explicit documentation in the docs website, but we should promote this feature, when it is shipped. cc @kylegach

🦋 Canary release

This pull request has been released as version 0.0.0-pr-26827-sha-9b2b60fc. Try it out in a new sandbox by running npx storybook@0.0.0-pr-26827-sha-9b2b60fc sandbox or in an existing project with npx storybook@0.0.0-pr-26827-sha-9b2b60fc upgrade.

More information
Published version 0.0.0-pr-26827-sha-9b2b60fc
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch save-from-controls
Commit 9b2b60fc
Datetime Tue Apr 30 20:14:12 UTC 2024 (1714508052)
Workflow run 8901019902

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=26827

ghengeveld and others added 30 commits April 2, 2024 08:45
…preset. add scaffolding for save-from-controls
…refactor its API for simplicity and use it for SaveFromControls
ndelangen and others added 27 commits April 29, 2024 17:45
@ndelangen ndelangen merged commit 84b322b into next May 2, 2024
61 checks passed
@ndelangen ndelangen deleted the save-from-controls branch May 2, 2024 07:36
@github-actions github-actions bot mentioned this pull request May 3, 2024
44 tasks
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.

[Project SfC]: Create a server channel API to edit the args of a story or to create a new story
5 participants