Skip to content

Conversation

@dturner
Copy link
Collaborator

@dturner dturner commented Dec 9, 2025

Add FAQs page based on content from https://www.youtube.com/watch?v=JsugLEM6po0

This commit introduces a new `faqs.md` file to the documentation.

The document provides answers to frequently asked questions about Navigation 3 (Nav3), covering topics such as its design philosophy, Compose Multiplatform readiness, state management, transitions, and implementation details like deep linking.
This change adds a "Frequently asked questions" section to the `README.md` file, which includes a link to a new FAQs page.
@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 pull request introduces a dedicated Frequently Asked Questions (FAQs) page for Navigation 3 (Nav3). The new page serves as a central resource to address common queries and provide clarity on Nav3's design principles, usage patterns, and advanced features. Concurrently, the project's main README.md has been updated to prominently feature a link to this new documentation, ensuring that users can easily access detailed information and troubleshooting tips for Nav3.

Highlights

  • New FAQs Page: A new Frequently Asked Questions (FAQs) page has been added, providing comprehensive answers and guidance regarding Navigation 3 (Nav3).
  • README Update: The README.md file has been updated to include a new section linking directly to the newly created FAQs page, making it easily discoverable for users.
  • Nav3 Topics Covered: The FAQs cover a wide range of topics including Nav3's general philosophy and architecture, state management with ViewModels, transitions and animations, and various implementation details like deep linking and combining strategies.
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 adds a new FAQs page based on a YouTube video and links to it from the main README. The changes are well-structured and the new documentation is informative. I've found a couple of minor issues in the new FAQs file, including a typo and a missing newline at the end of the file. My suggestions address these points to improve the document's quality.


### How do I share a ViewModel between two screens?
You can achieve this in two main ways:
1. **Custom Entry Decorator:** A custom decorator can control a `NavEntry`'s access to one or more `ViewModel`s. For example, a decorator could create a `ViewModel` that is shared between all entries on a back stack. Alternatively, an child entry could get access to a parent's view model by specifying the id of the parent in `metadata`. The custom decorator could then read that ID and provide the child entry with the parent's `ViewModel`.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a small typo here. It should be 'a child' instead of 'an child'. I've also removed the trailing whitespace at the end of the line.

Suggested change
1. **Custom Entry Decorator:** A custom decorator can control a `NavEntry`'s access to one or more `ViewModel`s. For example, a decorator could create a `ViewModel` that is shared between all entries on a back stack. Alternatively, an child entry could get access to a parent's view model by specifying the id of the parent in `metadata`. The custom decorator could then read that ID and provide the child entry with the parent's `ViewModel`.
1. **Custom Entry Decorator:** A custom decorator can control a `NavEntry`'s access to one or more `ViewModel`s. For example, a decorator could create a `ViewModel` that is shared between all entries on a back stack. Alternatively, a child entry could get access to a parent's view model by specifying the id of the parent in `metadata`. The custom decorator could then read that ID and provide the child entry with the parent's `ViewModel`.

Deep link support is already available via **recipes** and a comprehensive guide. Because developers own the backstack in Nav3, deep linking is simply a matter of parsing the intent and building the correct backstack manually.

### How can I combine different strategies (e.g., ListDetail, Dialog, BottomSheet)?
You can use the **`then` infix operator** to chain multiple strategies together. This creates a single strategy that evaluates the individual strategies in order. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

It's a good practice to end files with a newline character. This can prevent issues with some tools and file concatenations.

Suggested change
You can use the **`then` infix operator** to chain multiple strategies together. This creates a single strategy that evaluates the individual strategies in order.
You can use the **`then` infix operator** to chain multiple strategies together. This creates a single strategy that evaluates the individual strategies in order.

@dturner dturner changed the title dt/faqs Add FAQs page Dec 9, 2025
The "basic" nature of Nav3 is **intentional**. While Nav2 provided a pre-packaged "box" of navigation components (like `NavController` and `NavHost`) that were difficult to replace, Nav3 focuses on providing flexible **building blocks** designed to be as "Compose-like" as possible.

This approach allows developers to:
* Choose exactly which features (like decorators or `NavDisplay`) to include.
Copy link
Collaborator

Choose a reason for hiding this comment

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

decorators or scenes here

The team decided to give control back to the developers. While most apps should use it, allowing manual placement ensures you can control **where** the state is held or substitute it with your own implementation if necessary.

### Why is `SaveStateConfiguration` needed?
`SaveStateConfiguration` is used to store serializable values. A common use case is in multi-module apps where you need to inject a specific serializer for module-specific keys. In Nav3, the backstack primarily stores keys (identity), while actual state is stored in **decorators**.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider this answer instead:

SavedStateConfiguration is mainly used to provide a SerializersModule for contextual or polymorphic serializers. A common case is a multi-module app with an unsealed abstract class inherited by the modules. In that case, the modules would need to register their derived classes with the SerializersModule and provide that SerializersModule to SavedStateConfiguration so that SavedState knows how to encode / decode the class.

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.

3 participants