Restructure the Runs area and add collapsible sticky sections

Four related UI changes, all requested after using the app on a phone.

- Graph pinch zoom is now anchored to the gesture centroid. The handler dropped
  the centroid and the canvas scaled about the content origin, so a pinch slid
  the graph away from the fingers. zoomAbout() keeps the content point under the
  fingers fixed, applies the pan and then clampOffset, with unit tests proving
  the centroid point is unchanged and the scale and bounds are respected.
- Pipeline detail and run detail now use a LazyColumn of collapsible sections
  (shared Sections.kt header, rotating chevron, animateContentSize) whose titles
  stick to the top while their content scrolls beneath, with per-section state
  remembered and exposed to accessibility. Steps and session evidence stay lazy
  list items instead of nested scrollables.
- The Runs list is rebuilt: the raw result preview is gone, failures show a
  two-line diagnostic in the error colour, each run has a colour-coded status
  chip with a matching icon per state (RunStatus.kt, core Material icons - no new
  dependency), the usage aggregates render as a metrics block with a formatted
  average instead of a run-on line of seconds, and runs are grouped by day under
  sticky date headers.
- Run detail steps are a timeline: a status dot joined to the next step, the
  stage and visit number, an outcome chip and the duration, with input, output,
  transcript, file changes and notifications behind a per-step 'Show details'.
- One centralised type hierarchy (Typography.kt) for screen title, section
  header, card title, subtitle, body and monospace data, applied across the list,
  the cards and both detail screens.

