fix(rtl): use logical spacing/text-align classes instead of physical ones - #749
fix(rtl): use logical spacing/text-align classes instead of physical ones#749swe-sanad wants to merge 1 commit into
Conversation
…ones Safe subset only: ml-/mr- -> ms-/me-, pl-/pr- -> ps-/pe-, text-left/right -> text-start/end. Behavior-preserving for LTR (these resolve to the same physical side when direction is ltr) and correct under dir="rtl". Deliberately does NOT touch left-/right- (positioning), border-l/r (side border width), or transforms (translate-x etc.) -- those can sit right next to a converted class and interact with it in a way that needs a human to look, so a blind swap risks moving something to the wrong place. Converted mechanically with a small script that has its own 15+-case self-test (ml/mr/pl/pr with variant prefixes, negatives, arbitrary values, fractions; verified px-/mx-/left-/right-/border-l-r/ translate-x are never touched), then spot-checked by hand.
Confidence Score: 4/5Fix the mixed physical/logical avatar margins before merging so the viewer stack mirrors correctly in RTL. The broad utility conversion is supported, but ViewerAvatars still combines a physical base margin with a logical hover reset, producing inconsistent RTL spacing. Files Needing Attention: frontend/src/components/ToolbarItems/ViewerAvatars.vue Reviews (1): Last reviewed commit: "fix(rtl): use logical spacing/text-align..." | Re-trigger Greptile |
| <div v-for="user in builderStore.viewers" :key="user.fullname"> | ||
| <Tooltip :text="currentlyViewedByText" :hoverDelay="0.6" arrow-class="mb-3"> | ||
| <div class="ml-[-10px] h-6 w-6 cursor-pointer transition-all group-hover:ml-0"> | ||
| <div class="ml-[-10px] h-6 w-6 cursor-pointer transition-all group-hover:ms-0"> |
There was a problem hiding this comment.
Mixed avatar margin properties
When the viewer stack renders in RTL, the physical ml-[-10px] base margin does not pair with the logical group-hover:ms-0 reset, causing avatars to overlap or expand on inconsistent sides.
| <div class="ml-[-10px] h-6 w-6 cursor-pointer transition-all group-hover:ms-0"> | |
| <div class="ms-[-10px] h-6 w-6 cursor-pointer transition-all group-hover:ms-0"> |
|
Automated review (Claude Code) Overall this is a mechanical Actual bugs
Same class of problem in Padding flipped away from a physically-positioned sibling
One thing to verify globally: The remaining hunks (CommandPalette, LayersTab's This is an automated review and may be wrong — generated by a Claude Code devbox, not a human. |
Problem
Hardcoded physical spacing/text-align classes (
ml-/mr-,pl-/pr-,text-left/text-right) don't mirror whendir="rtl"is applied — margin/padding stays on the same physical side and text stays left/right-anchored regardless of direction.Fix
Safe subset only:
ml-/mr-→ms-/me-,pl-/pr-→ps-/pe-,text-left/right→text-start/end. Behavior-preserving for LTR (these resolve to the same physical side when direction isltr) and correct underdir="rtl".Deliberately does not touch
left-/right-(positioning),border-l/r(side border width), or transforms (translate-xetc.) — those can sit right next to a converted class and interact with it in a way that needs a human to look, so a blind swap risks moving something to the wrong place.How this was done
Converted mechanically with a small script that has its own 15+-case self-test (variant prefixes, negatives, arbitrary values, fractions all covered; verified
px-/mx-/left-/right-/border-l-r/translate-xare never touched), then spot-checked by hand. Zero remainingml-/mr-/pl-/pr-/text-left/text-rightinstances after conversion.