android: make Runs the default home
This commit is contained in:
@@ -89,6 +89,9 @@ internal val destinations = listOf(
|
||||
TopDestination("settings", "Settings", Icons.Default.Settings),
|
||||
)
|
||||
|
||||
/** The home route remains beneath top-level navigation, so Back returns to Runs. */
|
||||
internal const val HOME_ROUTE = "runs"
|
||||
|
||||
/**
|
||||
* Whether [route] is the current destination. Detail panes are no longer
|
||||
* separate routes (they are saved state inside a destination), so this is a
|
||||
@@ -210,7 +213,7 @@ fun PipelinesApp(
|
||||
is SearchTarget.Pipeline -> {
|
||||
pipelineSelection = PaneSelection(MasterPane.Detail, target.pipelineId, target.version)
|
||||
navController.navigate("pipelines") {
|
||||
popUpTo("pipelines") { inclusive = false }
|
||||
popUpTo(HOME_ROUTE) { inclusive = false }
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
@@ -274,7 +277,7 @@ fun PipelinesApp(
|
||||
val onNavigate: (TopDestination) -> Unit = { destination ->
|
||||
if (currentRoute != destination.route) {
|
||||
navController.navigate(destination.route) {
|
||||
popUpTo("pipelines") { inclusive = destination.route == "pipelines" }
|
||||
popUpTo(HOME_ROUTE) { inclusive = destination.route == HOME_ROUTE }
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
@@ -317,7 +320,7 @@ fun PipelinesApp(
|
||||
)
|
||||
NavHost(
|
||||
navController = navController,
|
||||
startDestination = "pipelines",
|
||||
startDestination = HOME_ROUTE,
|
||||
// While the banner is visible it owns the status-bar inset, so
|
||||
// the inner app bars below must not apply it a second time.
|
||||
modifier = Modifier
|
||||
|
||||
@@ -13,6 +13,11 @@ import org.junit.Test
|
||||
|
||||
class PipelinesNavTest {
|
||||
|
||||
@Test
|
||||
fun runsIsTheHomeRouteForColdLaunchAndTopLevelBack() {
|
||||
assertEquals("runs", HOME_ROUTE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun thePillDoesNotHoldTemplates() {
|
||||
// Templates is configuration and moved to the Settings page; the pill keeps
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Runs default home
|
||||
|
||||
The Android app now starts at Runs. Top-level navigation and pipeline search pop up
|
||||
to the Runs home route, while explicit run deep links continue to select their run.
|
||||
|
||||
The shared Android navigation documentation may still describe Pipelines as the
|
||||
initial destination; the `docs-fold` documentation pass should update that reference.
|
||||
Reference in New Issue
Block a user