Repository navigation
fix(ui): mirror directional chevrons in right-to-left layouts - #913
Open
rkj-builds wants to merge 1 commit into
Open
rkj-builds wants to merge 1 commit into
rkj-builds wants to merge 1 commit into
Conversation
Submenu triggers in Menu, ContextMenu and DrawerMenu, Pagination Previous/Next, and the default Breadcrumb separator draw physical ChevronLeft/ChevronRight icons. In RTL the submenu already opens to the left (MenuSubPopup uses side="inline-end"), yet its chevron still points right; Previous points toward the next page; breadcrumb separators point back toward the root. Add rtl:rotate-180 to these icons, the same treatment Calendar already gives its navigation chevrons. Non-directional icons (ChevronsUpDown, the accordion ChevronDown) and custom separator children are left alone. LTR is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@rkj-builds is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In short
In a right-to-left layout (Arabic, Hebrew), five components still draw their chevrons pointing the left-to-right way: the Menu, ContextMenu and DrawerMenu submenu triggers, Pagination, and the default Breadcrumb separator. So the submenu chevron points away from the submenu it opens, and the pagination and breadcrumb arrows point backwards.
The fix adds
rtl:rotate-180to those six icons, the same class Calendar already uses. Left-to-right layouts don't change.What to look at in the screenshots: the "More" submenu opens to the left in RTL, and its chevron now points that way. Pagination's Next and Previous arrows, and the breadcrumb arrows, now point the way you move.
What happens today
coss already ships
DirectionProvider(@coss/ui/base-ui/direction-provider), and Calendar flips its navigation chevrons withrtl:rotate-180. Five other places draw a physicalChevronLeft/ChevronRightand do not flip:MenuSubPopupusesside="inline-end", so in RTL the submenu correctly opens to the left. The trigger's chevron still points right, away from the panel it opens.To reproduce: render any of these inside
<DirectionProvider direction="rtl">withdir="rtl"on<html>.What this changes
Adds
rtl:rotate-180to those six icons, the same class Calendar uses. Nothing else changes:ChevronsUpDownin Select, Combobox and Autocomplete, and the AccordionChevronDown) are left as they are.BreadcrumbSeparatoronly flips its default icon. If you pass your ownchildren(a/, for example), it renders untouched.rotateisnoneboth before and after.Files:
registry/default/ui/{menu,context-menu,drawer,pagination,breadcrumb}.tsx. Their mirrors inpackages/ui/src/components/andpublic/r/*.jsonwere regenerated withregistry:buildandui:sync. The unrelatedp-*.jsonchurn thatregistry:buildproduces onmainwas reverted.Before / after (RTL)
›More‹More› Next … Previous ‹‹ Next … Previous ›Breadcrumb › Components › HomeBreadcrumb ‹ Components ‹ HomeThe screenshots are above.
Checks actually run
DirectionProvider, withhtml[dir]set. A Playwright/Chrome script (repro-shot.mjs) read the computedrotateof each icon and where the submenu sits relative to its trigger:rotate: nonerotate: 180degrotate: none; submenu opens rightbun run typecheck(apps/ui): passed.bun run lint(apps/ui): no findings in the touched files. The warnings it does print are already onmain, inuse-composer-editor.ts.biome checkon the touched files: clean. The husky and lint-staged hook ran on commit.Alongside the open RTL work
This touches different lines from #892 (drawer animations and swipe). The only overlap is the generated
public/r/drawer.json, so whichever lands second just needsregistry:buildre-run. It fits with the docs RTL toggle in #910, too: every chevron changed here is visible from that toggle.Rebased on
main@ 3d8ca28 (#909);typecheckandbiome checkre-run on the touched files.