Hide the destination pill while a pipeline detail is open
Opening a pipeline is a detail surface that owns the foot of the Pipelines destination, so the floating pill now stands down there exactly as it already does for a run detail (any non-list pane depth), and returning to the pipeline list restores it. Verified on the foldable emulator: pill drawn on the pipeline list, hidden on the Android pipeline detail, restored on Back.
This commit is contained in:
@@ -80,7 +80,7 @@ internal data class TopDestination(val route: String, val label: String, val ico
|
||||
* narrows it.
|
||||
*/
|
||||
internal val destinations = listOf(
|
||||
TopDestination("pipelines", "Pipelines", Icons.Default.AccountTree),
|
||||
TopDestination(PIPELINES_ROUTE, "Pipelines", Icons.Default.AccountTree),
|
||||
TopDestination("runs", "Runs", Icons.Default.History),
|
||||
TopDestination("chat", "Chat", Icons.AutoMirrored.Filled.Chat),
|
||||
TopDestination("settings", "Settings", Icons.Default.Settings),
|
||||
@@ -193,11 +193,12 @@ fun PipelinesApp(
|
||||
// read from the chat store, so it flips in the same recomposition that swaps
|
||||
// the chat list for the conversation.
|
||||
val conversationOpen by vm.conversationOpen.collectAsStateWithLifecycle()
|
||||
// A run detail owns the lower part of the screen, including its graph, stage,
|
||||
// artifact and decision surfaces. Hide the pill for the entire detail stack,
|
||||
// not just one sheet inside it; returning to the run list restores it.
|
||||
// A run or pipeline detail owns the lower part of the screen, including its
|
||||
// graph, stage, artifact and decision surfaces. Hide the pill for the entire
|
||||
// detail stack, not just one sheet inside it; returning to the list restores it.
|
||||
val runDetailOpen = runDetailOpen(currentRoute, runSelection)
|
||||
val pillVisible = destinationPillVisible(currentRoute, conversationOpen, runDetailOpen)
|
||||
val pipelineDetailOpen = pipelineDetailOpen(currentRoute, pipelineSelection)
|
||||
val pillVisible = destinationPillVisible(currentRoute, conversationOpen, runDetailOpen, pipelineDetailOpen)
|
||||
val searchKind by vm.searchKind.collectAsStateWithLifecycle()
|
||||
val searchSort by vm.searchSort.collectAsStateWithLifecycle()
|
||||
|
||||
@@ -213,7 +214,7 @@ fun PipelinesApp(
|
||||
when (val target = searchTarget(hit)) {
|
||||
is SearchTarget.Pipeline -> {
|
||||
pipelineSelection = PaneSelection(MasterPane.Detail, target.pipelineId, target.version)
|
||||
navController.navigate("pipelines") {
|
||||
navController.navigate(PIPELINES_ROUTE) {
|
||||
popUpTo(HOME_ROUTE) { inclusive = false }
|
||||
launchSingleTop = true
|
||||
}
|
||||
@@ -338,7 +339,7 @@ fun PipelinesApp(
|
||||
},
|
||||
),
|
||||
) {
|
||||
composable("pipelines") {
|
||||
composable(PIPELINES_ROUTE) {
|
||||
PipelineDestination(
|
||||
vm = vm,
|
||||
wide = wide,
|
||||
@@ -500,24 +501,31 @@ private const val SEARCH_SCRIM_ALPHA = 0.5f
|
||||
/** The Chat destination's navigation route. */
|
||||
private const val CHAT_ROUTE = "chat"
|
||||
private const val RUNS_ROUTE = "runs"
|
||||
private const val PIPELINES_ROUTE = "pipelines"
|
||||
|
||||
/** A run detail is any non-list level of the Runs pane stack. */
|
||||
internal fun runDetailOpen(currentRoute: String?, selection: PaneSelection): Boolean =
|
||||
currentRoute == RUNS_ROUTE && selection.depth >= 1
|
||||
|
||||
/** A pipeline detail is any non-list level of the Pipelines pane stack. */
|
||||
internal fun pipelineDetailOpen(currentRoute: String?, selection: PaneSelection): Boolean =
|
||||
currentRoute == PIPELINES_ROUTE && selection.depth >= 1
|
||||
|
||||
/**
|
||||
* Whether the floating destination pill is drawn for [currentRoute]. The pill
|
||||
* stands down in the two places a deliberate detail surface owns the foot of the
|
||||
* screen and the pill would sit over it:
|
||||
* stands down in the three places a deliberate detail surface owns the foot of
|
||||
* the screen and the pill would sit over it:
|
||||
*
|
||||
* - while the Chat destination is showing an open conversation — a session's
|
||||
* transcript and composer — where it would compete with send/stop;
|
||||
* - while a run detail is open ([runDetailOpen]), including its summary, graph,
|
||||
* stage, artifact and decision surfaces, where it would cover their controls.
|
||||
* stage, artifact and decision surfaces, where it would cover their controls;
|
||||
* - while a pipeline detail is open ([pipelineDetailOpen]), including its
|
||||
* description, graph and run history, where it would cover their controls.
|
||||
*
|
||||
* Everything else keeps it: the chat list and run list both draw it, and the
|
||||
* covered peek strip and Back still leave both hiding states, so hiding the pill
|
||||
* strands nothing. The
|
||||
* Everything else keeps it: the chat list, run list and pipeline list all draw
|
||||
* it, and the covered peek strip and Back still leave every hiding state, so
|
||||
* hiding the pill strands nothing. The
|
||||
* clearance and the drawn pill both key off this one predicate. Pure, so the one
|
||||
* rule is unit-testable without a device.
|
||||
*/
|
||||
@@ -525,7 +533,9 @@ internal fun destinationPillVisible(
|
||||
currentRoute: String?,
|
||||
conversationOpen: Boolean,
|
||||
runDetailOpen: Boolean,
|
||||
): Boolean = !(currentRoute == CHAT_ROUTE && conversationOpen) && !runDetailOpen
|
||||
pipelineDetailOpen: Boolean,
|
||||
): Boolean =
|
||||
!(currentRoute == CHAT_ROUTE && conversationOpen) && !runDetailOpen && !pipelineDetailOpen
|
||||
|
||||
/**
|
||||
* Where the bottom destination pill rests in the window: horizontally centred on a
|
||||
|
||||
Reference in New Issue
Block a user