Repository navigation
fix(graphics): make default text colors portable - #3174
Open
Jason Morse (JasonVMo) wants to merge 1 commit into
Open
Jason Morse (JasonVMo) wants to merge 1 commit into
Jason Morse (JasonVMo) wants to merge 1 commit into
Conversation
Define the shared text-color factory through the selected graphics backend so Android and generic C++ link without the Apple implementation. Preserve Apple's existing semantic label color and cover the factory in ColorTest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ea5c72-8bbd-448d-aa21-c9b99dd03c96
Author
|
Additional validation: the six independent main fixes (#3170–#3175) were combined at e9667492e9 in an isolated worktree. After regenerating Pods from packages/rn-tester, RNTester-macOS and RNTester for arm64/x86_64 iOS simulators both built successfully. Exact commands, corrected codegen invocation, and limitations are recorded in #3175 (integration validation comment). This is build evidence, not live UI or sanitizer qualification; no PR was merged. |
This branch has not been 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:
The shared
TextAttributes::defaultTextAttributes()callsdefaultForegroundTextColor(), but its only definition is in Apple'sHostPlatformColor.mm. Android and generic C++ graphics builds do not compile that file and cannot link the default text attributes.Color.cppand delegate to the selected graphics backend. Android/C++ keep their upstream opaque-black default, including generic C++ builds hosted on macOS.labelColorbehavior unchanged, including iOS: fix(fabric): Switch default Text color to labelColor #2878 explicitly intended the existing Paper behavior on both Apple platforms.ColorTest.cppsuite. This repairs a fork-only helper; an upstream product change or application-layer workaround would not resolve the missing symbol.Test Plan:
Standalone compiler validation used Apple Clang 21/Xcode 26.4.1 and GoogleTest v1.16.0 restored into a disposable worktree-local harness after the first compile reported missing
gtest/gtest.h. No Pods or original-checkout dependencies were modified..color-validation/color-test-cxx— passed, 2/2 tests..color-validation/color-test-android— passed, 2/2 tests using the Android color backend hosted on macOS, not an Android device/NDK build..color-validation/color-test-apple— passed, 2/2 tests using the actual Apple graphics sources, actual RCTUIKit headers, and an AppKit-initialized GoogleTest runner.Color.cpp— expected link failure, undefinedfacebook::react::defaultForegroundTextColor()..color-validation/default-color-cxxand.color-validation/default-color-android— passed, both equalblackColor()..color-validation/apple-default-color— passed, the actual factory still equalsNSColor.labelColorunder Aqua, DarkAqua, accessibility Aqua, and accessibility DarkAqua; light and dark results remain different.traitCollectionWithTraitsFromCollections:deprecation warnings.git diff --check— passed.xcrun clang-format --output-replacements-xml --lines=<changed ranges> <file>checks — passed, zero replacements across all six files. Whole-filexcrun clang-format --dry-run --Werrorfailed on existing formatting outside the changes; those lines were not reformatted.Exact standalone suite compiler commands
The worktree-local
Reactheader-search symlink points at the repository's actualpackages/react-native/ReactApple/Libraries/RCTUIKitdirectory. The Apple runner only calls[NSApplication sharedApplication], initializes GoogleTest, and runs its tests.Not run: CocoaPods/Xcode/RNTester integration or Paper builds, Android NDK/device integration, iOS/visionOS runtime, Metro, and JS Jest/Flow/lint/format suites (no JS changes). No UI behavior changes are intended on Apple platforms, so no UI screenshots are included.