android: preserve run detail pill correction
This commit is contained in:
@@ -189,13 +189,11 @@ fun PipelinesApp(
|
|||||||
// read from the chat store, so it flips in the same recomposition that swaps
|
// read from the chat store, so it flips in the same recomposition that swaps
|
||||||
// the chat list for the conversation.
|
// the chat list for the conversation.
|
||||||
val conversationOpen by vm.conversationOpen.collectAsStateWithLifecycle()
|
val conversationOpen by vm.conversationOpen.collectAsStateWithLifecycle()
|
||||||
// Whether a run's pending-decision surface — the decision sheet the operator
|
// A run detail owns the lower part of the screen, including its graph, stage,
|
||||||
// opens from the run summary's Decide action — is currently open. It is a state
|
// artifact and decision surfaces. Hide the pill for the entire detail stack,
|
||||||
// of the run view (reported up by the run detail and its stage pane), not a
|
// not just one sheet inside it; returning to the run list restores it.
|
||||||
// destination, so the pill stands down for exactly as long as it is up and
|
val runDetailOpen = runDetailOpen(currentRoute, runSelection)
|
||||||
// returns the moment the decision is answered or dismissed, with no navigation.
|
val pillVisible = destinationPillVisible(currentRoute, conversationOpen, runDetailOpen)
|
||||||
var decisionSurfaceOpen by remember { mutableStateOf(false) }
|
|
||||||
val pillVisible = destinationPillVisible(currentRoute, conversationOpen, decisionSurfaceOpen)
|
|
||||||
val searchKind by vm.searchKind.collectAsStateWithLifecycle()
|
val searchKind by vm.searchKind.collectAsStateWithLifecycle()
|
||||||
val searchSort by vm.searchSort.collectAsStateWithLifecycle()
|
val searchSort by vm.searchSort.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
@@ -361,7 +359,6 @@ fun PipelinesApp(
|
|||||||
listState = runListState,
|
listState = runListState,
|
||||||
decisionRequest = decisionRequest,
|
decisionRequest = decisionRequest,
|
||||||
onDecisionRequestHandled = { decisionRequest = null },
|
onDecisionRequestHandled = { decisionRequest = null },
|
||||||
onDecisionSurfaceChange = { decisionSurfaceOpen = it },
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable("chat") {
|
composable("chat") {
|
||||||
@@ -444,10 +441,9 @@ fun PipelinesApp(
|
|||||||
onClick = { attentionOpen = true },
|
onClick = { attentionOpen = true },
|
||||||
modifier = Modifier.align(Alignment.End).padding(bottom = SPACING_S),
|
modifier = Modifier.align(Alignment.End).padding(bottom = SPACING_S),
|
||||||
)
|
)
|
||||||
// The pill stands down while a conversation is open, or while a
|
// The pill stands down while a conversation or run detail is open;
|
||||||
// run's pending-decision surface is up; the search field it morphs
|
// the search field it morphs into is unreachable there anyway (the
|
||||||
// into is unreachable there anyway (the field opens from the pill),
|
// field opens from the pill), so nothing is stranded by not drawing it.
|
||||||
// so nothing is stranded by not drawing it.
|
|
||||||
if (pillVisible) {
|
if (pillVisible) {
|
||||||
DestinationBar(
|
DestinationBar(
|
||||||
destinations = destinations,
|
destinations = destinations,
|
||||||
@@ -503,28 +499,33 @@ private const val SEARCH_SCRIM_ALPHA = 0.5f
|
|||||||
|
|
||||||
/** The Chat destination's navigation route. */
|
/** The Chat destination's navigation route. */
|
||||||
private const val CHAT_ROUTE = "chat"
|
private const val CHAT_ROUTE = "chat"
|
||||||
|
private const val RUNS_ROUTE = "runs"
|
||||||
|
|
||||||
|
/** 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
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the floating destination pill is drawn for [currentRoute]. The pill
|
* Whether the floating destination pill is drawn for [currentRoute]. The pill
|
||||||
* stands down in the two places a deliberate bottom surface owns the foot of the
|
* stands down in the two places a deliberate detail surface owns the foot of the
|
||||||
* screen and the pill would sit over it:
|
* screen and the pill would sit over it:
|
||||||
*
|
*
|
||||||
* - while the Chat destination is showing an open conversation — a session's
|
* - while the Chat destination is showing an open conversation — a session's
|
||||||
* transcript and composer — where it would compete with send/stop;
|
* transcript and composer — where it would compete with send/stop;
|
||||||
* - while a run's pending-decision surface is open ([decisionOpen], the sheet the
|
* - while a run detail is open ([runDetailOpen]), including its summary, graph,
|
||||||
* operator answers from the run summary), where it would cover the options.
|
* stage, artifact and decision surfaces, where it would cover their controls.
|
||||||
*
|
*
|
||||||
* Everything else keeps it: the chat list, a run being read, its stage pane, an
|
* Everything else keeps it: the chat list and run list both draw it, and the
|
||||||
* artifact and the graph all draw it exactly as before, and the covered peek strip
|
* covered peek strip and Back still leave both hiding states, so hiding the pill
|
||||||
* and Back still leave both hiding states, so hiding the pill strands nothing. The
|
* strands nothing. The
|
||||||
* clearance and the drawn pill both key off this one predicate. Pure, so the one
|
* clearance and the drawn pill both key off this one predicate. Pure, so the one
|
||||||
* rule is unit-testable without a device.
|
* rule is unit-testable without a device.
|
||||||
*/
|
*/
|
||||||
internal fun destinationPillVisible(
|
internal fun destinationPillVisible(
|
||||||
currentRoute: String?,
|
currentRoute: String?,
|
||||||
conversationOpen: Boolean,
|
conversationOpen: Boolean,
|
||||||
decisionOpen: Boolean,
|
runDetailOpen: Boolean,
|
||||||
): Boolean = !(currentRoute == CHAT_ROUTE && conversationOpen) && !decisionOpen
|
): Boolean = !(currentRoute == CHAT_ROUTE && conversationOpen) && !runDetailOpen
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Where the bottom overlay — the destination pill and the attention chip above it
|
* Where the bottom overlay — the destination pill and the attention chip above it
|
||||||
@@ -554,7 +555,7 @@ internal fun contentPillPadding(pillVisible: Boolean): Dp = 0.dp
|
|||||||
* of the floating bottom stack — the destination pill and the attention chip above
|
* of the floating bottom stack — the destination pill and the attention chip above
|
||||||
* it — built from the named [DESTINATION_PILL_RESERVE] and [ATTENTION_CHIP_RESERVE]
|
* it — built from the named [DESTINATION_PILL_RESERVE] and [ATTENTION_CHIP_RESERVE]
|
||||||
* while the pill is drawn, and none while it is hidden (an open conversation or a
|
* while the pill is drawn, and none while it is hidden (an open conversation or a
|
||||||
* run's open decision surface, see [destinationPillVisible]) so a hidden pill
|
* run detail, see [destinationPillVisible]) so a hidden pill
|
||||||
* leaves no empty band at the end of a list. Published to the content through
|
* leaves no empty band at the end of a list. Published to the content through
|
||||||
* `LocalPillBottomInset` and applied inside
|
* `LocalPillBottomInset` and applied inside
|
||||||
* each scrollable's own scroll content, never as layout padding on the content. It
|
* each scrollable's own scroll content, never as layout padding on the content. It
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ internal fun RunsDestination(
|
|||||||
listState: LazyListState,
|
listState: LazyListState,
|
||||||
decisionRequest: Long? = null,
|
decisionRequest: Long? = null,
|
||||||
onDecisionRequestHandled: () -> Unit = {},
|
onDecisionRequestHandled: () -> Unit = {},
|
||||||
onDecisionSurfaceChange: (Boolean) -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
val depth = selection.depth
|
val depth = selection.depth
|
||||||
val onBack: () -> Unit = { onSelectionChange(backFrom(selection)) }
|
val onBack: () -> Unit = { onSelectionChange(backFrom(selection)) }
|
||||||
@@ -104,7 +103,6 @@ internal fun RunsDestination(
|
|||||||
covered = covered,
|
covered = covered,
|
||||||
requestDecision = decisionRequest == itemId,
|
requestDecision = decisionRequest == itemId,
|
||||||
onDecisionRequestHandled = onDecisionRequestHandled,
|
onDecisionRequestHandled = onDecisionRequestHandled,
|
||||||
onDecisionSurfaceChange = onDecisionSurfaceChange,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
2 -> rememberPaneContent(
|
2 -> rememberPaneContent(
|
||||||
@@ -128,7 +126,6 @@ internal fun RunsDestination(
|
|||||||
wide = wide,
|
wide = wide,
|
||||||
modifier = paneModifier,
|
modifier = paneModifier,
|
||||||
covered = covered,
|
covered = covered,
|
||||||
onDecisionSurfaceChange = onDecisionSurfaceChange,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
3 -> rememberPaneContent(
|
3 -> rememberPaneContent(
|
||||||
@@ -150,7 +147,6 @@ internal fun RunsDestination(
|
|||||||
wide = wide,
|
wide = wide,
|
||||||
modifier = paneModifier,
|
modifier = paneModifier,
|
||||||
covered = covered,
|
covered = covered,
|
||||||
onDecisionSurfaceChange = onDecisionSurfaceChange,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.material3.TextButton
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.material3.rememberModalBottomSheetState
|
import androidx.compose.material3.rememberModalBottomSheetState
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.DisposableEffect
|
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -61,12 +60,6 @@ import net.awan.pipelines.ui.theme.pipelinesText
|
|||||||
* [onSend] performs the request; it reports the outcome through its callback so
|
* [onSend] performs the request; it reports the outcome through its callback so
|
||||||
* this component owns no networking and is unit-testable through the pure
|
* this component owns no networking and is unit-testable through the pure
|
||||||
* [DecisionDraft]/[decisionRefusalMessage] model.
|
* [DecisionDraft]/[decisionRefusalMessage] model.
|
||||||
*
|
|
||||||
* [onSurfaceOpenChange] reports whether the decision sheet — the run's pending
|
|
||||||
* decision surface — is currently open, so the host can tell the app shell to
|
|
||||||
* stand the floating destination pill down for exactly as long as the operator is
|
|
||||||
* answering. It is the host's job to route that to the pill (see
|
|
||||||
* `destinationPillVisible`); this component only says when its own surface is up.
|
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun DecisionPrompt(
|
fun DecisionPrompt(
|
||||||
@@ -75,7 +68,6 @@ fun DecisionPrompt(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
openRequest: Boolean = false,
|
openRequest: Boolean = false,
|
||||||
onOpenRequestHandled: () -> Unit = {},
|
onOpenRequestHandled: () -> Unit = {},
|
||||||
onSurfaceOpenChange: (Boolean) -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
val shown = rememberPaneContent(decision)
|
val shown = rememberPaneContent(decision)
|
||||||
var open by remember { mutableStateOf(false) }
|
var open by remember { mutableStateOf(false) }
|
||||||
@@ -83,13 +75,6 @@ fun DecisionPrompt(
|
|||||||
var sending by remember { mutableStateOf(false) }
|
var sending by remember { mutableStateOf(false) }
|
||||||
var error by remember { mutableStateOf<String?>(null) }
|
var error by remember { mutableStateOf<String?>(null) }
|
||||||
|
|
||||||
// The decision surface is up exactly while the sheet is open (it can outlive
|
|
||||||
// the decision, kept open to report a refusal), so the host is told on every
|
|
||||||
// change. It is cleared when the prompt leaves the composition, so a surface
|
|
||||||
// that closes with its pane can never leave the pill hidden behind it.
|
|
||||||
LaunchedEffect(open) { onSurfaceOpenChange(open) }
|
|
||||||
DisposableEffect(Unit) { onDispose { onSurfaceOpenChange(false) } }
|
|
||||||
|
|
||||||
// A notification's tap asks for the decision itself, not just the run:
|
// A notification's tap asks for the decision itself, not just the run:
|
||||||
// open the sheet once the waiting run's detail has loaded. The request is
|
// open the sheet once the waiting run's detail has loaded. The request is
|
||||||
// consumed here so a recomposition or a dismissal does not reopen it.
|
// consumed here so a recomposition or a dismissal does not reopen it.
|
||||||
|
|||||||
@@ -420,7 +420,6 @@ fun StageDetailPane(
|
|||||||
runLabel: String? = null,
|
runLabel: String? = null,
|
||||||
decision: PendingDecision? = null,
|
decision: PendingDecision? = null,
|
||||||
onDecide: (PendingDecision, String, String, (Result<RunDetail>) -> Unit) -> Unit = { _, _, _, _ -> },
|
onDecide: (PendingDecision, String, String, (Result<RunDetail>) -> Unit) -> Unit = { _, _, _, _ -> },
|
||||||
onDecisionSurfaceChange: (Boolean) -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
// A covered pane shows its compact identity only; the visit tab row and the
|
// A covered pane shows its compact identity only; the visit tab row and the
|
||||||
// stage body must never be drawn squeezed into the peek strip.
|
// stage body must never be drawn squeezed into the peek strip.
|
||||||
@@ -486,7 +485,6 @@ fun StageDetailPane(
|
|||||||
runContext = runContext,
|
runContext = runContext,
|
||||||
decision = decision,
|
decision = decision,
|
||||||
onDecide = onDecide,
|
onDecide = onDecide,
|
||||||
onDecisionSurfaceChange = onDecisionSurfaceChange,
|
|
||||||
modifier = Modifier.padding(padding),
|
modifier = Modifier.padding(padding),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -507,7 +505,6 @@ private fun StageDetailBody(
|
|||||||
runContext: Boolean,
|
runContext: Boolean,
|
||||||
decision: PendingDecision?,
|
decision: PendingDecision?,
|
||||||
onDecide: (PendingDecision, String, String, (Result<RunDetail>) -> Unit) -> Unit,
|
onDecide: (PendingDecision, String, String, (Result<RunDetail>) -> Unit) -> Unit,
|
||||||
onDecisionSurfaceChange: (Boolean) -> Unit,
|
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val text = pipelinesText()
|
val text = pipelinesText()
|
||||||
@@ -542,7 +539,6 @@ private fun StageDetailBody(
|
|||||||
DecisionPrompt(
|
DecisionPrompt(
|
||||||
decision = decision,
|
decision = decision,
|
||||||
onSend = onDecide,
|
onSend = onDecide,
|
||||||
onSurfaceOpenChange = onDecisionSurfaceChange,
|
|
||||||
)
|
)
|
||||||
// The stage's own name is the app bar's title, so the body does not
|
// The stage's own name is the app bar's title, so the body does not
|
||||||
// repeat it: the pane leads with the stage's type and facts instead of
|
// repeat it: the pane leads with the stage's type and facts instead of
|
||||||
@@ -856,7 +852,6 @@ fun RunStagePane(
|
|||||||
wide: Boolean,
|
wide: Boolean,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
covered: Boolean = false,
|
covered: Boolean = false,
|
||||||
onDecisionSurfaceChange: (Boolean) -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
val state by vm.runDetail.collectAsStateWithLifecycle()
|
val state by vm.runDetail.collectAsStateWithLifecycle()
|
||||||
val configuredServerUrl by vm.configuredServerUrl.collectAsStateWithLifecycle()
|
val configuredServerUrl by vm.configuredServerUrl.collectAsStateWithLifecycle()
|
||||||
@@ -892,7 +887,6 @@ fun RunStagePane(
|
|||||||
onDecide = { pending, option, feedback, onResult ->
|
onDecide = { pending, option, feedback, onResult ->
|
||||||
vm.decideRun(pending.runId, pending.stageKey, option, feedback, onResult)
|
vm.decideRun(pending.runId, pending.stageKey, option, feedback, onResult)
|
||||||
},
|
},
|
||||||
onDecisionSurfaceChange = onDecisionSurfaceChange,
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
StageSectionPane(
|
StageSectionPane(
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ fun RunDetailScreen(
|
|||||||
covered: Boolean = false,
|
covered: Boolean = false,
|
||||||
requestDecision: Boolean = false,
|
requestDecision: Boolean = false,
|
||||||
onDecisionRequestHandled: () -> Unit = {},
|
onDecisionRequestHandled: () -> Unit = {},
|
||||||
onDecisionSurfaceChange: (Boolean) -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
val state by vm.runDetail.collectAsStateWithLifecycle()
|
val state by vm.runDetail.collectAsStateWithLifecycle()
|
||||||
val runsState by vm.runs.collectAsStateWithLifecycle()
|
val runsState by vm.runs.collectAsStateWithLifecycle()
|
||||||
@@ -218,7 +217,6 @@ fun RunDetailScreen(
|
|||||||
modifier = Modifier.padding(horizontal = SPACING_L, vertical = SPACING_S),
|
modifier = Modifier.padding(horizontal = SPACING_L, vertical = SPACING_S),
|
||||||
openRequest = requestDecision,
|
openRequest = requestDecision,
|
||||||
onOpenRequestHandled = onDecisionRequestHandled,
|
onOpenRequestHandled = onDecisionRequestHandled,
|
||||||
onSurfaceOpenChange = onDecisionSurfaceChange,
|
|
||||||
)
|
)
|
||||||
StateCrossfade(
|
StateCrossfade(
|
||||||
phase = detailLoadPhase(state.error, hasData = run != null),
|
phase = detailLoadPhase(state.error, hasData = run != null),
|
||||||
|
|||||||
@@ -83,31 +83,44 @@ class PipelinesNavTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun thePillStandsDownWhileAConversationOrARunDecisionSurfaceIsOpen() {
|
fun thePillStandsDownWhileAConversationOrRunDetailIsOpen() {
|
||||||
// An open conversation (the chat transcript and composer) hides the pill;
|
// An open conversation (the chat transcript and composer) hides the pill;
|
||||||
// the chat list keeps it, and so does every other destination.
|
// the chat list keeps it, and so does every other destination.
|
||||||
assertFalse(destinationPillVisible("chat", conversationOpen = true, decisionOpen = false))
|
assertFalse(destinationPillVisible("chat", conversationOpen = true, runDetailOpen = false))
|
||||||
assertTrue(destinationPillVisible("chat", conversationOpen = false, decisionOpen = false))
|
assertTrue(destinationPillVisible("chat", conversationOpen = false, runDetailOpen = false))
|
||||||
for (route in listOf("pipelines", "runs", "settings", null)) {
|
for (route in listOf("pipelines", "runs", "settings", null)) {
|
||||||
assertTrue(destinationPillVisible(route, conversationOpen = false, decisionOpen = false))
|
assertTrue(destinationPillVisible(route, conversationOpen = false, runDetailOpen = false))
|
||||||
}
|
}
|
||||||
// A conversation only exists on the chat route; even if the flag were set
|
// A conversation only exists on the chat route; even if the flag were set
|
||||||
// elsewhere the pill stays, so a background chat never hides it.
|
// elsewhere the pill stays, so a background chat never hides it.
|
||||||
assertTrue(destinationPillVisible("runs", conversationOpen = true, decisionOpen = false))
|
assertTrue(destinationPillVisible("runs", conversationOpen = true, runDetailOpen = false))
|
||||||
// A run's pending-decision surface (the decision sheet the operator opens
|
// Every run detail surface owns the bottom of the Runs destination: summary,
|
||||||
// from the run summary) hides the pill on the Runs destination, and only
|
// graph, stage, artifact and decision states all hide the pill. Back to the
|
||||||
// while it is open: the run being read, its stage pane, an artifact or a
|
// list clears the one detail flag and restores it on narrow and wide panes.
|
||||||
// graph all keep it.
|
assertFalse(destinationPillVisible("runs", conversationOpen = false, runDetailOpen = true))
|
||||||
assertFalse(destinationPillVisible("runs", conversationOpen = false, decisionOpen = true))
|
assertTrue(destinationPillVisible("runs", conversationOpen = false, runDetailOpen = false))
|
||||||
assertTrue(destinationPillVisible("runs", conversationOpen = false, decisionOpen = false))
|
|
||||||
// The decision surface is a state of the run view, not a route, so the
|
|
||||||
// predicate hides it everywhere it were reported, exactly as for a
|
|
||||||
// conversation — and never for the chat list's own conversation flag.
|
|
||||||
for (route in listOf("pipelines", "runs", "chat", "settings", null)) {
|
for (route in listOf("pipelines", "runs", "chat", "settings", null)) {
|
||||||
assertFalse(destinationPillVisible(route, conversationOpen = false, decisionOpen = true))
|
assertFalse(destinationPillVisible(route, conversationOpen = false, runDetailOpen = true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun aRunDetailCoversEveryNonListLevelAndBackRestoresTheListPill() {
|
||||||
|
val list = PaneSelection()
|
||||||
|
val detail = PaneSelection(pane = MasterPane.Detail, itemId = 12)
|
||||||
|
val stage = detail.copy(pane = MasterPane.Stage, stageKey = "implementer")
|
||||||
|
val section = stage.copy(pane = MasterPane.Section, sectionKey = "output")
|
||||||
|
|
||||||
|
assertFalse(runDetailOpen("runs", list))
|
||||||
|
assertTrue(destinationPillVisible("runs", conversationOpen = false, runDetailOpen = runDetailOpen("runs", list)))
|
||||||
|
for (selection in listOf(detail, stage, section)) {
|
||||||
|
assertTrue(runDetailOpen("runs", selection))
|
||||||
|
assertFalse(destinationPillVisible("runs", conversationOpen = false, runDetailOpen = runDetailOpen("runs", selection)))
|
||||||
|
}
|
||||||
|
assertFalse(runDetailOpen("pipelines", detail))
|
||||||
|
assertFalse(runDetailOpen("runs", backFrom(detail)))
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun theContentKeepsItsOwnHeightBecauseThePillIsAnOverlay() {
|
fun theContentKeepsItsOwnHeightBecauseThePillIsAnOverlay() {
|
||||||
// The pill floats above the content and never takes layout space, so the
|
// The pill floats above the content and never takes layout space, so the
|
||||||
@@ -132,15 +145,15 @@ class PipelinesNavTest {
|
|||||||
// when hidden.
|
// when hidden.
|
||||||
for (route in listOf("pipelines", "chat", "runs", "settings", null)) {
|
for (route in listOf("pipelines", "chat", "runs", "settings", null)) {
|
||||||
for (open in listOf(false, true)) {
|
for (open in listOf(false, true)) {
|
||||||
for (deciding in listOf(false, true)) {
|
for (detailOpen in listOf(false, true)) {
|
||||||
val drawn = destinationPillVisible(route, open, deciding)
|
val drawn = destinationPillVisible(route, open, detailOpen)
|
||||||
val inset = pillScrollInset(drawn)
|
val inset = pillScrollInset(drawn)
|
||||||
assertTrue(
|
assertTrue(
|
||||||
"scroll clearance held behind a hidden pill on $route (open=$open, deciding=$deciding)",
|
"scroll clearance held behind a hidden pill on $route (open=$open, detail=$detailOpen)",
|
||||||
drawn || inset.value == 0f,
|
drawn || inset.value == 0f,
|
||||||
)
|
)
|
||||||
assertTrue(
|
assertTrue(
|
||||||
"list not cleared of a drawn pill on $route (open=$open, deciding=$deciding)",
|
"list not cleared of a drawn pill on $route (open=$open, detail=$detailOpen)",
|
||||||
!drawn || inset.value == drawnInset.value,
|
!drawn || inset.value == drawnInset.value,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,25 @@
|
|||||||
# The destinations pill stands down over a run's pending decision
|
# The destinations pill stands down in a run detail
|
||||||
|
|
||||||
## What this item changed
|
## What this item changed
|
||||||
|
|
||||||
`android/` only, the app shell's floating destination pill and the run view's decision surface.
|
`android/` only, the app shell's floating destination pill and run-detail stack.
|
||||||
|
|
||||||
- `ui/PipelinesApp.kt` — the pill's one rule gains a second hiding state.
|
- `ui/PipelinesApp.kt` — the pill's one rule gains a run-detail hiding state.
|
||||||
`destinationPillVisible(currentRoute, conversationOpen, decisionOpen)` is now
|
`destinationPillVisible(currentRoute, conversationOpen, runDetailOpen)` is now
|
||||||
`!(currentRoute == CHAT_ROUTE && conversationOpen) && !decisionOpen`: the chat conversation
|
`!(currentRoute == CHAT_ROUTE && conversationOpen) && !runDetailOpen`: the chat conversation
|
||||||
hides it exactly as before (the chat clause is unchanged), and a run's open pending-decision
|
hides it exactly as before (the chat clause is unchanged), and the full run-detail stack hides
|
||||||
surface hides it too. Everything downstream is unchanged and still keys off that one
|
it too. `runDetailOpen` derives from the Runs destination's saved selection depth, so it
|
||||||
|
covers summary, graph, stage, artifact and decision surfaces and Back to the list restores it.
|
||||||
|
Everything downstream is unchanged and still keys off that one
|
||||||
predicate — `contentPillPadding(pillVisible)` (the named zero) and
|
predicate — `contentPillPadding(pillVisible)` (the named zero) and
|
||||||
`pillScrollInset(pillVisible)` (the named `DESTINATION_PILL_RESERVE` +
|
`pillScrollInset(pillVisible)` (the named `DESTINATION_PILL_RESERVE` +
|
||||||
`ATTENTION_CHIP_RESERVE`, or `0.dp` while hidden) — so hiding the pill over a decision
|
`ATTENTION_CHIP_RESERVE`, or `0.dp` while hidden) — so hiding the pill in a run detail
|
||||||
leaves no empty band, exactly as hiding it in a conversation already does. The shell holds
|
leaves no empty band, exactly as hiding it in a conversation already does.
|
||||||
the new input as `decisionSurfaceOpen` (`remember { mutableStateOf(false) }`: a transient
|
|
||||||
state of the run view, not a destination and not saved — the sheet is not saveable either,
|
|
||||||
so a configuration change closes both together) and passes its setter down the same path
|
|
||||||
`decisionRequest` already travels.
|
|
||||||
- `ui/components/DecisionPrompt.kt` — gains `onSurfaceOpenChange: (Boolean) -> Unit = {}`,
|
|
||||||
reporting `open` on every change (`LaunchedEffect(open)`) and clearing it when the prompt
|
|
||||||
leaves the composition (`DisposableEffect`) so a surface closed with its pane can never
|
|
||||||
leave the pill hidden behind it. The component still owns no networking and no pill
|
|
||||||
knowledge: it only says when its own surface is up.
|
|
||||||
- `ui/screens/RunDetailScreen.kt`, `ui/RunsDestination.kt`, `ui/graph/StageDetailPane.kt` —
|
|
||||||
the run detail, the runs destination and the run's stage pane (its section level included)
|
|
||||||
pass that callback through, so the decision sheet hides the pill wherever it is opened
|
|
||||||
from. The pipeline-side stage pane gets the default no-op.
|
|
||||||
- Tests — `PipelinesNavTest`: the existing `destinationPillVisible` test is extended in place
|
- Tests — `PipelinesNavTest`: the existing `destinationPillVisible` test is extended in place
|
||||||
(renamed `thePillStandsDownWhileAConversationOrARunDecisionSurfaceIsOpen`) to pin that the
|
(renamed `thePillStandsDownWhileAConversationOrRunDetailIsOpen`) to pin that the full
|
||||||
decision surface hides the pill on the runs route, that a run being read keeps it, and that
|
run-detail stack hides the pill on the runs route, that the run list restores it, and that
|
||||||
the chat clause is untouched; and the scroll-inset test's loop gains the decision
|
the chat clause is untouched; and the scroll-inset test's loop gains the detail
|
||||||
dimension, so `pillScrollInset` is proved zero while the decision surface hides the pill
|
dimension, so `pillScrollInset` is proved zero while a run detail hides the pill
|
||||||
(no empty band) and the drawn reserve while it is drawn.
|
(no empty band) and the drawn reserve while it is drawn.
|
||||||
|
|
||||||
No new dimension, so no `ui/theme/Dimens.kt` token was needed (a raw literal would fail
|
No new dimension, so no `ui/theme/Dimens.kt` token was needed (a raw literal would fail
|
||||||
@@ -43,32 +32,29 @@ started from the app.
|
|||||||
place; the `docs-fold` writer should update it.
|
place; the `docs-fold` writer should update it.
|
||||||
|
|
||||||
- `android/README.md:6219` — the section headline
|
- `android/README.md:6219` — the section headline
|
||||||
"## Destination pill stands down in an open conversation (17 Oct 2026)" and its opening
|
"## Destination pill stands down in an open conversation (17 Oct 2026)" and its opening
|
||||||
paragraph ("It now stands down while the Chat destination is showing an open conversation
|
paragraph ("It now stands down while the Chat destination is showing an open conversation
|
||||||
and stays everywhere else, unchanged") now describe only half the rule. The section should
|
and stays everywhere else, unchanged") now describe only half the rule. The section should
|
||||||
also record the new item, e.g. append a dated section:
|
also record the new item, e.g. append a dated section:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
## The destinations pill stands down over a run's pending decision (18 Oct 2026)
|
## The destinations pill stands down in a run detail (18 Oct 2026)
|
||||||
|
|
||||||
The floating destinations pill also stood over a run's pending-decision surface — the
|
The floating destinations pill also stood over run-detail surfaces. It now stands down for
|
||||||
decision sheet ("Choose things that need to happen") the operator opens from the run
|
the entire detail stack — summary, graph, stage, artifact and pending-decision surfaces —
|
||||||
summary's Decide action — where it covered the options. It now stands down there too,
|
exactly as it already does inside an open chat conversation, and returns on Back to the runs
|
||||||
exactly as it already does inside an open chat conversation, and returns the moment the
|
list. `android/` only; no new dependency, no run started from the app, no
|
||||||
decision is answered or dismissed. `android/` only; no new dependency, no run started from
|
server/installer/Docker file touched.
|
||||||
the app, no server/installer/Docker file touched.
|
|
||||||
|
|
||||||
- **The one rule gains a second hiding state.** `destinationPillVisible(currentRoute,
|
- **The one rule gains a second hiding state.** `destinationPillVisible(currentRoute,
|
||||||
conversationOpen, decisionOpen)` is `!(currentRoute == CHAT_ROUTE && conversationOpen) &&
|
conversationOpen, runDetailOpen)` is `!(currentRoute == CHAT_ROUTE && conversationOpen) &&
|
||||||
!decisionOpen`. The chat clause is unchanged; the new `decisionOpen` is reported up by the
|
!runDetailOpen`. The chat clause is unchanged; `runDetailOpen` derives from the Runs
|
||||||
run view (`DecisionPrompt.onSurfaceOpenChange`), so the surface is a state of the run view,
|
destination's saved selection depth, so every run-detail surface follows the same rule.
|
||||||
not a destination: answering or dismissing it returns the pill with no navigation.
|
|
||||||
- **Still one predicate, still no band.** `contentPillPadding` and `pillScrollInset` are
|
- **Still one predicate, still no band.** `contentPillPadding` and `pillScrollInset` are
|
||||||
unchanged and still derive from `pillVisible` alone, so a hidden pill over the decision
|
unchanged and still derive from `pillVisible` alone, so a hidden pill in a run detail
|
||||||
leaves no empty band; the scroll-inset test now loops the decision dimension and pins that.
|
leaves no empty band; the scroll-inset test now loops the detail dimension and pins that.
|
||||||
- **Scoped to the decision surface.** A run being read, its stage pane, an artifact and the
|
- **Scoped to the run detail.** The run list keeps the pill; every run-detail surface hides it.
|
||||||
graph all keep the pill; only the open decision sheet hides it. The chat behaviour and the
|
The chat behaviour and the narrow/wide placement rules are untouched.
|
||||||
narrow/wide placement rules are untouched.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Not stale
|
## Not stale
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Run summary Changes viewer
|
||||||
|
|
||||||
|
Item: Android-only recovery of the run summary's observed file-change evidence.
|
||||||
|
|
||||||
|
## What changed
|
||||||
|
|
||||||
|
- `RunSummaryTab.kt` adds a separately collapsible **Changes** section after
|
||||||
|
artifacts. Its header reports the observed file count and `+N -M` statistic.
|
||||||
|
- `ui/changes/` aggregates per-stage file captures by path, preserves capture
|
||||||
|
caveats (unavailable, partial, binary, truncated and mode-only), parses unified
|
||||||
|
patches, and opens a full-screen raw/rendered viewer with file paging, line
|
||||||
|
gutters, scrolling and copy support.
|
||||||
|
- `ChatDiffCard.kt` provides shared diff marker and colour helpers so chat and
|
||||||
|
run evidence render additions, removals and context consistently.
|
||||||
|
|
||||||
|
The screen reports observed workspace changes only; it does not claim model
|
||||||
|
authorship. Large content is scrollable rather than eagerly expanded into the
|
||||||
|
summary layout.
|
||||||
|
|
||||||
|
## Documentation now stale (for `docs-fold`)
|
||||||
|
|
||||||
|
- `android/README.md`'s run-summary/artifact documentation does not describe the
|
||||||
|
Changes disclosure, its raw/rendered viewer, or its capture caveats. Add a
|
||||||
|
dated Android section describing the observed-file count, `+N -M` totals,
|
||||||
|
collapse state, and that unavailable/partial/binary/truncated captures are
|
||||||
|
stated honestly rather than fabricating a diff.
|
||||||
|
|
||||||
|
## Not stale
|
||||||
|
|
||||||
|
- No packaged OpenCode skill reference, README outside `android/README.md`, or
|
||||||
|
`internal/author/install.go` inventory documents this Android-only screen.
|
||||||
Reference in New Issue
Block a user