Skip to content

Feature/template 194 navigation3#196

Open
ninovanhooff wants to merge 19 commits intodevelopfrom
feature/template-194-navigation3
Open

Feature/template 194 navigation3#196
ninovanhooff wants to merge 19 commits intodevelopfrom
feature/template-194-navigation3

Conversation

@ninovanhooff
Copy link
Collaborator

@ninovanhooff ninovanhooff commented Jan 9, 2026

Why is this important?

implements #194

Notes

I chose not to use the Koin-Navigation3 integration, because it only gives very small benefits in developer ergonomics, while you tightly integrate DI with nanigation (you have to use the Navigator provided by Koin, while we prefer to have that separately implemented)

todo

  • deeplinks link
  • cleanup
  • update the bottom navigation branch

feature/template-194-navigation3
feature/template-194-navigation3
feature/template-194-navigation3
Increases consistency

feature/template-194-navigation3
feature/template-194-navigation3
…94-navigation3

# Conflicts:
#	app/src/main/kotlin/nl/q42/template/MainActivity.kt
#	gradle/libs.versions.toml
feature/template-194-navigation3
feature/template-194-navigation3
feature/template-194-navigation3
feature/template-194-navigation3
feature/template-194-navigation3
feature/template-194-navigation3
@ninovanhooff ninovanhooff marked this pull request as ready for review February 13, 2026 19:20
feature/template-194-navigation3
feature/template-194-navigation3
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a migration from Navigation Compose 2.x to Navigation 3, a major refactoring of the app's navigation system. The migration introduces a custom navigation state management solution that avoids tight coupling with Koin's Navigator, providing more flexibility while maintaining the existing navigation patterns. The PR includes comprehensive deeplink support using Navigation 3's serialization-based approach.

Changes:

  • Migrated from androidx.navigation:navigation-compose to androidx.navigation3 libraries (runtime and ui)
  • Replaced navigation graphs with entry provider scopes and custom Navigator class for back stack management
  • Implemented deeplink parsing infrastructure with pattern matching and key decoding
  • Updated ViewModels to receive Destination parameters via Koin's parametersOf mechanism

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
gradle/libs.versions.toml Updated Koin to 4.2.0-RC1, added Navigation 3 libraries, added koin-annotations, removed old composeNavigation dependency
feature/home/src/main/kotlin/nl/q42/template/home/second/presentation/HomeSecondViewModel.kt Replaced SavedStateHandle with @provided Destination.HomeSecond parameter
core/navigation/src/main/kotlin/nl/q42/template/navigation/viewmodel/RouteNavigator.kt Renamed navigationState to appNavigationState and NavigationState to AppNavigationState
core/navigation/src/main/kotlin/nl/q42/template/navigation/viewmodel/Navigator3.kt New Navigator class that manages navigation by manipulating back stacks directly
core/navigation/src/main/kotlin/nl/q42/template/navigation/viewmodel/NavigationState.kt Complete rewrite - now manages Navigation 3 back stacks and converts them to NavEntries
core/navigation/src/main/kotlin/nl/q42/template/navigation/viewmodel/InitNavigator.kt Updated to work with new Navigator class instead of NavHostController
core/navigation/src/main/kotlin/nl/q42/template/navigation/viewmodel/AppNavigationState.kt New file containing the old NavigationState and BackstackBehavior definitions
core/navigation/src/main/kotlin/nl/q42/template/navigation/Destinations.kt Made Destination sealed class extend NavKey interface
core/navigation/src/main/kotlin/nl/q42/template/navigation/AppGraphRoutes.kt Removed file - no longer needed with Navigation 3's entry-based approach
build.dep.navigation.gradle Updated to use Navigation 3 libraries
build.dep.di.gradle Added koin-annotations dependency
app/src/main/kotlin/nl/q42/template/navigation/deeplink/KeyDecoder.kt New decoder for deserializing deeplink arguments into Destination objects
app/src/main/kotlin/nl/q42/template/navigation/deeplink/DeepLinkRequest.kt New class to parse and store deeplink URIs in a structured format
app/src/main/kotlin/nl/q42/template/navigation/deeplink/DeepLinkPattern.kt New class to parse and validate deeplink patterns against Destination schemas
app/src/main/kotlin/nl/q42/template/navigation/deeplink/DeepLinkParser.kt New parser that matches incoming deeplink intents to registered patterns
app/src/main/kotlin/nl/q42/template/navigation/deeplink/DeepLinkMatcher.kt New matcher that compares requested deeplinks against supported patterns
app/src/main/kotlin/nl/q42/template/navigation/OnboardingDestinations.kt Converted from NavGraphBuilder extension to EntryProviderScope extension
app/src/main/kotlin/nl/q42/template/navigation/HomeGraph.kt Removed - replaced by HomeEntry.kt
app/src/main/kotlin/nl/q42/template/navigation/HomeEntry.kt New file defining home destination entries using Navigation 3 patterns
app/src/main/kotlin/nl/q42/template/di/AppModule.kt Added DeeplinkParser as singleton
app/src/main/kotlin/nl/q42/template/MainActivity.kt Replaced NavHost with NavDisplay and integrated deeplink parsing at startup
app/build.gradle Removed old composeNavigation dependency
.idea/copilotDiffState.xml IDE-specific file that should not be in version control
Files not reviewed (1)
  • .idea/copilotDiffState.xml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ninovanhooff and others added 5 commits February 14, 2026 13:37
…wmodel/InitNavigator.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nkPattern.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
feature/template-194-navigation3
feature/template-194-navigation3
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.

2 participants