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

UI: Improve how the addon panel work on mobile #25787

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

cdedreuille
Copy link
Contributor

@cdedreuille cdedreuille commented Jan 29, 2024

What I did

Closes #24424

On the new mobile layout we used to show the addon panel above the canvas. In cases where you use layout: centred the addon panel would hide quite a large part of the UI. To fix that, I replicated the desktop behaviour and made the addon panel appear below the canvas.

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 section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-25787-sha-ce3d85aa. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-25787-sha-ce3d85aa
Triggered by @yannbf
Repository storybookjs/storybook
Branch charles-fix-mobile-addon-panel
Commit ce3d85aa
Datetime Mon Jan 29 11:38:07 UTC 2024 (1706528287)
Workflow run 7695438461

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=25787

@cdedreuille cdedreuille added ui maintenance User-facing maintenance tasks ci:daily Run the CI jobs that normally run in the daily job. labels Jan 29, 2024
@cdedreuille cdedreuille self-assigned this Jan 29, 2024
@cdedreuille cdedreuille requested review from yannbf and removed request for tmeasday and ndelangen January 29, 2024 11:39
Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

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

A few code suggestions, nothing big.

However it poses a problem with large preview sizes, caused by long preview content or just using a large viewport setting. The addon panel won't shrink/cover the preview at all, so if there's no room for preview+panel in the current viewport, the panel just won't show. I think we need to do something about that, I'm not sure what though. Perhaps give the addon panel a min height, and let the preview shrink (scrollable) in that case?

Try this with the "Large mobile" viewport in a small browser window to see how the panel behaves.

https://635781f3500dd2c49e189caf-dyvcpiiyww.chromatic.com/?path=/story/blocks-examples-stories-for-the-canvas-block--layout-centered&globals=viewport:mobile2

@cdedreuille cdedreuille merged commit 0b53fa0 into next Jan 30, 2024
103 of 105 checks passed
@cdedreuille cdedreuille deleted the charles-fix-mobile-addon-panel branch January 30, 2024 11:43
@github-actions github-actions bot mentioned this pull request Jan 30, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:daily Run the CI jobs that normally run in the daily job. maintenance User-facing maintenance tasks ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If the height is set on preview, and the height of the window is smaller, you don't see the mobile navigation
2 participants