Verified: :app:assembleDebug and :app:testDebugUnitTest succeed offline with 53
tests and 0 failures (new FormatTest, RunStatusTest and RunGroupingTest;
WorkflowGraphTest 23 to 27), and the app was driven on the emulator with
screenshots of the runs list states, the sticky date header, the steps timeline,
an expanded step, a collapsed section and the sticky section header.
This commit is contained in:
2026-10-15 03:46:06 +01:00
parent 1a890d8c31
commit e843aa08a8
14 changed files with 1376 additions and 237 deletions
+55 -4
View File
@@ -89,7 +89,11 @@ stops it.
highlighted, others dimmed) plus a screen-reader description. Edges are drawn as
axis-aligned orthogonal polylines like the TUI (`routePoints` computes the
path once per layout and stores it on `EdgeLayout.points`), and each arrowhead
points along its route's final segment rather than the from-to chord.
points along its route's final segment rather than the from-to chord. Pinch
zoom is anchored to the gesture centroid: the pure `zoomAbout` keeps the
content point under the fingers fixed (clamped to `MIN_SCALE`/`MAX_SCALE`) and
the existing pan clamp is applied afterwards, so the content no longer slides
away from the fingers.
- One shared graph-panel height (`collapsedGraphHeight`/`expandedGraphHeight`)
replaces the former 360.dp and 340.dp literals, so both detail screens render
the graph at the same size: about 58% of the window height floored at a height
@@ -107,6 +111,34 @@ stops it.
is retained for when it is explicitly requested.
- Consistent Material 3 top app bars on Pipelines, Runs and Settings (and the
existing back/refresh/start/cancel/retry bars on the detail screens).
- Both detail screens render a single `LazyColumn` whose sections ("Versions",
"Workflow graph", "Source" on a pipeline; "Run graph", "Input", "Output",
"Session evidence", "Steps" on a run) are collapsible via a shared
`SectionHeader`: tapping a header toggles it, an animated chevron rotates with
the state, the header sticks to the top of the list while its content scrolls
under an opaque background, and the state is exposed to accessibility
(`"Steps, expanded"`). Expanded state is `rememberSaveable`, per section and
per screen, defaulting to expanded. Real lists (versions, steps, session
evidence) are items of the one outer list, so nothing nests a scrollable.
- Steps render as a timeline in run detail: a leading status glyph connected to
the next step by an outcome-coloured line, the stage with its sequence/visit
number, an outcome chip and the duration, with every retained piece of evidence
(input, output, transcript, file changes, notifications, control evidence)
behind a collapsible, collapsed-by-default detail in monospace.
- The runs list is grouped by day (`Today`/`Yesterday`/date, newest first) under
sticky headers, with the usage aggregates as a metrics block (total, average
via `formatDuration`, and colour-coded succeeded/failed/canceled/interrupted/
active counts). Each card shows the pipeline name with a version chip, a
colour-coded status chip with a distinct icon per state
(running/queued/succeeded/failed/canceled/interrupted/active/unknown), a meta
row (run id, start time, duration) and the diagnostic only when non-blank,
clamped to two lines. The raw `resultPreview` is no longer printed, and
progress is shown honestly (completed visits + current stage, with an
indeterminate indicator while executing; no invented total).
- One centralised type scale (`ui/theme/Typography.kt`, passed to
`MaterialTheme` and exposed as named roles) defines the screen/app-bar title,
section header, card title, subtitle/meta, body and monospace data, applied on
the list and both detail screens.
- Run history with server `usage` aggregates, and run details with steps
(status/outcome/diagnostic/session/transcript/file changes/notifications/
control evidence). Session evidence is scoped to the selected run and each
@@ -143,10 +175,12 @@ Verified on macOS with the host toolchain (JDK 17 from Android Studio,
`ANDROID_HOME=/Users/alan/Library/Android/sdk`, Gradle 8.11.1 `--offline`):
- `:app:compileDebugKotlin`, `:app:assembleDebug` and `:app:testDebugUnitTest`
all succeed; **42 unit tests, 0 failures** (protocol model, graph semantics,
all succeed; **53 unit tests, 0 failures** (protocol model, graph semantics,
server URL, workflow-graph layout including the terminal row, bottom exits,
back edges, orthogonal routing/axis alignment, arrowhead direction and the
shared panel height). Re-run with `--rerun-tasks` to confirm.
back edges, orthogonal routing/axis alignment, arrowhead direction, the
shared panel height and the new `zoomAbout` anchor/clamp cases, plus duration
formatting, run-state mapping and run day-grouping). Re-run with
`--rerun-tasks` to confirm.
- The debug APK was installed and driven on the `Pixel_Fold_API_36` emulator
(Android 16, `adb shell cmd uimode night yes`) against a live server at
`ws://10.0.2.2:8080/connect` with workspace `/Users/alan/repos/pipelines`.
@@ -181,3 +215,20 @@ launch window/bar colours match it) and moved the `#failure`/`#success` terminal
to a lower row beneath the stage row; before/after captures for the theme, graph
and app bar/style are under `captures/style_pass/` (`*_before.png` are the
pre-change baseline referenced by the task, `*_after.png` are the new build).
The Runs-area pass (centroid zoom, collapsible sticky sections, runs list, steps
timeline, type hierarchy) was verified the same way on the `Pixel_Fold_API_36`
emulator (dark mode, `adb shell cmd uimode night yes`) against the live server:
the debug APK was installed, the list/detail/step flows were driven with
`adb shell input` and `uiautomator dump`, and captures were written to
`captures/runs_pass/` (git-ignored): `runs_list_top`,
`runs_list_scrolled_sticky` (a `13 Oct 2026` header pinned under the app bar),
`runs_list_states`, `runs_card_interrupted`, `run_detail_top`,
`run_detail_graph_collapsed`, `run_detail_steps`, `run_detail_step_expanded`,
`run_detail_sticky_section` (a `Steps, expanded` header pinned mid-list),
`pipeline_detail_sections`, `pipeline_detail_section_collapsed`,
`pipeline_graph_panned` and `pipeline_graph_fit`. `adb logcat` for the app
package contained no `FATAL EXCEPTION` or Compose/other runtime exception during
the sweep. As before, `adb` cannot synthesise a two-finger pinch, so the
centroid-anchored zoom is verified primarily by the `zoomAbout` unit tests and
the on-device graph was exercised with pan + "Fit graph to view" only.