feat(iOS, Stack v5): Add menuRepresentation prop to header items - #4587
feat(iOS, Stack v5): Add menuRepresentation prop to header items#4587kmichalikk wants to merge 2 commits into
menuRepresentation prop to header items#4587Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds an optional ChangesiOS menu representation
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The change adds iOS header menu representation support and associated scenario coverage. No concrete unresolved merge-readiness risk is identified. Sequence Diagram(s)sequenceDiagram
participant HeaderConfig
participant StackHeaderItem
participant NativeComponent
participant HeaderCoordinator
participant UIBarButtonItem
HeaderConfig->>StackHeaderItem: pass menuRepresentation
StackHeaderItem->>NativeComponent: pass resolved menuRepresentation
NativeComponent->>HeaderCoordinator: update header item
HeaderCoordinator->>UIBarButtonItem: apply menuRepresentation
UIBarButtonItem-->>HeaderCoordinator: invalidate menu representation
HeaderCoordinator->>UIBarButtonItem: reapply menuRepresentation
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 10 files. (1 skipped: 1 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 |
| ## E2E test | ||
|
|
||
| Full: Covers all manual scenario steps. | ||
| Partial: Covers all manual scenario steps except the **Menu representation** section. |
There was a problem hiding this comment.
Please keep wording agreed for E2E test/coverage in RFC-1076 -> Full/Incomplete/TBD
| Partial: Covers all manual scenario steps except the **Menu representation** section. | |
| Incomplete: Covers all manual scenario steps except the **Menu representation** section. |
| - Menu representation section requires iOS >= 16 | ||
| - On iOS 18, items don't go into overflow by default, UIKit attempts to pack them all into header, test `menuRepresentation` on iOS 26+ |
There was a problem hiding this comment.
If on second bullet we say that menuRepresentation should be tested on iOS26+, does first point make sense here?
|
|
||
| ## Prerequisites | ||
|
|
||
| - iOS / iPadOS emulator |
There was a problem hiding this comment.
I know it was not changed in this PR but we can unify it with most of iOS scenarios.
Also I removed iPadOS from list as there are only steps for iPhone in this scenario.
| - iOS simulator or device |
| 6. Click Repr 1 Radio 2 | ||
| - [ ] A toast "Repr 1 selected "repr-radio-1-2"" is displayed | ||
| - [ ] When reopened, Repr 1 Radio 2 is checked and Radio 1 is not | ||
| 7. Open Repr 2 |
| - [ ] Two items moved to overflow menu | ||
| 4. Open the overflow menu | ||
| - [ ] Overflowed items appear as **Repr #** submenus | ||
| - [ ] Custom items are represented in the same way |
There was a problem hiding this comment.
I'm not really sure what I should see and check here?
| - [ ] A toast "Repr 1 selected "repr-radio-1-2"" is displayed | ||
| - [ ] When reopened, Repr 1 Radio 2 is checked and Radio 1 is not | ||
| 7. Open Repr 2 | ||
| - [ ] It contains three radio items, Repr 2 Radio 1 is selected by default |
There was a problem hiding this comment.
Here also it should be corrected
| - [ ] It contains three radio items, Repr 2 Radio 1 is selected by default | |
| - [ ] It contains three radio items, Repr 0 Radio 1 is selected by default |



Closes https://github.com/software-mansion/react-native-screens-labs/issues/1179
Description
This PR adds
menuRepresentationprop to leading and trailing header items. This allows for specifying different menu definition for when the item is moved to the overflow menu.Without this prop:
menu(if specified) andonPressaction (if specified) and combines them. This may break UI if, for instance, the menu consists only of radio buttons - theonPressaction would be added nonethelessImportant
The feature is testable on iOS 26+. Below this version, items never go into overflow menu, unless the overflow menu is already present, or other conditions are met (interface style + specific item groups setup - not supported in foreseeable future)
Changes
menuRepresentationprop and wired it the same asmenuBefore & after - visual documentation
menu-representation.mov
Test plan
Use Stack Header Menu (iOS) SFT
Checklist