Skip to content

[WIP] Migration to Navigation3#31

Draft
dturner wants to merge 19 commits intomainfrom
dt/nav3-migration
Draft

[WIP] Migration to Navigation3#31
dturner wants to merge 19 commits intomainfrom
dt/nav3-migration

Conversation

@dturner
Copy link
Contributor

@dturner dturner commented Feb 5, 2026

Not ready for review yet....

@dturner dturner marked this pull request as draft February 5, 2026 00:16
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dturner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This work-in-progress pull request initiates a significant migration towards a new navigation system, likely "Navigation3", by undertaking a substantial refactoring of the application's core navigation composables. The changes aim to enhance the modularity and testability of the navigation architecture by decoupling UI components from direct state management and introducing more explicit state and callback passing. This foundational work prepares the application for a more robust and flexible navigation experience across various device types.

Highlights

  • Navigation System Refactoring: The core navigation components (AppWithNavigationSuiteScaffold, AppWithTopBarNavigation, AppWithSpatialNavigation) have been extensively refactored. They now accept granular state and callback parameters instead of direct AppState and NavController objects, significantly improving modularity, reusability, and testability.
  • Dynamic Navigation Visibility: The Screens enum has been updated to use a dynamic shouldShowNavigation lambda. This replaces the less flexible NavigationVisibility sealed interface, allowing for more adaptive control over when navigation elements are displayed based on the NavigationComponentType.
  • Dependency Updates: The compose-bom and screenshot library versions have been updated to their latest iterations, ensuring the project benefits from the newest features and bug fixes.
  • Enhanced Testing Infrastructure: New @AutoPreview annotations for automotive devices and additional screenshot tests have been introduced for the refactored navigation components, bolstering the visual consistency and reliability of the UI across different platforms.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • AdaptiveJetStream/gradle/libs.versions.toml
    • Updated compose-bom to version 2026.01.01.
    • Updated screenshot to version 0.0.1-alpha13.
  • AdaptiveJetStream/jetstream/build.gradle.kts
    • Corrected Gradle Kotlin DSL syntax for screenshotTestImplementation dependency.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/MainActivity.kt
    • Added a TODO comment regarding the use of onActivityBackPressed instead of BackHandler.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/App.kt
    • Refactored AppWithNavigationSuiteScaffold, AppWithTopBarNavigation, and AppWithSpatialNavigation to accept explicit state and callback parameters.
    • Introduced logic for hasXrSpatialFeature, global navigation screens, and top bar padding within the NavigationSuiteScaffold block.
    • Added a TODO comment about refactoring keyboard shortcuts.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/AppState.kt
    • Restricted direct modification of isTopBarFocused and isNavigationVisible by making their setters private.
    • Updated navigation visibility logic to use a dynamic shouldShowNavigation function from the Screens enum.
    • Changed error handling for unknown screens in updateSelectedScreen.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withNavigationSuiteScaffold/AppWithNavigationSuiteScaffold.kt
    • Refactored the composable to be more generic, accepting state and callbacks as parameters instead of AppState and NavController.
    • Removed internal state management for navigation items and XR features, delegating it to the parent App composable.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withNavigationSuiteScaffold/TopAppBar.kt
    • Added a TODO comment to consider refactoring the TopAppBar to accept a list of navigation items.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withNavigationSuiteScaffold/TopBar.kt
    • Refactored the composable to accept explicit state and callback parameters, aligning with the new modular design.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withNavigationSuiteScaffold/navigationSuiteItems.kt
    • Simplified RequestFullSpaceModeItem by removing the hasXrSpatialFeature check, making its display conditional on the parent.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withSpatialNavigation/AppWithSpatialNavigation.kt
    • Refactored the composable to accept explicit state and callback parameters, removing internal state management for containerColor and navigation destination listeners.
    • Added a TODO comment about repeated code for global navigation screens.
    • Included a preview composable for AppWithSpatialNavigation.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withTopBarNavigation/AppWithTopBarNavigation.kt
    • Refactored the composable to accept explicit state and callback parameters, simplifying its internal logic.
    • Added TODO comments to clarify complex back button handling.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/app/withTopBarNavigation/TopBar.kt
    • Added a TODO comment about a potential bug with top navigation item clicks on TV emulators.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/components/JetStreamPreview.kt
    • Introduced @AutoPreview annotation for automotive device previews.
    • Updated LargeScreensPreview to include @AutoPreview.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/screens/Screens.kt
    • Replaced the NavigationVisibility sealed interface with a dynamic shouldShowNavigation lambda in the Screens enum.
    • Updated MovieDetails and VideoPlayer screen definitions to use the new dynamic navigation visibility logic.
    • Added Javadoc comments for the Screens enum.
  • AdaptiveJetStream/jetstream/src/main/java/com/google/jetstream/presentation/theme/Theme.kt
    • Added a TODO comment to consider refactoring the CompositionLocalProvider block.
  • AdaptiveJetStream/jetstream/src/screenshotTest/kotlin/com/google/jetstream/presentation/components/ComponentScreenshotTests.kt
    • Added new screenshot test previews for TopBar, TopAppBar, and RequestFullSpaceModeItem.
  • AdaptiveJetStream/jetstream/src/screenshotTest/kotlin/com/google/jetstream/presentation/screens/ScreenScreenshotTests.kt
    • Added new screenshot test previews for AppWithNavigationSuiteScaffold and AppWithTopBarNavigation.
Activity
  • The pull request is currently marked as 'Work In Progress' (WIP) by the author, dturner.
  • The description indicates that the changes are 'Not ready for review yet....', suggesting active development is ongoing.
  • No formal review comments or approvals have been recorded at this stage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request represents a significant and positive refactoring of the application's navigation architecture. The move towards more stateless, composable UI components by lifting state is a great improvement for maintainability and testability. The overall direction is excellent. I've added a few specific comments regarding a potential bug with a missing modifier, a compilation error in a preview, a code style issue, and a suggestion to further improve decoupling of screen-specific logic. Keep up the great work on this refactoring.

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