From 1fece882862614d670cf0efffb7e161596385641 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 16 Oct 2026 02:33:30 +0100 Subject: [PATCH] Make the Android stage detail pane an opaque raised sheet The pane's Scaffold already painted an opaque colour, but it was the app background role, identical to the peeks it slides over, so it read as "no background" and its rows ran together with the covered pane's compact identity. Paint the whole pane one theme container role: StageDetailPane gains paneContainerColor() = colorScheme.surfaceContainer and applies it to the Scaffold container, the TopAppBar and the visit PrimaryScrollableTabRow, and StageSection passes it to the shared SectionHeader, which gains an opaque containerColor parameter defaulting to the previous background. The pane now fully covers the area it occupies, including under a sticky section header, and sits a tuneful step above the app background it covers. Move the shared cards one step up so a card stays a card on the new sheet: CodeBlock and the artifacts ArtifactRow use surfaceContainerHigh and the full-size artifact dialog uses surfaceContainerHighest. No geometry, inset or dependency changes; all colours come from the existing theme. Verified with gradle :app:assembleDebug and :app:testDebugUnitTest (137 tests, 0 failures) and by capturing the pane open over the graph and the Timeline at both window widths on emulator-5554. android/README.md records the change and evidence. --- android/README.md | 61 +++++++++++++++++++ .../awan/pipelines/ui/components/CodeBlock.kt | 8 ++- .../awan/pipelines/ui/components/Sections.kt | 15 +++-- .../net/awan/pipelines/ui/graph/Artifacts.kt | 4 +- .../pipelines/ui/graph/StageDetailPane.kt | 21 ++++++- 5 files changed, 99 insertions(+), 10 deletions(-) diff --git a/android/README.md b/android/README.md index 73f53e3f..9bbf9d09 100644 --- a/android/README.md +++ b/android/README.md @@ -1377,3 +1377,64 @@ only the title/type and the collapsed section, which the pure terminal node opened from a run graph likewise collapses its single `Incoming routes` definition-and-only section. The wide layout was exercised headless on the fold AVD, not on physical hardware. + +## The stage pane is an opaque container (16 Oct 2026) + +The stage detail pane already painted an opaque `Scaffold`, but that was the app +`background` role, identical to the peek strips it slides over, so it read as +"no background" and its rows ran together with the covered pane's compact +identity. The pane is now a raised sheet. + +- `StageDetailPane` gives the pane the theme's `surfaceContainer` role through a + single `paneContainerColor()` used by all of the pane's own surfaces: the + `Scaffold` container, the `TopAppBar`, the visit `PrimaryScrollableTabRow` and + every section header (`StageSection` passes it to the shared `SectionHeader`, + which gained a `containerColor` parameter defaulting to the previous + `background`). The pane therefore fully covers the area it occupies — including + under a section header — as one tone, and sits a clear step above the + `background` peeks and above the content it covers on a narrow window. The + covered pane's peek is unchanged and still expected. +- `CodeBlock` and the artifacts `ArtifactRow` moved from `surfaceContainer` to + `surfaceContainerHigh` (the full-size artifact dialog to + `surfaceContainerHighest`), so a card stays a visible card on both the app + background and a pane's `surfaceContainer` sheet. No geometry, insets or + dependencies changed; all colour roles come from the existing theme. + +Evidence on `emulator-5554` (fold AVD; narrow `wm size 1080x1920`, wide +`wm size reset` = 2076x2152 / 390dpi ≈ 852dp; **never** the attached Pixel) +against the live server, driven with `adb shell input` and `uiautomator dump`, +using `android/scripts/capture_png.sh -s emulator-5554` (every image validated): + +- **`gradle :app:assembleDebug`** → `BUILD SUCCESSFUL`; `app/build/outputs/apk/debug/app-debug.apk` + is 18,012,281 bytes. +- **`gradle :app:testDebugUnitTest`** → `BUILD SUCCESSFUL`; the 18 test-result XMLs + aggregate to **137 tests, 0 failures, 0 errors, 0 skipped**. +- `pane-opaque-wide-over-graph.png` / `pane-opaque-wide-over-timeline.png`: on the + wide window the `implementer` pane opened over run 69's Graph tab and over its + Timeline tab is a solid `surfaceContainer` sheet starting at the fixed peek + budget, clearly lighter than the `Runs`/run peeks to its left. +- `pane-opaque-narrow-over-graph.png` / `pane-opaque-narrow-over-timeline.png`: + on the narrow window the same pane opened over the run graph and the Timeline + fills the window as one opaque sheet with no bleed-through. +- `pane-opaque-narrow-over-running-graph.png`: the pane opened over run 70's + **running** graph (visit tabs, `Status running`) is equally opaque and readable + while the run polled. +- `pane-opaque-wide-definition-expanded.png` / + `pane-opaque-narrow-definition-expanded.png`: with a section expanded, the + `Prompt`/`Transcript` code cards are clearly a step lighter than the pane, so + the container change did not flatten the card hierarchy. +- **APK publish.** The debug APK was copied to + `~/.local/share/pipelines/data/artifacts/71/1/pipelines-debug-wip-cfd5887.apk` + (`cfd5887` = `git rev-parse --short HEAD`; the working tree is uncommitted WIP on + top of it), sha256 + `67f5223bd8f1c5ce8939ea786b62a222cdb5e59763d8bf3fd636ba5d52b6985e`. `curl -I + http://10.0.0.249:8080/artifacts/71/1/pipelines-debug-wip-cfd5887.apk` returned + `HTTP/1.1 200 OK`, `Content-Type: application/vnd.android.package-archive`, + `Content-Length: 18012281`; a streamed `GET | shasum -a 256` returned the same + hash. At 17.2 MiB it exceeds the server's 8 MiB per-file inventory cap, so it is + served by direct URL only. + +Not verified: the two app appearances are dark-only (`PipelinesTheme` defaults to +dark), so the `surfaceContainer` step was checked in the dark scheme only; the +pane's leading-edge shadow is not used (the tonal step is the separation) so no +new elevation token was introduced. diff --git a/android/app/src/main/java/net/awan/pipelines/ui/components/CodeBlock.kt b/android/app/src/main/java/net/awan/pipelines/ui/components/CodeBlock.kt index b13aece5..02f2e9f8 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/components/CodeBlock.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/components/CodeBlock.kt @@ -29,8 +29,10 @@ import net.awan.pipelines.ui.theme.pipelinesText /** * The one themed card for code-like content (Input, Output, Source, transcripts, * per-field/evidence data, diagnostics). It matches the rest of the app's cards - * (surfaceContainer role, default rounded shape, no elevation) rather than - * reading as a foreign bordered monospace box, and adds: + * (surfaceContainerHigh role, default rounded shape, no elevation) rather than + * reading as a foreign bordered monospace box — one tonal step above both the + * app background and a pane's surfaceContainer container, so a card stays a card + * wherever it is placed. It adds: * * - a small label header naming the block plus a whole-block copy action; * - monospace body at the shared [pipelinesText] `mono` size/line height; @@ -58,7 +60,7 @@ fun CodeBlock( Card( modifier = modifier.fillMaxWidth(), - colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainer), + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainerHigh), elevation = CardDefaults.cardElevation(defaultElevation = 0.dp), ) { Column { diff --git a/android/app/src/main/java/net/awan/pipelines/ui/components/Sections.kt b/android/app/src/main/java/net/awan/pipelines/ui/components/Sections.kt index 9eb05aa7..e7af1113 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/components/Sections.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/components/Sections.kt @@ -21,6 +21,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.rotate +import androidx.compose.ui.graphics.Color import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.clearAndSetSemantics import androidx.compose.ui.semantics.contentDescription @@ -33,9 +34,14 @@ import net.awan.pipelines.ui.theme.pipelinesText /** * The one collapsible section header shared by both detail screens: the section * title in the theme's section-header style, a trailing chevron that rotates - * with the state (animated, no jump cut), an opaque background matching the - * screen so content passing underneath a stuck header stays readable, and a - * subtle divider. + * with the state (animated, no jump cut), an opaque background so content + * passing underneath a stuck header stays readable, and a subtle divider. + * + * [containerColor] is the opaque colour the header covers with. It defaults to + * the screen background so a stuck header on an ordinary page hides the content + * scrolling under it; a caller whose surface is a different container (the stage + * pane) passes that same colour so the header never reads as a differently toned + * band across its pane. * * Accessibility is exposed without relying on the chevron: the header is a * single button node described as e.g. "Steps, expanded" and carries the @@ -47,6 +53,7 @@ fun SectionHeader( expanded: Boolean, onToggle: () -> Unit, modifier: Modifier = Modifier, + containerColor: Color = MaterialTheme.colorScheme.background, ) { val rotation by animateFloatAsState( targetValue = if (expanded) 0f else -90f, @@ -56,7 +63,7 @@ fun SectionHeader( modifier = modifier .fillMaxWidth() // Opaque: the header is sticky, so content scrolls under it. - .background(MaterialTheme.colorScheme.background) + .background(containerColor) .clickable(role = Role.Button, onClick = onToggle) .clearAndSetSemantics { contentDescription = "$title, ${if (expanded) "expanded" else "collapsed"}" diff --git a/android/app/src/main/java/net/awan/pipelines/ui/graph/Artifacts.kt b/android/app/src/main/java/net/awan/pipelines/ui/graph/Artifacts.kt index 98919f8a..f9acba51 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/graph/Artifacts.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/graph/Artifacts.kt @@ -233,7 +233,7 @@ private fun ArtifactRow( Surface( shape = RoundedCornerShape(12.dp), - color = MaterialTheme.colorScheme.surfaceContainer, + color = MaterialTheme.colorScheme.surfaceContainerHigh, modifier = Modifier.fillMaxWidth(), ) { Row( @@ -293,7 +293,7 @@ private fun FullSizeArtifactDialog( Dialog(onDismissRequest = onDismiss) { Surface( shape = RoundedCornerShape(16.dp), - color = MaterialTheme.colorScheme.surfaceContainerHigh, + color = MaterialTheme.colorScheme.surfaceContainerHighest, ) { Column( modifier = Modifier.padding(12.dp), diff --git a/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt b/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt index 0cf87a9d..2888b87b 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt @@ -20,6 +20,7 @@ import androidx.compose.material3.Surface import androidx.compose.material3.Tab import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf @@ -166,6 +167,16 @@ internal const val STAGE_DEFINITION_KEY = "definition" /** The stage-definition section's title, naming clearly what it holds. */ internal const val STAGE_DEFINITION_TITLE = "Stage definition" +/** + * The stage pane's opaque container colour, from the theme's container roles. The + * pane is a raised sheet: every one of its own surfaces (the scaffold, the app + * bar, the visit tab row and the section headers) paints this same colour, so the + * pane fully covers the area it occupies — including under a section header — and + * is a visible tonal step above the app background, never see-through. + */ +@Composable +internal fun paneContainerColor() = MaterialTheme.colorScheme.surfaceContainer + /** * Whether the stage-definition section starts expanded. It is the only content of * a pane opened without a run context (a pipeline's own stage definition, see @@ -322,6 +333,7 @@ fun StageDetailPane( } Scaffold( modifier = modifier, + containerColor = paneContainerColor(), topBar = { TopAppBar( title = { Text(GraphSemantics.nodeLabel(stageKey)) }, @@ -330,6 +342,7 @@ fun StageDetailPane( Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Back") } }, + colors = TopAppBarDefaults.topAppBarColors(containerColor = paneContainerColor()), ) }, ) { padding -> @@ -410,6 +423,7 @@ private fun StageDetailBody( PrimaryScrollableTabRow( selectedTabIndex = clampedVisit, edgePadding = 0.dp, + containerColor = paneContainerColor(), modifier = Modifier.fillMaxWidth().padding(top = 8.dp), ) { runSteps.forEachIndexed { index, _ -> @@ -485,7 +499,12 @@ private fun StageSection( title: String = key.capitalized(), content: @Composable () -> Unit, ) { - SectionHeader(title, expansion.isExpanded(key), { expansion.toggle(key) }) + SectionHeader( + title, + expansion.isExpanded(key), + { expansion.toggle(key) }, + containerColor = paneContainerColor(), + ) if (expansion.isExpanded(key)) content() }