Open
Conversation
feature/template-194-navigation3
feature/template-194-navigation3
feature/template-194-navigation3
Increases consistency feature/template-194-navigation3
ninovanhooff
commented
Jan 9, 2026
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
feature/template-194-navigation3
feature/template-194-navigation3
There was a problem hiding this comment.
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.
app/src/main/kotlin/nl/q42/template/navigation/OnboardingDestinations.kt
Show resolved
Hide resolved
app/src/main/kotlin/nl/q42/template/navigation/deeplink/DeepLinkPattern.kt
Outdated
Show resolved
Hide resolved
core/navigation/src/main/kotlin/nl/q42/template/navigation/viewmodel/InitNavigator.kt
Show resolved
Hide resolved
feature/template-194-navigation3
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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