Migrate the graph, panes, rail and sheet onto the geometry tokens

Move the workflow-graph package (WorkflowGraph, the StageDetailPane sheet,
Artifacts, ArtifactViewer, ArtifactImage) off its remaining raw dp literals
and onto the geometry tokens, all substitutions value-equal so the visuals
are unchanged.

- ui/theme/Dimens.kt gains the off-scale component and graph-chrome sizes:
  the run legend's GRAPH_LEGEND_PAD_X/PAD_Y/GAP, the collapsed
  GRAPH_PANEL_MIN_HEIGHT (moved off WorkflowGraph.kt, now imported by its
  test), the gallery's ARTIFACT_TILE_DP/THUMB_DP/BADGE_DP/PROGRESS_DP/
  PROGRESS_STROKE_DP, and the stage-type chip's STAGE_CHIP_PAD_H.
- Artifact tile/row and thumbnail corner radii derive from the Material
  shape scale (MaterialTheme.shapes.medium/.small), matching the graph's
  existing node corners.
- DimensTest.kt's allow-list shrinks from 24 to 21 entries: 24.dp, 56.dp and
  96.dp are gone now that their last call sites migrated. The structural
  hairlines/zeros, the not-yet-migrated app shell and Settings literals, and
  the sp type values owned by Typography.kt remain.
- WorkflowGraphTest.kt imports the moved GRAPH_PANEL_MIN_HEIGHT.
- android/README.md documents the change and its verification evidence.

