Skip to content

chore: update color scheme handling for React Native 0.87 compatibility - #628

Merged
jpudysz merged 1 commit into
mainfrom
feature/color-scheme
Aug 12, 2026
Merged

chore: update color scheme handling for React Native 0.87 compatibility#628
jpudysz merged 1 commit into
mainfrom
feature/color-scheme

Conversation

@jpudysz

@jpudysz jpudysz commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

React Native 0.87 narrowed ColorSchemeName to '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

  • Bug Fixes
    • Improved color-scheme handling across supported React Native versions.
    • Ensured appearance state and system theme settings use the appropriate behavior for each version.

@jpudysz
jpudysz requested a review from Brentlok August 12, 2026 10:52
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Color-scheme compatibility

Layer / File(s) Summary
Version-aware appearance configuration
packages/uniwind/src/core/config/config.common.ts
Defines RNColorScheme and selects 'auto', 'unspecified', or undefined by React Native version. Appearance reads, change events, and theme updates use the selected value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • uni-stack/uniwind#331: Adds the earlier React Native version-aware color-scheme handling refined by this change.

Suggested reviewers: brentlok

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the React Native 0.87 color scheme compatibility change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/color-scheme

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

Updates native color-scheme reset handling for React Native 0.87 while preserving compatibility with older supported releases.

  • Selects 'auto', 'unspecified', or undefined according to the runtime React Native minor version.
  • Widens internal color-scheme comparisons so older runtimes reporting 'unspecified' continue to normalize to light.
  • Leaves the new React Native 0.87 branch without automated coverage.

Confidence Score: 4/5

The 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

Important Files Changed

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.

Fix All in Claude Code Fix All in Codex

Reviews (1): Last reviewed commit: "chore: update color scheme handling for ..." | Re-trigger Greptile

Comment thread packages/uniwind/src/core/config/config.common.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 005b94f and 66c5db4.

📒 Files selected for processing (1)
  • packages/uniwind/src/core/config/config.common.ts

Comment thread packages/uniwind/src/core/config/config.common.ts
@jpudysz
jpudysz merged commit 7611bf0 into main Aug 12, 2026
3 checks passed
@jpudysz
jpudysz deleted the feature/color-scheme branch August 12, 2026 15:26
@github-actions

Copy link
Copy Markdown
Contributor

🚀 This pull request is included in v1.11.0. See Release v1.11.0 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants