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

Viewport: Store viewport, rotation in globals #25423

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

shilman
Copy link
Member

@shilman shilman commented Jan 3, 2024

Closes N/A

Redo of #23448

What I did

Instead of storing the viewport & rotation in addon state, store them in globals.

This has two benefits:

  1. users can now set the viewport via globals URL parameters:
    a. viewport controls device settings
    b. viewportRotated controls device orientation
  2. gets us a step closer to using globals across our toolbar addons

How to test

  1. Fire up a sandbox
  2. Adjust the viewports in Page stories & note URL changes
  3. Navigate between stories
  4. Navigate to the viewport stories in the sandbox and do the same

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

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

@shilman shilman marked this pull request as ready for review January 3, 2024 06:45
@shilman shilman added ci:daily Run the CI jobs that normally run in the daily job. and removed ci:normal labels Jan 3, 2024
@yannbf
Copy link
Member

yannbf commented Jan 3, 2024

Hey @shilman seems like the viewports shortcut doesn't work as intended, it won't circle through viewports as you press V.

from next:

from this PR:

@shilman
Copy link
Member Author

shilman commented Jan 3, 2024

Good catch @yannbf -- fixed!

@shilman shilman merged commit ff54894 into next Jan 3, 2024
18 of 29 checks passed
@shilman shilman deleted the shilman/viewport-globals-third branch January 3, 2024 14:45
@github-actions github-actions bot mentioned this pull request Jan 3, 2024
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: viewport ci:daily Run the CI jobs that normally run in the daily job. feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants