Skip to content

Bind reachable navigation-compose @Composable methods; document animation-surface blocker#1450

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-navigation-compose-compose-surface
Draft

Bind reachable navigation-compose @Composable methods; document animation-surface blocker#1450
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-navigation-compose-compose-surface

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 5, 2026

Xamarin.AndroidX.Navigation.Compose shipped its *Kt wrappers (NavHostKt, NavGraphBuilderKt, DialogHostKt, NavHostControllerKt, NavBackStackEntryProviderKt) as empty classes, making the entire @Composable navigation surface unreachable from C#.

Root cause

The generator silently drops any Java method whose parameter/return types can't be resolved to a managed type (warning BG8605). The dropped members reference types that are intentionally unbound repo-wide:

  • androidx.compose.animation.*AnimatedContentScope, AnimatedContentTransitionScope, EnterTransition, ExitTransition, SizeTransform. The animation-android binding's Metadata.xml is just <remove-node path="/api/package" />, so the package produces zero C# types.
  • androidx.compose.runtime.saveable.SaveableStateHolder, androidx.compose.runtime.snapshots.SnapshotStateList.

This is independent of inline-class mangling (java-interop#1440) and is not a navigation-compose Metadata.xml removal (it has none). Methods whose signatures resolve fully are bound correctly; methods touching the animation/saveable types are filtered.

Changes

  • PublicAPI/PublicAPI.Unshipped.txt — refreshed the stale baseline to capture the now-bindable subset:
    • DialogHostKt.DialogHost(DialogNavigator, …)
    • NavGraphBuilderKt.Dialog(…) (string + KClass overloads)
    • NavHostControllerKt.RememberNavController(Navigator[], …)
    • NavHostControllerKt.CurrentBackStackEntryAsState(NavController, …)
    • constructors for DialogNavigator.Destination and DialogNavigatorDestinationBuilder
  • config.json — bump navigation-compose and navigation-compose-android nugetVersion 2.9.8 → 2.9.8.1.
  • published-namespaces.txt — no change required; AndroidX.Navigation.Compose is already published.

Still unbound (out of scope)

NavHost, NavGraphBuilder.composable, NavGraphBuilder.navigation, and NavBackStackEntry.LocalOwnersProvider remain empty — they cannot bind until androidx.compose.animation (and compose.runtime.saveable) are themselves bound. That is a large, separate cross-library effort: the package is deliberately stripped via remove-node, and an add-node shim is not viable because the generated C# would reference types that don't exist. Tracked as the real blocker behind this Compose surface.

…mberNavController) and bump to 2.9.8.1

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix empty wrappers for navigation-compose @Composable Bind reachable navigation-compose @Composable methods; document animation-surface blocker Jun 5, 2026
Copilot AI requested a review from jonathanpeppers June 5, 2026 23:27
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.

Compose: navigation-compose @Composable surface (NavHost, composable, rememberNavController, DialogHost) not bound — every Kt wrapper is empty

2 participants