UI: Fix controls expander and select chevron overlap in RTL#35509
UI: Fix controls expander and select chevron overlap in RTL#35509TheSeydiCharyyev wants to merge 1 commit into
Conversation
The section expander used physical margins and the select control used physical padding with a right-pinned background chevron, so under dir=rtl the icons overlapped the heading and value text (storybookjs#35481). Switch them to logical properties; the select's fallback chevron is a background image with no logical equivalent, so mirror its position to the inline-start under RTL, while the base-select path already flips via flexbox.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe changes add RTL-aware spacing for ChangesRTL support
Estimated code review effort: 2 (Simple) | ~10 minutes Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #35481
What I did
Several Controls/Manager UI elements used physical CSS properties, so under
dir="rtl"their icons overlapped the adjacent text:SectionRow) usedmargin-left/margin-right, so the expand chevron stayed on the heading's left and overlapped the category label in RTL. Switched tomargin-inline-start/margin-inline-end.Form/Select) usedpadding: 6px 30px 6px 10pxto reserve room for its chevron. Switched topadding-inline-*. The fallback chevron is a background image (background-position: calc(100% - 12px)), which has no logical-property equivalent, so its position is mirrored to the inline-start under RTL via&:dir(rtl). The modernappearance: base-selectpath already lays the chevron out with flexbox and flips automatically, so it needs no change (and the physical→logical padding is overridden there).Added RTL stories (
SectionRow→ Section Rtl,Form/Select→ Rtl) so the RTL layout is covered by Chromatic.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
cd code && yarn storybook:ui) or a sandbox.document.documentElement.dir = 'rtl'in the preview DevTools console to flip the whole UI and confirm the args table and select controls lay out correctly.Documentation
No documentation changes needed — this is a CSS-only layout fix.
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake 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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit
Bug Fixes
Tests