feat(Android, Stack v5): expose contentInsetStart, contentInsetEnd for toolbar - #4516
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Android toolbar content inset customization for stack headers, exposing start/end inset props through the JS types and wiring them into the native toolbar layout.
Changes:
- Added
contentInsetStart/contentInsetEndprops to the Android StackHeader config (TS + Fabric native component). - Implemented native invalidation + applicator logic to apply toolbar content insets.
- Updated the Android subviews test scenario and UI to exercise content insets and menu-item interactions.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/fabric/stack/StackHeaderConfigAndroidNativeComponent.ts | Exposes new Fabric props for toolbar content insets. |
| src/components/stack/header/StackHeaderConfig.android.types.ts | Documents and types new Android-only props. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-subviews-android/scenario.md | Expands scenario notes to cover inset behavior and interactions. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-subviews-android/index.tsx | Adds UI controls to set insets and menu items for manual verification. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderInvalidationFlags.kt | Introduces a new invalidation flag for inset updates. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderConfigurationProviding.kt | Adds inset values to the configuration provider contract. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderConfigViewManager.kt | Bridges inset props from JS to native config. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderConfig.kt | Stores inset values and triggers invalidation when they change. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/appbar/StackHeaderAppBarLayout.kt | Attempts to capture Material default insets for fallback behavior. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/StackHeaderCoordinatorLayout.kt | Applies inset updates when invalidated. |
| android/src/main/java/com/swmansion/rnscreens/stack/header/StackHeaderApplicator.kt | Applies insets to the MaterialToolbar using dp→px conversion. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6c6e0f7 to
4a69bf5
Compare
There was a problem hiding this comment.
Updating the example, shouldn't we consider updating the scenario as well? For now, testing this property might be omitted by accident.
There was a problem hiding this comment.
The scenario doesn't contain any steps yet because we've been adding new features that impact how subviews are laid out after this test was created and it would get outdated pretty quickly.
I thought about creating separate SFT for insets only but I decided that most of it would be just a repeat of the subviews test so I'm not sure if that's necessary. But if you think we should create it, I can do so - let me know.
There was a problem hiding this comment.
We can note that down and add the test later, I think we shouldn't leave coverage gaps, but it's non-blocking comment
2003dc6 to
1377b3a
Compare
1377b3a to
3d5a397
Compare
3d5a397 to
c03d041
Compare
c03d041 to
8ac268f
Compare
8ac268f to
2ea0731
Compare
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
2ea0731 to
5113aa5
Compare
5113aa5 to
0a27b69
Compare
Description
Exposes
contentInsetStart,contentInsetEndprops to control the content inset. It can be used as a workaround for brokenentireSpacegravity mode. More info in #4387.Closes https://github.com/software-mansion/react-native-screens-labs/issues/1742.
Changes
StackHeaderAppBarLayoutand use them when no value is providedBefore & after - visual documentation
4516.mp4
Test plan
Run
test-stack-header-content-insets-android,test-stack-subviews-android.Checklist
Stack created with GitHub Stacks CLI • Give Feedback 💬