chore: update color scheme handling for React Native 0.87 compatibility - #628
Conversation
📝 WalkthroughWalkthroughThe configuration now selects React Native color-scheme values by version. It applies the typed value when reading appearance state, handling appearance changes, and setting system or explicit themes. ChangesColor-scheme compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 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 SummaryUpdates native color-scheme reset handling for React Native 0.87 while preserving compatibility with older supported releases.
Confidence Score: 4/5The PR appears safe to merge, with the non-blocking concern that its React Native 0.87 compatibility branch is not covered by the current React Native 0.86 test setup. The implementation preserves the existing behavior for current dependencies and introduces no established runtime defect, but a regression specific to the new version boundary could pass CI unnoticed. Files Needing Attention: packages/uniwind/src/core/config/config.common.ts
|
| Filename | Overview |
|---|---|
| packages/uniwind/src/core/config/config.common.ts | Adds version-dependent system color-scheme reset tokens and legacy value normalization; the new 0.87-only path is not exercised by current tests. |
Reviews (1): Last reviewed commit: "chore: update color scheme handling for ..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/uniwind/src/core/config/config.common.ts`:
- Line 56: Normalize the result of Appearance.getColorScheme() in the config
initialization flow before assigning colorScheme, converting the React Native
'unspecified' value to the established light/default scheme normalization used
by UniwindConfigBuilder. Reuse that existing normalization symbol rather than
duplicating the mapping, and add a regression test covering initial style lookup
when the runtime reports 'unspecified'.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d0d74e4e-135d-44a4-aa92-40e126c0cfc4
📒 Files selected for processing (1)
packages/uniwind/src/core/config/config.common.ts
|
🚀 This pull request is included in v1.11.0. See Release v1.11.0 for release notes. |
React Native 0.87 narrowed
ColorSchemeNameto'light' | 'dark'and deprecated the'unspecified'override in favour of'auto', which made our existing'unspecified'comparisons fail.This gates the override on the runtime RN version (
'auto'on 0.87+,'unspecified'on 0.82–0.86) and widens the compared value so the'unspecified'branch still narrows correctly for the RN versions that actually report it.Summary by CodeRabbit