Skip to content

Fix navigation error from SecuritySettingsScreen to AuthenticationScreen#862

Merged
SorrowBlue merged 4 commits intomainfrom
copilot/fix-861
Sep 3, 2025
Merged

Fix navigation error from SecuritySettingsScreen to AuthenticationScreen#862
SorrowBlue merged 4 commits intomainfrom
copilot/fix-861

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 2, 2025

This PR resolves a navigation error that occurred when trying to navigate from SecuritySettingsScreen to AuthenticationScreen. The error was:

java.lang.IllegalArgumentException: Destination with route Authentication cannot be found in navigation graph ComposeNavGraph(0x4f85e0ca) route=com.sorrowblue.comicviewer.feature.settings.navigation.SettingsDetailNavGraph

Root Cause

The issue was caused by a navigation scope mismatch in the dependency injection setup:

  1. SecuritySettings resides in SettingsDetailNavGraph
  2. Authentication was defined in the parent SettingsNavGraph
  3. When SecuritySettingsScreen tried to navigate to Authentication, it used a NavController scoped to SettingsDetailNavGraph
  4. This NavController couldn't find the Authentication destination because it was in a different navigation scope

Solution

Moved the Authentication destination from SettingsNavGraph to SettingsDetailNavGraph where SecuritySettings resides. This ensures that:

  • The NavController scoped to SettingsDetailNavGraph can navigate to Authentication
  • SecuritySettingsScreen can successfully navigate to all authentication flows (Register, Erase, Change)
  • The navigation architecture remains clean and logical

Changes

  • SettingsDetailNavGraph.kt: Added Authentication as a destination and updated SettingsDetailNavGraphNavigator to handle authentication navigation directly
  • SettingsNavGraph.kt: Removed Authentication destination to avoid duplication

The changes are minimal and focused, maintaining the existing architecture while fixing the navigation scope issue.

Fixes #861.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/rate_limit
    • Triggering command: REDACTED, pid is -1 (http block)
  • spdx.org

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ation issue

Co-authored-by: SorrowBlue <25735189+SorrowBlue@users.noreply.github.com>
Copilot AI changed the title [WIP] Error when navigating from SecuritySettingsScreen to AuthenticationScreen Fix navigation error from SecuritySettingsScreen to AuthenticationScreen Sep 2, 2025
Copilot AI requested a review from SorrowBlue September 2, 2025 13:10
@SorrowBlue SorrowBlue marked this pull request as ready for review September 2, 2025 23:54
@SorrowBlue SorrowBlue merged commit 3a8c9d3 into main Sep 3, 2025
22 checks passed
@SorrowBlue SorrowBlue deleted the copilot/fix-861 branch September 3, 2025 00:31
@SorrowBlue SorrowBlue added the type: 🐛bug 「バグ、予期しない動作」[Bugs, unexpected behavior] label Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: 🐛bug 「バグ、予期しない動作」[Bugs, unexpected behavior]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when navigating from SecuritySettingsScreen to AuthenticationScreen

2 participants