-
Notifications
You must be signed in to change notification settings - Fork 206
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
feat: locale picker in the storybook's decorator #4687
Conversation
Branch preview |
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Tachometer resultsCurrently, no packages are changed by this PR... |
It looks like on iPad and mobile the user has a hard time using these controls from the Storybook decorator. Should we place some of them in a Action Menu? After checking it out, it seems like the submenu feature of the ActionMenu doesn't work on mobile. I've been checking it out here: https://opensource.adobe.com/spectrum-web-components/storybook/index.html?path=/story/action-menu--submenu |
There seems to be an inconsistent behavior: when you toggle "Reduce motion," the picker displays "Locale" instead of the selected value. Could you please check what's causing this? :) Screen.Recording.2024-08-27.at.12.08.39.mov |
Thank you for looking into this. Missed a small |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👍 Let's 🚢 it.
Pull Request Test Coverage Report for Build 10697715122Details
💛 - Coveralls |
--------- Co-authored-by: Rúben Carvalho <rubcar@sapo.pt>
Description
This PR adds a new control in the storybook decorator that helps the user change the language/locale.
In order to leverage the interaction of
sp-theme
andLanguageResolutionController
in the storybook it is needed to use a workaround similar torequestAnimationFrame
so that the story functions get called after theTheme
's constructor.For more context please check out this PR comment.
Motivation and context
Currently if a component is reactive to locale/language changes, in order for the storybook to reflect that it is needed for multiple stories to be created. This doesn't scale as well and it's also cumbersome for users of the SWC storybook to clearly identify the differences between locales.
Currently the most notable behavior change is in the
sp-number-field
component.How has this been tested?
Test case 1
sp-number-field
storybookTest case 1
sp-number-field
storybookDid it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.