Skip to content

fix(android): reserve navigation bar slot for drawer - #81

Open
jsdatarocks wants to merge 2 commits into
NativePHP:mainfrom
jsdatarocks:fix/android-drawer-nav-slot
Open

fix(android): reserve navigation bar slot for drawer#81
jsdatarocks wants to merge 2 commits into
NativePHP:mainfrom
jsdatarocks:fix/android-drawer-nav-slot

Conversation

@jsdatarocks

@jsdatarocks jsdatarocks commented Aug 29, 2026

Copy link
Copy Markdown

Description

Summary

Opts the Android drawer root host into the navigation bar slot reservation API introduced by NativePHP/mobile-air#404.

Together, the two changes prevent the drawer button from overlapping the navigation title while preserving the drawer's current overlay implementation.

Problem

On Android, the mobile-ui drawer button is rendered as an overlay at the top-left of the root content. The mobile-air TopAppBar previously reserved its navigation slot only for a back button, so a root screen with a drawer and no back button placed the navigation title underneath the drawer icon.
Captura de Tela 2026-08-29 às 15 26 27

iOS already positions the drawer button and title without this overlap.
Captura de Tela 2026-08-29 às 15 28 55

Changes

  • Registers the native-ui.drawer root host with reservesNavigationBarSlot = true.
  • Leaves the existing drawer rendering and behavior unchanged.
  • Allows the companion mobile-air implementation to reserve a 48.dp navigation slot while the native_drawer sentinel is present and no back button is shown.

Dependency and rollout

This PR depends on NativePHP/mobile-air#404, which adds the reservesNavigationBarSlot registration parameter and handles the reserved slot in the stack and tab root renderers.

The changes should be merged and released in this order:

  1. NativePHP/mobile-air#404.
  2. This mobile-ui PR.

The updated mobile-ui source will not compile against a mobile-air version that does not yet provide the new register() parameter.

Testing

The companion mobile-air PR includes registry unit coverage and Compose layout tests for both stack and tab root renderers. This PR adds a Pest contract test that verifies the Android drawer registration consumes native_drawer and enables reservesNavigationBarSlot.

The combined changes should be manually verified on Android with:

  • Tab and stack layouts using a drawer.
  • Root screens without a back button.
  • Nested screens with a back button.
  • Navigation bars with and without trailing actions.
  • Short and long titles.
  • Hidden navigation bars.
  • Both modal and reveal drawer variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant