SIGN IN SIGN UP

feat(Android, Stack v5): add toolbar menu items base implementation to header (#3965)

## Description

Adds skeleton implementation for toolbar menu items support for Stack v5
header on Android.

Closes
https://github.com/software-mansion/react-native-screens-labs/issues/1200.

## Changes

- Added native toolbar menu coordinator and supporting types under
`android/.../gamma/stack/header/toolbar/`:
- `StackHeaderToolbarMenuCoordinator` — builds/updates menu items on the
Material 3 toolbar.
- `StackHeaderToolbarMenuItemConfig` /
`StackHeaderToolbarMenuItemOptions` /
`StackHeaderToolbarMenuItemDefaults`.
- `StackHeaderToolbarMenuItemClickedEvent` — fires
`onToolbarMenuItemClicked` to JS.
- Refactored `OnHeaderConfigChangeListener` into
`StackHeaderConfigDelegate` and added `StackHeaderConfigEventEmitter` so
menu-item updates and events have a clear, single update path
(`applyHeaderConfig` → `updateHeader` → rebuild/apply).
- Wired `toolbarMenuItems` prop and `setToolbarMenuItemOptions` command
in `StackHeaderConfigViewManager`. Default values for unspecified
options are resolved in the ViewManager.
- Updated `StackHeaderCoordinator` / `StackHeaderCoordinatorLayout` to
host and refresh the menu coordinator.
- Adjusted JS types (`StackHeaderConfig.android.types.ts`,
`StackHeaderConfig.types.ts`, `StackHeaderConfig.d.ts`) and codegen spec
(`StackHeaderConfigAndroidNativeComponent.ts`); added JSDocs and aligned
naming with the native side.
- Exported new toolbar-related types.

## Visual documentation


https://github.com/user-attachments/assets/2717219a-819c-47e6-8047-8d43852e84de


## Test plan

Run `test-stack-toolbar-menu-commands-android` SFT.

## Checklist

- [x] Included code example that can be used to test this change.
- [x] For visual changes, included screenshots / GIFs / recordings
documenting the change.
- [x] For API changes, updated relevant public types.
- [x] Ensured that CI passes

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
K
Krzysztof Ligarski committed
efc2b1fa8ba3444ed388696143d753ea5bd3e649
Parent: 20fe4e4
Committed by GitHub <noreply@github.com> on 5/26/2026, 6:50:41 AM