Skip to content

Route screens by Navigation 3#145

Merged
Goooler merged 1 commit intotrunkfrom
navigation3
Apr 28, 2026
Merged

Route screens by Navigation 3#145
Goooler merged 1 commit intotrunkfrom
navigation3

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented Apr 26, 2026

@Goooler Goooler changed the title Route by Navigation 3 Route screens by Navigation 3 Apr 26, 2026
@Goooler Goooler force-pushed the navigation3 branch 9 times, most recently from c476e56 to 18d14ff Compare April 27, 2026 05:48
@Goooler Goooler requested a review from Copilot April 27, 2026 06:20

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@Goooler Goooler force-pushed the navigation3 branch 3 times, most recently from 145ffd7 to dd12df8 Compare April 27, 2026 08:24
@Goooler Goooler requested a review from Copilot April 27, 2026 08:24

This comment was marked as resolved.

@Goooler Goooler force-pushed the navigation3 branch 11 times, most recently from e0566a2 to a980d12 Compare April 28, 2026 13:59
@Goooler Goooler requested a review from Copilot April 28, 2026 13:59
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the app’s multi-activity screen flow to a single-activity architecture using AndroidX Navigation 3 (NavKey + EntryProvider), routing internal screens via explicit Intent actions handled by MainActivity.

Changes:

  • Introduces Navigation 3 route graphs (*Nav.kt) and a shared MihomoNavDisplay wrapper for transitions and entry decorators.
  • Consolidates entry points (notifications, external control, crash flows) to launch MainActivity with Intents.ACTION_* instead of dedicated activities.
  • Removes legacy Activities/intent helpers that are no longer needed after the navigation migration.

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
service/src/main/kotlin/com/github/kr328/clash/service/ProfileWorker.kt Routes notification tap to MainActivity using ACTION_PROPERTIES + UUID.
gradle/libs.versions.toml Adds Navigation 3 + lifecycle navigation3 artifacts; bumps lifecycle version.
common/src/main/kotlin/com/github/kr328/clash/common/util/Intent.kt Removes Intent.fileName/setFileName helpers; keeps UUID routing helpers.
common/src/main/kotlin/com/github/kr328/clash/common/store/Lazy.kt Adds unsafeLazy() helper used by the new MainActivity.
common/src/main/kotlin/com/github/kr328/clash/common/constants/Intents.kt Adds route action constants (ACTION_PROPERTIES, ACTION_LOGCAT, etc.).
common/src/main/kotlin/com/github/kr328/clash/common/constants/Components.kt Removes PROPERTIES_ACTIVITY component; keeps MAIN_ACTIVITY.
app/src/main/kotlin/com/github/kr328/clash/ui/BaseActivity.kt Removes legacy base activity (edge-to-edge + exclude-from-recents behavior moved).
app/src/main/kotlin/com/github/kr328/clash/settings/ui/SettingsScreen.kt Reworks settings root callbacks to explicit “open screen” lambdas.
app/src/main/kotlin/com/github/kr328/clash/settings/SettingsNav.kt Adds Navigation 3 settings nested back stack and entries.
app/src/main/kotlin/com/github/kr328/clash/settings/SettingsActivity.kt Removes standalone Settings activity (now navigated within MainActivity).
app/src/main/kotlin/com/github/kr328/clash/settings/OverrideSettingsActivity.kt Removes standalone activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/settings/NetworkSettingsActivity.kt Removes standalone activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/settings/MetaFeatureSettingsActivity.kt Removes standalone activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/settings/AppSettingsActivity.kt Removes standalone activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/settings/AccessControlActivity.kt Removes standalone activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/remote/Remote.kt Routes crash/apk-broken launches to MainActivity actions.
app/src/main/kotlin/com/github/kr328/clash/proxy/ProxyNav.kt Adds Navigation 3 proxy entry.
app/src/main/kotlin/com/github/kr328/clash/proxy/ProxyActivity.kt Removes standalone Proxy activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/profile/vm/NewProfileViewModel.kt Removes activity-result based properties flow hook.
app/src/main/kotlin/com/github/kr328/clash/profile/vm/FilesViewModel.kt Fixes package to com.github.kr328.clash.profile.vm.
app/src/main/kotlin/com/github/kr328/clash/profile/ui/NewProfileScreen.kt Switches properties launch to callback-based navigation (onProperties(UUID)).
app/src/main/kotlin/com/github/kr328/clash/profile/ui/FilesScreen.kt Fixes package and imports for moved profile file UI.
app/src/main/kotlin/com/github/kr328/clash/profile/ProvidersActivity.kt Removes standalone Providers activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/profile/PropertiesActivity.kt Removes standalone Properties activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/profile/ProfilesNav.kt Adds Navigation 3 profiles flow with nested back stack + UUID route params.
app/src/main/kotlin/com/github/kr328/clash/profile/ProfilesActivity.kt Removes standalone Profiles activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/profile/NewProfileActivity.kt Removes standalone New Profile activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/nav/MihomoNavDisplay.kt Adds shared Nav3 NavDisplay wrapper with transitions and decorators.
app/src/main/kotlin/com/github/kr328/clash/main/MainNav.kt Adds Navigation 3 main/help entries.
app/src/main/kotlin/com/github/kr328/clash/main/MainActivity.kt Removes old .main.MainActivity (replaced by root MainActivity).
app/src/main/kotlin/com/github/kr328/clash/main/HelpActivity.kt Removes standalone Help activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/log/LogsActivity.kt Removes standalone Logs activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/log/LogcatService.kt Updates notification intent routing and refactors running state tracking.
app/src/main/kotlin/com/github/kr328/clash/log/LogcatActivity.kt Removes standalone Logcat activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/log/LogNav.kt Adds Navigation 3 log flow with Logs/Logcat destinations.
app/src/main/kotlin/com/github/kr328/clash/files/FilesActivity.kt Removes standalone Files activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/crash/CrashNav.kt Adds Navigation 3 crash entries.
app/src/main/kotlin/com/github/kr328/clash/crash/AppCrashedActivity.kt Removes standalone crash activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/crash/ApkBrokenActivity.kt Removes standalone apk-broken activity (now a Nav3 destination).
app/src/main/kotlin/com/github/kr328/clash/MainApplication.kt Cleans up imports after moving ExternalControlActivity package.
app/src/main/kotlin/com/github/kr328/clash/MainActivity.kt Adds new single-activity Nav3 host + intent action routing.
app/src/main/kotlin/com/github/kr328/clash/ExternalControlActivity.kt Moves package to root and routes to properties via MainActivity action.
app/src/main/kotlin/com/github/kr328/clash/DialerReceiver.kt Updates launcher intent creation to use MainActivity.Companion.intent.
app/src/main/AndroidManifest.xml Points launcher + alias to new MainActivity and removes deprecated activities.
app/build.gradle.kts Enables Kotlin serialization plugin and adds Navigation 3 dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/kotlin/com/github/kr328/clash/log/LogcatService.kt
@Goooler Goooler enabled auto-merge (squash) April 28, 2026 14:07
@Goooler Goooler merged commit 4856672 into trunk Apr 28, 2026
3 checks passed
@Goooler Goooler deleted the navigation3 branch April 28, 2026 14:10
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