Make the run summary's artifacts gallery a collapsed section

The run summary led with the artifacts gallery, but it was always open, so a
long run's grid pushed the run's own facts below the fold. The gallery now
sits in one collapsed-by-default section in the same place, with a header that
describes itself while collapsed.

- RunDetailScreen.kt: RunSummaryTab renders the gallery through the shared
  LazyListScope.collapsibleSection, keyed "artifacts" and seeded with
  rememberSectionExpansion(run.id), so a run opened fresh starts collapsed and
  the operator's choice persists per run across tab switches and config
  changes. Order is unchanged: the section still leads the summary and the
  facts item follows it. Expanding composes the unchanged ArtifactGallery;
  collapsing composes nothing.
- ArtifactGroups.kt: new pure runArtifactsHeader(steps, executing) builds the
  self-describing header - singular/plural title, recorded count and
  "· partial capture" when any visit excluded or omitted files; empty runs
  reuse the shared artifactsEmptyMessage. Its count equals runArtifactGroups'
  tile total, so the header and the expanded gallery cannot disagree.
- ArtifactGroupsTest.kt: four header tests covering count, singular vs plural,
  the partial-capture notes and the empty case, plus a count-matches-gallery
  assertion.
- android/README.md: records the change and its verification evidence.

Android only; no new dependency, no run started from the app, device work on
the operator's Pixel 10 Pro Fold (58281FDCG000JF). Verified: 269/0/0/0 unit
tests, clean assembleDebug and published APK LAN URL 200.
This commit is contained in:
2026-10-16 17:51:56 +01:00
parent 95150c79c5
commit e1c531a537
4 changed files with 236 additions and 13 deletions
+82
View File
@@ -3580,3 +3580,85 @@ matched `2adaf03e…`), so any capture could not be attributed to this build. Th
wide/narrow captures above predate the refactor; the refactor changes no UI
pixels, so they remain representative of the gallery this code renders.
## Collapsible artifacts gallery in the run summary (16 Oct 2026)
The artifacts gallery led the run summary but was always open, so a long run's
grid pushed the run's own facts below the fold. It is now one
collapsed-by-default section in the same place. `android/` only; no dependency
was added (the chevron is the existing `material-icons-extended`
`KeyboardArrowDown` the shared `SectionHeader` already uses), no run was started
from the app, and every device command targeted the operator's Pixel 10 Pro Fold
(`58281FDCG000JF`), never an emulator.
- **One collapsed section, same place.** `RunDetailScreen.kt`'s `RunSummaryTab`
renders the gallery through the shared `LazyListScope.collapsibleSection`,
keyed `"artifacts"` and seeded with `rememberSectionExpansion(run.id)`, so a
run opened fresh starts collapsed and the operator's expand/collapse choice
survives Summary↔tab switches, configuration changes and rotation exactly like
every other section. The order is unchanged: the artifacts section still leads
the summary and the facts item follows it.
- **A self-describing header.** The new pure `runArtifactsHeader(steps,
executing)` (`ui/ArtifactGroups.kt`) builds the header text — the title (its
singular form for exactly one artifact), how many the run recorded, and
`· partial capture` when any visit excluded or omitted files; with no artifacts
it reuses the shared `artifactsEmptyMessage`. Its count is exactly
`runArtifactGroups`'s tile total, so the header and the expanded gallery can
never disagree.
- **The gallery itself is unchanged.** Expanding composes the same
`ArtifactGallery` (the width-derived thumbnail grid, tap for full size, the
non-media tiles with name, size and content type plus their open/copy/share
actions); collapsing composes nothing. The stage pane's per-visit artifacts
section and every other summary section are untouched.
Evidence (macOS, JDK 17 from Homebrew `openjdk@17`, Gradle 8.11.1 from the
wrapper cache, `ANDROID_HOME=/Users/alan/Library/Android/sdk`, `--offline`,
every Gradle command with `--no-daemon`):
- `gradle --no-daemon --offline :app:testDebugUnitTest` → `BUILD SUCCESSFUL`; the
test-result XMLs aggregate to **269 tests, 0 failures, 0 errors, 0 skipped**.
`ArtifactGroupsTest` gained `headerReportsTheCountWithASingularTitleForOne`,
`headerAddsPartialCaptureOnlyWhenFilesWereExcludedOrOmitted`,
`headerEmptyCaseUsesTheSharedEmptyWording` and
`headerCountMatchesTheGalleryRecordedTotal`.
- `gradle --no-daemon --offline :app:assembleDebug` → `app-debug.apk`
**18,011,393 bytes**, sha256
`c5655269e490db34cbacccf68eaec468a3a41c46c661b41e6ad2d92295235247`; installed
with `adb -s 58281FDCG000JF install -r`, and the pulled `base.apk` sha matched
the local build, so the captures below are attributed to this exact build.
- Run **136** (pipeline id 11 v1, `succeeded`, 17 artifacts) on the Pixel:
- **Wide** (inner display, 2152×2076 @330 ≈ 1043dp):
`summary_wide_collapsed.png` shows the summary led by a lone collapsed
`Artifacts · 17 recorded · partial capture` header (right chevron) with the
run's facts immediately below and no gallery; `summary_wide_expanded.png`
shows the same header expanded to the unchanged gallery — the
`implementer · visit 1` and `ui_reviewer · visit 1` groups of image
thumbnails plus the `chat_stub_approval.py` (`<>` code glyph) and `stub.log`
(log glyph) tiles with their names, `9.3 KiB`/`220 B` sizes and share/copy
actions.
- **Narrow** (`wm size 1080x2152` on the inner display ≈ 524dp, reset to the
native size afterwards): `summary_narrow_collapsed.png` and
`summary_narrow_expanded.png` show the same collapsed header and, expanded,
the same gallery re-flowed to four cells per row (wide uses five).
- **Persistence.** `uiautomator dump` reported `Artifacts · 17 recorded ·
partial capture, collapsed` on a freshly opened run; toggling it and
round-tripping Summary → Graph → Summary, and a `wm size` configuration
change, both kept the operator's expanded/collapsed choice.
- `adb -s 58281FDCG000JF logcat -d | grep -cE 'FATAL EXCEPTION|E
AndroidRuntime'` returned 0; the screen stayed awake (`svc power stayon usb`
+ `KEYCODE_WAKEUP`) and every capture used `screencap -p -d <display-id>` +
`adb pull`. Screenshots, `uiautomator` dumps and the APK are in
`…/artifacts/155/1/`.
- **APK publish.** `app-debug.apk` copied to
`…/artifacts/155/1/pipelines-debug-wip-95150c7.apk` (`95150c7` = short `HEAD`;
the working tree is uncommitted WIP on top of it); `shasum -a 256` matched.
`curl -I http://10.0.0.249:8080/artifacts/155/1/pipelines-debug-wip-95150c7.apk`
returned `HTTP/1.1 200 OK`, `Content-Type:
application/vnd.android.package-archive`, `Content-Length: 18011393`.
Not verified in this pass: no device capture exercises the empty or the
single-artifact header wording (both are covered by the `runArtifactsHeader`
unit tests); the narrow window was produced with a `wm size` override on the
inner display rather than a physical fold, then reset; `:app:lintDebug` was not
re-run (its only known findings remain the two pre-existing `NewApi` errors for
`android:windowLightNavigationBar`).