feat(iOS, Stack v5): Add background and shadow appearance colors - #4683
juliusmarminge wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change adds iOS header background and shadow color support for standard and scroll-edge appearances. It updates public types, JavaScript-to-native color mapping, UIKit appearance handling, and adds a registered manual test scenario. ChangesiOS Header Bar Colors
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant TestScenario
participant StackHeaderConfig
participant RNSStackHeaderAppearanceMapper
participant UINavigationBarAppearance
TestScenario->>StackHeaderConfig: select standard or scroll-edge colors
StackHeaderConfig->>RNSStackHeaderAppearanceMapper: pass processed appearance values
RNSStackHeaderAppearanceMapper->>UINavigationBarAppearance: apply background and shadow colors
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 6 files. (2 skipped: 2 unsupported.)
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 |
|
Reviewed CodeRabbit's result for The function-docstring coverage warning does not measure the new public appearance properties. Both properties have summary, behavior/default and platform documentation in StackHeaderAppearanceIOS. The native helper also explains material removal and dynamic-color preservation inline. Private serialization helpers and scenario components follow the neighboring code's style, so I am retaining those concise docs rather than adding comments that repeat the component logic solely for the function-coverage metric. All seven GitHub Actions workflows require maintainer approval and have not run. The CI checklist remains unchecked. The mixed opaque-standard/transparent-edge rendering observation and the downstream companion policy gate are still disclosed in the description; passing mapper assertions and the CodeRabbit status do not clear those gates. |
Description
Stack v5's iOS appearance object exposes text attributes but cannot set the navigation bar's background or shadow colors. This adds UIKit's two related bar colors to the existing standard and scroll-edge appearance objects.
Changes
ColorValuebackground and shadow colors toStackHeaderAppearanceIOS, with matching processed-color Fabric types and JS serialization.RCTConvert UIColorinRNSStackHeaderAppearanceMapper. An explicit background replaces the default background material and preserves alpha and dynamic colors. Omitted fields preserve each appearance's UIKit defaults.Existing appearance replacement creates fresh objects and clears the navigation-item appearance when omitted or empty, rather than retaining removed colors.
Before & after - visual documentation
Actual library base
7db05401d0d25f37143d875488c7a5a1b1720248versus heade2eddbd5d2b28670ec811eaff0bf371039dccba8, using the same example, device, data and gestures on iOS 18.6. The new fields are ignored by the baseline.Observed rendering limitation: after scrolling with an opaque standard appearance, selecting a transparent scroll-edge appearance leaves the standard sky-blue background visible at the top on iOS 18.6 and 26.5, while its shadow disappears. A live UIKit inspection confirmed clear edge background/shadow properties and the registered scroll view at its adjusted top inset. Edge-only opaque and transparent colors work with standard omitted. This mixed combination still needs UIKit/maintainer investigation; I am not claiming complete visual independence for it. The PR preserves automatic scroll-edge effects.
Test plan
Run
TestStackHeaderBarColorsIOSfromapps/App.tsx, or select Stack Header Bar Colors (iOS) in the Stack v5 scenarios. Follow the includedscenario.mdto compare standard and scroll-edge presets and remove/reset properties.Local validation:
yarn check-types, focused example type check, andyarn prepareCommonJS/module/declaration builds passed.git diff --checkpassed. React Doctor scored 100/100.Native test sources, original result summaries and reproduction notes. The temporary test-target setup and evidence are outside git.
CI is currently blocked on maintainer approval for all seven GitHub Actions workflows. The CI checklist remains unchecked. CodeRabbit completed with no actionable inline comments; its function-docstring coverage warning is addressed in the review follow-up comment.
Downstream API gate
The contribution guide requests a React Navigation companion for new APIs. Native-stack at current React Navigation main still uses v4
ScreenStack/ScreenStackItem, as does Screens' pinned submodule. It has no Stack v5 appearance option to extend. Current v4 consumers are unaffected.A separate focused companion proposal is prepared for the v5 consumer. Maintainers need to confirm deferral until v5 adoption or identify an active downstream v5 branch to receive it. No downstream implementation PR has been opened, and this policy gate remains outstanding.
Checklist