Verified: gradle :app:assembleDebug :app:testDebugUnitTest --rerun-tasks
BUILD SUCCESSFUL, 30 XMLs / 259 tests, 0 failures/errors/skipped; the
enforcement test fails on a deliberately introduced literal and passes once
removed; before/after captures at both window widths differ only on the
status-bar clock and live relative-time text.
This commit is contained in:
2026-10-16 13:08:54 +01:00
parent 3765fdfdf6
commit d546bc7a3a
9 changed files with 179 additions and 48 deletions
+85
View File
@@ -2414,6 +2414,91 @@ Not verified in this pass: `:app:lintDebug` (not run); the Runs-list and
run-detail before/after pairs are not byte-identical because their live
relative-time text and artifact thumbnails load asynchronously.
## The graph, panes, rail and sheet on the geometry tokens (16 Oct 2026)
`android/` only. Every replacement is value-equal, so the workflow graph, the
artifact gallery/viewer and the pane surfaces render exactly as before. No new
dependency, no server/Go/installer/Docker file touched, no run started from the
app, and every `adb`/emulator command targeted `emulator-5554` only (never
`emulator-5556` or the attached Pixel).
- **Scope.** The workflow-graph package (`ui/graph/WorkflowGraph.kt`,
`StageDetailPane.kt` — the stage detail *sheet* — `Artifacts.kt`,
`ArtifactViewer.kt`, `ArtifactImage.kt`) plus the two navigation components the
previous item left with their literals: the sliding *pane*
(`ui/components/SlidingPaneStack.kt`) and the detail *rail*
(`ui/components/DetailTabs.kt`). The pane and the rail already derive every
width and offset from tokens, so their only remaining literal is the structural
`0.dp` recorded in the allow-list; the graph/sheet/gallery files carried the
rest.
- **Spacing.** Every 2/4/8/12/16/24dp padding, gap, arrangement and offset on
those files now references `SPACING_XXS/XS/S/M/L/XL`; no value changed.
- **New tokens.** The off-scale component and graph-chrome sizes move into
`ui/theme/Dimens.kt`: the run legend's `GRAPH_LEGEND_PAD_X` (6dp),
`GRAPH_LEGEND_PAD_Y` (3dp) and `GRAPH_LEGEND_GAP` (10dp); the collapsed
`GRAPH_PANEL_MIN_HEIGHT` (320dp, moved off `WorkflowGraph.kt` and now imported
by its test); the gallery's `ARTIFACT_TILE_DP` (96dp), `ARTIFACT_THUMB_DP`
(56dp), `ARTIFACT_BADGE_DP` (16dp), `ARTIFACT_PROGRESS_DP` (24dp) and
`ARTIFACT_PROGRESS_STROKE_DP` (2dp); and the stage-type chip's
`STAGE_CHIP_PAD_H` (10dp). The artifact tile/row and thumbnail corner radii
derive from the Material shape scale (`MaterialTheme.shapes.medium`/`.small`),
exactly as the graph's own node corners already do, so no radius literal
remains.
- **The allow-list shrinks.** `ui/theme/DimensTest.kt`'s allow-list drops from
**24 to 21 entries**: `24.dp`, `56.dp` and `96.dp` are gone because their last
call site migrated onto a token. The remaining entries are the structural
hairlines/zeros (0/2/3/6dp), the spacing values still used by the not-yet-
migrated app shell and Settings screen, and the `sp` type values owned by
`Typography.kt`.
Evidence (macOS, JDK 17 from Homebrew `openjdk@17`,
`ANDROID_HOME=~/Library/Android/sdk`, Gradle 9.7.1, `--offline`):
- `gradle :app:assembleDebug :app:testDebugUnitTest --rerun-tasks --console=plain`
→ `BUILD SUCCESSFUL`; `--rerun-tasks` re-ran all 30 result XMLs to **259 tests,
0 failures, 0 errors, 0 skipped**. `app/build/outputs/apk/debug/app-debug.apk`
is 17,995,009 bytes, sha256
`c5da095aec8a01120d4d847da69f71fa2fe0f937290f3c9a5190a9de8b813b0f`.
- **Allow-list shrinks.** `git show HEAD:…DimensTest.kt` counts 24 entries; the
working tree counts 21.
- **Enforcement proof.** Appending `private val PROBE_RAW_LITERAL = 123.dp` to
`ui/graph/Artifacts.kt` made
`gradle :app:testDebugUnitTest --tests net.awan.pipelines.ui.theme.DimensTest`
`FAILED` with `raw dimension literals outside
net/awan/pipelines/ui/theme/Dimens.kt:
[net/awan/pipelines/ui/graph/Artifacts.kt:497: 123.dp]`; removing the line made
the same task `BUILD SUCCESSFUL`. The probe was reverted.
- **Before/after screenshots on `emulator-5554` only** (fold AVD, 2076x2152 /
390dpi; narrow 1080x2340 and wide 2000x3400 via `wm size`; never
`emulator-5556` or the attached Pixel), against the live server at
`ws://10.0.2.2:8080/connect`, each frame captured and validated with
`scripts/capture_png.sh -s emulator-5554`. The **before** APK was built from a
`git archive HEAD` tree (`3765fdf`, sha256 `d40d7b78…`, byte-identical to the
previous item's published APK); the **after** APK from the working tree (sha256
`c5da095a…`). Three surfaces were captured at both widths — the Pipelines list
(the *panes*), the "Friend demo" pipeline **Graph** tab, and the opened stage
detail **sheet** — as `graph-*`, `sheet-*` and `list-{narrow,wide}-{before,after}.png`
in `~/.local/share/pipelines/data/artifacts/125/1/`. `captures/imgdiff.py`
reports a mean channel difference of `0.0` for the wide sheet, `0.01` for the
wide/narrow graph and the wide list, and `0.03` for the narrow sheet — the only
differing pixels are the status-bar clock; the list pairs also differ on their
live relative-time text. The layout itself is unchanged.
- `adb -s emulator-5554 logcat -d` held 0 `FATAL EXCEPTION` / 0
`E AndroidRuntime` lines; `animator_duration_scale` was left at 1; no run was
started from the app.
- **APK publish.** `app-debug.apk` copied to
`~/.local/share/pipelines/data/artifacts/125/1/pipelines-debug-wip-3765fdf.apk`
(`3765fdf` = `git rev-parse --short HEAD`; the working tree is uncommitted WIP
on top of it), sha256 `c5da095a…`. `curl -I
http://10.0.0.249:8080/artifacts/125/1/pipelines-debug-wip-3765fdf.apk`
returned `HTTP/1.1 200 OK`, `Content-Type:
application/vnd.android.package-archive`, `Content-Length: 17995009`, and a
streamed `GET | shasum -a 256` returned the same `c5da095a…`.
Not verified in this pass: `:app:lintDebug` (not run); the app shell
(`PipelinesApp.kt`) and the Settings screen still keep their literals, so those
allow-list entries remain.
## An app-owned run-status palette (16 Oct 2026)
Run status had the wrong hue for its two most important states because it was