Merge lane-d: open stage sections as their own pane

Combine the local list-scroll/covered-edge and hoisted pane wiring work with
lane-d's Section pane level, sectionKey persistence, three-way back
descriptions and single-Column CollapsibleSectionBody. Both intents survive:
conflicts in README, PipelinesApp, StageDetailPane, PaneState, Sections and
their tests were resolved by composing both sides, without conflict markers.

Build: ./gradlew :app:assembleDebug
Tests: ./gradlew :app:testDebugUnitTest (322 tests, 0 failures)
This commit is contained in:
2026-10-16 20:37:07 +01:00
7 changed files with 699 additions and 232 deletions
+108 -1
View File
@@ -3556,7 +3556,6 @@ native 2208x1840 @420 at the end.
returned `HTTP/1.1 200 OK`, `Content-Type: application/vnd.android.package-archive`,
`Content-Length: 17928873`.
## Remembering the list scroll position (16 Oct 2026)
Returning from a pipeline or a run now restores the list to exactly where the
@@ -3754,3 +3753,111 @@ review stages, and the device policy for this brief keeps the implementation to
the build and the unit tests. Four levels are also unreachable in the app itself
(`MasterPane.List/Detail/Stage`, `MAX_PANE_DEPTH = 2`), so the four-level fold is
covered by the pure `coveredEdgesDp` cases rather than by a screenshot.
## Stage sections open as their own pane, not inline (16 Oct 2026)
The reported stage-screen defect was real and, once reproduced, exactly as
described: expanding a section stacked its rows at the top of the section. It is
fixed by opening every stage section as its own pane and by laying a collapsible
body out in one column. `android/` only; nothing in the Pipelines server, its Go
source, the Docker/compose files or the installer was touched, no run was started
from the app, no dependency was added, and every `adb`/emulator command targeted
`emulator-5554` only (never `emulator-5556` or the attached Pixel).
- **The defect and its cause.** Expanding `Stage definition` on the stage screen
drew its fields stacked at the top: the last field's card (`Memory`) sat
directly under the header and every other row (`Type`, `Prompt`, `Outcomes`,
`Model`, …) was hidden underneath it. The section's content lambda emitted one
composable per field (`definition.forEach { StageFieldRow(it) }`) straight into
`CollapsibleSectionBody`'s `AnimatedVisibility`, which lays out a *single*
child: several children were placed on top of each other (all at the section's
origin) instead of one below the next, so the body had the height of its tallest
single row and showed only the last one. Reproduced on the pre-change tree
(below).
- **Sections are panes.** A stage section is no longer expanded in place. The
stage screen keeps a **compact list** of section rows (`Artifacts`, `Output`,
`Input`, `This run`, `Stage definition`) and tapping one opens that section as
the next pane of the stack — a full-window screen on a narrow window, a panel
to the right of the stage pane on a wide one — with its own `Scaffold`/
`TopAppBar` named for the section, its own scroll and its own top spacing.
Back (the app bar, the gesture or a peek) returns exactly one level, to the
stage screen. `MasterPane` gained the `Section` level (`MAX_PANE_DEPTH = 3`)
and `PaneSelection.sectionKey` (a primitive saved with the pane selection), so
the open section survives rotation and process death and the wide covered peeks
fold (`"2 more"`) as the fourth pane is added.
- **No trivial inline exceptions.** None of the five sections is kept inline.
Each can hold an arbitrarily long value — the definition's prompt/output
contract, the input/output maps, the run evidence and the artifacts gallery —
so an inline body would both risk the layout with many rows and push the
operator's run context off screen; one uniform rule keeps the screen
predictable.
- **The shared body fix.** `CollapsibleSectionBody` now lays its content out in a
single full-width `Column`, so *any* collapsible section with more than one row
(it also backs the run/pipeline detail `collapsibleSection` lists) stacks its
rows under the header instead of overlapping them.
- **Semantics kept.** Sections start collapsed; the operator's choice (which
section is open, and the visit) is saved with the pane selection; and each
section's content is derived from the same `stageSectionSpecs`
(`runStepFields`, `stageDefinitionFields`, `ArtifactsSection`) as before, so
nothing shown changed — the stage screen just lists the sections and the
section pane shows one.
- **Shared derivation.** `stageSectionSpecs(stageKey, graph, runSteps,
visitIndex, runContext)` is the one pure list of sections (key, title, fields,
artifacts) the stage screen and the section pane both read, so the two can
never disagree; `StageVisitTabs` is the one visit tab row both use; and
`StageSectionPane`/`StageSectionBody` render a section (the artifacts section
keeps the shared `ArtifactSelectionScaffold`, so its gallery retains
long-press selection, the contextual bar and Back-leaves-selection-first).
Evidence (macOS, Homebrew JDK 17 `openjdk@17`, Gradle 9.7.1,
`ANDROID_HOME=~/Library/Android/sdk`, `--offline`):
- `gradle :app:assembleDebug :app:testDebugUnitTest --offline --console=plain` →
`BUILD SUCCESSFUL`; the 30 result XMLs aggregate to **262 tests, 0 failures, 0
errors, 0 skipped** (the updated `PaneStateTest` section-level/`backStep`/
`popTo` cases and the `StageDetailSheetTest` `stageSectionSpecs` cases
included). `app/build/outputs/apk/debug/app-debug.apk` is **18,011,393 bytes**,
sha256 `5912d38fef80aa8aad53132ac5bb1e05fd42fdb9d0ae778e7dc0a1af732e4019`.
- `gradle :app:lintDebug --offline` → the same **2 pre-existing** `NewApi` errors
for `android:windowLightNavigationBar` in `res/values/themes.xml` and
`res/values-night/themes.xml` (unchanged by this pass); no error is attributed
to a changed file.
- On `emulator-5554` only (fold AVD; wide `wm size reset` = 2076x2152 / 390dpi ≈
852dp, narrow `wm size 1080x1920` / `wm density 480` ≈ 360dp; never the
attached Pixel, never `emulator-5556`) against the live server, driving run
145's `implementer` from a Timeline row; every frame was captured and validated
with `scripts/capture_png.sh -s emulator-5554` into
`~/.local/share/pipelines/data/artifacts/144/1/`:
- **Before** (the pre-change tree rebuilt from `HEAD`): `before-wide-stage-sections.png`
then `before-wide-definition-inline.png` — tapping `Stage definition` shows the
overlap defect (the `Memory` card under the header, the other rows hidden).
- **After**: `after-wide-stage-sections.png` (the compact list, every row
chevron-right/collapsed), `after-wide-section-opened.png` (the `Stage
definition` panel to the right of the stage pane, peeks `Back to run`/
`Back to stage`), `after-wide-artifacts-opened.png` (the `Artifacts` pane from
the same list), `after-narrow-section-opened.png` (full-window `Stage
definition`, its own title/scroll/spacing) and `after-narrow-stage-sections.png`
(Back returned to the compact stage screen). The narrow section pane was
reached by opening it wide and folding the window, which exercises the saved
section surviving the configuration change.
- `adb -s emulator-5554 shell input keyevent 4` from the section pane returned to
the stage screen (the compact rows reappear, no `Back to stage` strip); no run
was started from the app; `wm size`/`density` were reset afterwards.
- **APK publish.** `app-debug.apk` copied to
`~/.local/share/pipelines/data/artifacts/144/1/pipelines-debug-wip-c700b28.apk`
(`c700b28` = `git rev-parse --short HEAD`; the working tree is uncommitted WIP on
top of it). `curl -I
http://10.0.0.249:8080/artifacts/144/1/pipelines-debug-wip-c700b28.apk` returned
`HTTP/1.1 200 OK`, `Content-Type: application/vnd.android.package-archive`,
`Content-Length: 18011393`; a streamed `GET | shasum -a 256` returned the same
`5912d38f…`. At 17.2 MiB it exceeds the 8 MiB per-file inventory cap, so it is
served by direct URL only.
Not verified in this pass: a clean `logcat` sweep was not conclusive because the
emulator was shared — installs this pass did not issue appeared in the log during
the sweep and the UI moved between commands. The one `FATAL EXCEPTION` present was
the `uiautomator` dump tool itself (`com.android.commands.uiautomator`), never
`net.awan.pipelines`. The artifacts section was captured for a visit that recorded
none (`Artifacts · not recorded for this visit`) rather than the populated
gallery (the same gallery branch is covered by the run-summary grid); the wide
fold indicator (`"2 more"`) was present but is not separately cropped.