Repository navigation
fix(Table): mirror the row-expansion chevron under RTL - #5153
Merged
humbertovirtudes merged 2 commits intoAug 18, 2026
Merged
humbertovirtudes merged 2 commits into
humbertovirtudes merged 2 commits into
Conversation
The row-expansion chevron rotated 90deg on expand with no RTL handling at all, so the glyph pointed the same direction regardless of text direction. Flagged by the weekly full-suite RTL audit (meta#5141, D1 icon-mirror) against TableRowExpansion and TreeList. TreeListItem's chevron already has the correct pattern for this exact shape (rotate + directional glyph): fold the RTL mirror into each state's own transform rather than a separate wrapper, since both are `transform` and a later declaration on the same element would win. Applied the identical pattern here. Also fixed the context-menu action's icon, which swaps between chevronDown (expanded, no mirroring needed) and chevronRight (collapsed, directional) instead of rotating -- chevronRight needs rtlStyles.mirror in the collapsed state, matching the convention used by Pagination/Carousel/Lightbox/Calendar for static directional chevrons. TreeList's own instance already has the correct mirror (verified: it is the only chevron render site in that directory, landed in meta#4838, uses the exact fold-into-transform pattern this PR now matches) -- the audit's "treelist" finding may be stale or probing a state this source-level check can't reproduce; nothing to fix there that I could find.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
HelloOjasMutreja
marked this pull request as ready for review
August 17, 2026 20:02
HelloOjasMutreja
requested review from
cixzhang,
humbertovirtudes and
imdreamrunner
as code owners
August 17, 2026 20:02
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
August 17, 2026 20:02
Contributor
Author
|
Following up on this with the before/after visual this PR was missing (it's a rendering change, chevron rotation/mirror, so it should have shipped with one originally). Captured from the live RTL, before this fix: the collapsed-row chevron still points right, the same direction as LTR, instead of toward where content actually expands under RTL. RTL, after this fix: the collapsed-row chevron correctly mirrors to point left. LTR, unchanged for reference: |
humbertovirtudes
approved these changes
Aug 18, 2026
humbertovirtudes
left a comment
Contributor
There was a problem hiding this comment.
Great fix thanks for the contribution!
humbertovirtudes
enabled auto-merge (squash)
August 18, 2026 22:28
Contributor
|
Can you help address the failed checks ? |
This branch was successfully 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.



Summary
Closes the
tablerowexpansionfinding in #5141 (weekly full-suite RTL audit, D1 icon-mirror).Evidence
useTableRowExpansion.tsx's chevron rotated on expand with zero RTL handling:No
:is([dir="rtl"] *)variant at all, so the directional glyph pointed the same way regardless of text direction.What I checked before fixing
TreeListItem.tsx's chevron is the exact same shape (rotate + directional glyph) and already handles this correctly:with a comment explaining why the mirror is folded into each state's own transform rather than living on a separate wrapper: both are
transform, so on one element the later declaration would win.Fix
Applied the identical pattern to
TableRowExpansion's chevron:chevronExpanded/chevronCollapsedvariants, applied unconditionally based on state (matchingTreeListItem's JSX callsite pattern) instead of the previousisExpanded && expansionStyles.chevronExpanded.Also fixed a second, separate chevron in the same file: the row's context-menu action icon swaps between
chevronDown(expanded, no mirroring needed since down is direction-agnostic) andchevronRight(collapsed, directional) instead of rotating. AppliedrtlStyles.mirrorto the collapsed state, matching the convention already used for static directional chevrons inPagination,Carousel,Lightbox, andCalendar.On the
treelistfinding in #5141Checked:
TreeListItem.tsxis the only chevron render site anywhere underTreeList/, and it already has the exact fold-into-transform mirror pattern (landed in #4838, well before this audit run). I couldn't find anything to fix there. The audit'streelistfinding may be stale relative to that PR, or probing a state (e.g. an item this specific run's story couldn't expand) that a source-level check can't reproduce. Flagging this rather than guessing at a fix for code that already looks correct.Test notes
Existing
useTableRowExpansion.test.tsxsuite (13 tests) passes unchanged. This codebase verifies RTL mirroring via the separate Storybook-basedrtl-audit.mjstool rather than per-component unit tests (confirmed: evenTreeListItem, the reference-correct implementation, has no RTL-specific unit test), so I didn't invent a new test type here, staying consistent with that convention. Verification is source-level: the new code is an exact match ofTreeListItem's already-shipped, already-audited-clean pattern.Test plan
vitest runonuseTableRowExpansion.test.tsx: 13/13 passing (no regression)eslintclean on touched filetsc --noEmit: no new errors (four pre-existing, unrelatedrenderExpandederrors confirmed present on unmodifiedupstream/maintoo)TreeListItem.tsx's identical, already-shipped fix