feat: support rtl safe area classes#589
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdded logical safe-area utilities for margin, padding, and positioning, with RTL-aware CSS generation, RN inset property translation, and updated native test coverage. The safe-area reference tables now include the new logical variants. ChangesLogical safe-area utilities
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR adds RTL-aware logical safe area CSS utility classes (
Confidence Score: 5/5Safe to merge — the new logical safe area utilities are correctly generated, the RN property mapping is accurate, and the tests use asymmetric left/right inset values that would catch any swap in the LTR/RTL logic. The generator, the RN processor, the CSS output, and the tests are all internally consistent. The logical inset resolution (start→left in LTR, start→right in RTL) is correct, the RTL variant blocks in the CSS swap env values as expected, and the explicit insetInlineStart/insetInlineEnd checks in rn.ts prevent any ambiguity with other inset-bearing property names. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["insets.ts generateCSSForInsets()"] --> B["logicalSides loop ['start', 'end']"]
B --> C["getLogicalStyleProperty() margin/padding/inset-inline-start/end"]
B --> D["getLogicalInset() start→left(LTR)/right(RTL), end→right(LTR)/left(RTL)"]
B --> E["getLogicalUtilityName() ms- / me- / ps- / pe- / start- / end-"]
C & D --> F["getStylesForSafeAreaType() safe / safe-or-* / safe-offset-*"]
F --> G["Emit @utility block LTR styles + @variant rtl block"]
G --> H["uniwind.css 18 new utilities"]
H --> I["Web: margin-inline-start etc."]
H --> J["RN CSS Processor rn.ts cssToRN()"]
J --> K{contains 'inset'?}
K -- insetInlineStart --> L["→ 'start'"]
K -- insetInlineEnd --> M["→ 'end'"]
J --> N{contains 'padding'/'margin'?}
N -- InlineStart --> O["→ paddingStart / marginStart"]
N -- InlineEnd --> P["→ paddingEnd / marginEnd"]
L & M & O & P --> Q["React Native StyleSheet"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["insets.ts generateCSSForInsets()"] --> B["logicalSides loop ['start', 'end']"]
B --> C["getLogicalStyleProperty() margin/padding/inset-inline-start/end"]
B --> D["getLogicalInset() start→left(LTR)/right(RTL), end→right(LTR)/left(RTL)"]
B --> E["getLogicalUtilityName() ms- / me- / ps- / pe- / start- / end-"]
C & D --> F["getStylesForSafeAreaType() safe / safe-or-* / safe-offset-*"]
F --> G["Emit @utility block LTR styles + @variant rtl block"]
G --> H["uniwind.css 18 new utilities"]
H --> I["Web: margin-inline-start etc."]
H --> J["RN CSS Processor rn.ts cssToRN()"]
J --> K{contains 'inset'?}
K -- insetInlineStart --> L["→ 'start'"]
K -- insetInlineEnd --> M["→ 'end'"]
J --> N{contains 'padding'/'margin'?}
N -- InlineStart --> O["→ paddingStart / marginStart"]
N -- InlineEnd --> P["→ paddingEnd / marginEnd"]
L & M & O & P --> Q["React Native StyleSheet"]
Reviews (1): Last reviewed commit: "feat: support rtl safe area classes" | Re-trigger Greptile |
#587
Summary by CodeRabbit
New Features
Bug Fixes
Documentation