Conversation
Summary of ChangesHello @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 pull request undertakes a significant refactoring of the Jetsnack application's navigation system by upgrading to Navigation 3. The core change involves transitioning from a complex nested Highlights
🧠 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This is a great migration to Navigation 3. It significantly simplifies the navigation structure by moving from nested NavHosts to a single back stack, which is much cleaner. The use of serializable NavKeys and NavDisplay is well-executed.
I've added a few comments, mostly focusing on ensuring runtime safety by restoring some null checks for navigation scopes that were removed during the refactoring. This will prevent potential NullPointerExceptions. I also included a suggestion to improve the 'clunky' logic for the bottom bar that you mentioned in your description, addressing both performance and redundant navigation triggers.
Overall, excellent work on this refactor!
Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/DestinationBar.kt
Show resolved
Hide resolved
Jetsnack/app/src/main/java/com/example/jetsnack/ui/snackdetail/SnackDetail.kt
Show resolved
Hide resolved
Jetsnack/app/src/main/java/com/example/jetsnack/ui/snackdetail/SnackDetail.kt
Show resolved
Hide resolved
Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt
Outdated
Show resolved
Hide resolved
Jetsnack/app/src/main/java/com/example/jetsnack/ui/snackdetail/SnackDetail.kt
Outdated
Show resolved
Hide resolved
Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt
Outdated
Show resolved
Hide resolved
| ) | ||
| } | ||
| }, | ||
| transitionSpec = { transitionSpec }, |
There was a problem hiding this comment.
I'm not sure why, but comparing between develop + this branch, the transition between the Feed and Cart composables looks a bit quicker, and doesn't seem like its performing a fadeIn or fadeOut. Doesn't look bad, I'm just wondering if there was a change missed here.
Not blocking on this one :)
riggaroo
left a comment
There was a problem hiding this comment.
Overall looking good! Just the bottom bar animation needs fixing.
I have migrated Jetsnack to use Navigation 3.
Previously Jetsnack was using nested
NavHosts. The outerNavHostheld the Home and SnackDetail destinations and the Home destination had aNavHostcontaining the Feed, Search, Cart and Profile destinations. The Home destinations were all wrapped with a scaffold that displayed the bottom navigation bar. The SnackDetail destination was full screen without the bottom navigation bar.I have refactored this to use a single back stack and a single
NavDisplayis used for all screens. This simplifies the code, but does introduce a caveat.In order to display the bottom navigation bar on the Home destinations the
NavDisplayis wrapped with the scaffold. This means that the bottom bar is conditionally hidden when the SnackDetail navigation key is the last item in the back stack. This isn't particularly scalable. This may be better implemented as a scene decorator, although we're still figuring out best practices there.Still to do:
Consider re-implementing this with nested NavDisplays.