refactor: unify navigation display and enhance desktop adaptive layout

- Replace the standard `NavDisplay` with the custom `MeshtasticNavDisplay` in `AppIntroductionScreen` to centralize navigation and backstack handling.
- Update `DesktopMainScreen` to transition from a persistent `NavigationRail` to an adaptive navigation shell.
- Clean up unused imports related to `NavigationRail`, `NavKey`, and `NavDisplay` across desktop and intro features.
This commit is contained in:
James Rich
2026-03-26 15:03:54 -05:00
parent cb31de73ad
commit 63faf20fc5
2 changed files with 2 additions and 6 deletions

View File

@@ -19,7 +19,6 @@ package org.meshtastic.desktop.ui
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationRail
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@@ -34,7 +33,7 @@ import org.meshtastic.core.ui.viewmodel.UIViewModel
import org.meshtastic.desktop.navigation.desktopNavGraph
/**
* Desktop main screen — Navigation 3 shell with a persistent [NavigationRail] and shared [MeshtasticNavDisplay].
* Desktop main screen — Navigation 3 shell with adaptive navigation and shared [MeshtasticNavDisplay].
*
* Uses the same shared routes from `core:navigation` and the same `MeshtasticNavDisplay` + `entryProvider` pattern as
* the Android app, proving the shared backstack architecture works across targets.

View File

@@ -19,9 +19,7 @@ package org.meshtastic.feature.intro
import android.Manifest
import android.os.Build
import androidx.compose.runtime.Composable
import androidx.navigation3.runtime.NavKey
import androidx.navigation3.runtime.rememberNavBackStack
import androidx.navigation3.ui.NavDisplay
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.PermissionState
import com.google.accompanist.permissions.rememberMultiplePermissionsState
@@ -58,9 +56,8 @@ fun AppIntroductionScreen(onDone: () -> Unit, viewModel: IntroViewModel) {
val backStack = rememberNavBackStack(Welcome)
NavDisplay<NavKey>(
org.meshtastic.core.ui.component.MeshtasticNavDisplay(
backStack = backStack,
onBack = { backStack.removeLastOrNull() },
entryProvider =
introNavGraph(
backStack = backStack,