Commit Graph

45 Commits

Author SHA1 Message Date
alan dcd58b8a3d Reach the covered pane's full statistics and wrap its title at whole words
A covered pane's width is spent on the covered region (`identityWidth +
startInset`), and when a second level is covered `coveredEdgesDp` gives the
nearest identity that region less the thin older edge (`startInset + minTouch`;
the leading gesture inset cancels), i.e. `identityWidth - minTouch`. Flooring a
statistics-bearing identity at the full block alone (`MIN_COVERED_PANE_WIDTH_DP +
PEEK_WIDTH_DP`, 168dp) therefore left the nearest edge at 120dp, below the
`paneStatTier` Full boundary, so a pipeline's last-run/age and average lines were
filtered out at every depth a pipeline is ever covered. `coveredIdentityWidthDp`
now floors a statistics-bearing identity one touch target above the block
(`+ minTouch`), so the nearest edge is exactly 168dp and reaches Full, while the
single-covered and title-only cases are unchanged and the active pane width still
does not depend on depth.

The covered title also broke mid-word in a narrow strip ("Complete a Task" ->
"Complet"/"e a Task"). `wholeWordTitle` now packs the title greedily onto
whole-word lines and, once they are full, drops the remaining words and
ellipsizes the last line at a word boundary; a word wider than the whole strip is
the one exception, ellipsized to the width because it has no internal boundary.
It takes an injected `measure`, so the packing rule is unit-testable without a
device, and `PaneIdentity` measures with the same `cardTitle` role it draws with.

`PaneIdentityTest` adds the pure cases: the width-degradation tiers, the
statistics-bearing width floor, the nearest-edge geometry at depth 2 (which fails
without the `+ minTouch` reserve, so it pins the defect), and the whole-word
wrap/ellipsis/oversized-word/no-room cases. `android/README.md` records the
corrected geometry, the fix and the run's build/test evidence.

android/ only; no new dependency, no server field, and no server/Go/installer/
Docker change. Build and unit tests only (no device): 300 tests, 0 failures.
2026-10-16 23:30:47 +01:00
alan af68a62ab8 Measure the covered pane edge instead of spending a fixed budget
The covered panes spent a fixed 224dp (PEEK_BUDGET_DP) whatever the window
width, so a folded window lost over half its width and the active pane was
squeezed as levels were added. Derive the covered region at runtime from the
compact identity a covered edge must show - an icon plus the shortest label
that identifies the pane, measured with the app's own type role and floored at
the platform minimum touch target - plus the leading gesture inset.

coveredEdgesDp now returns edges that sum to exactly that region, so the active
pane opens at hostWidth - region and its width is identical at every depth:
opening a level only adds a thin edge inside the region. The nearest covered
level shows its identity, one older level is a thinner touch-target edge, and
older levels fold into a count rather than accumulating width; tapping an edge
still pops everything above it. Removes PEEK_BUDGET_DP, MIN_ACTIVE_PANE_WIDTH_DP
and the peekBudgetDp/peekStripsDp budget split from Dimens.kt and
SlidingPaneStack.kt. PaneIdentity gains the pane-kind icon drawn above the title
at the vector's own measured default size, and each destination passes its
compact label/icon.

The touched files also carry the in-flight covered-pane statistics and list-scroll
plumbing they depend on (PaneStat/paneStatTier/visiblePaneStats, per-destination
LazyListState); the remaining pieces of that work remain uncommitted.
2026-10-16 18:50:36 +01:00
alan b003872032 Show live elapsed time for running runs
A running run now shows how long it has taken so far instead of its start
time, kept live: the runs-list meta row, the pipeline list's last-run line
and the run detail summary's Duration row all read one shared rule,
runDurationText (ui/Format.kt), which reports the elapsed while executing and
keeps the stored total once the run has finished.

The elapsed is derived from the server's own start timestamp against a single
shared clock, rememberLiveNowMillis/hostResumed (ui/components/LiveTime.kt),
so it stays correct after a reconnect and never ticks while the app is
backgrounded or while no shown run is executing. WorkflowGraph's private
lifecycle read and once-a-second loop are replaced by that same shared pair.
A missing start omits the value and a future start (clock skew) reads as 0s.

Unit tests (FormatTest, PipelineLastRunTest) cover a run that has just
started, the minute and hour boundaries, a missing and a future start, and a
finished run keeping its stored total duration.
2026-10-16 18:13:50 +01:00
alan d546bc7a3a 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.
2026-10-16 13:08:54 +01:00
alan 3765fdfdf6 Migrate the list and detail screens onto the geometry tokens
Replace the hardcoded paddings, spacings, sizes and offsets in the four
list/detail screens and the shared components they are built from with
references to the token file from the previous item, via WindowInsets or
layout where those derive the value. Every replacement is value-equal, so
the screens render identically at both window widths.

Name the glyph sizes that cannot derive from layout as four new ICON_*
tokens in ui/theme/Dimens.kt (14/18/20/24dp) and shrink the DimensTest
allow-list from 30 to 24 entries: 14.dp, 18.dp and 20.dp leave because
their last call site migrated, and the already-unused 32.dp, 11.sp and
13.sp entries are dropped. All adb/emulator work targeted emulator-5554
only; android/ only; no new dependency, server/Go/installer/Docker file
touched, and no run started from the app.

Verified: :app:assembleDebug + the full unit suite (30 result XMLs, 259
tests, 0 failures/0 errors/0 skipped), the shrunk allow-list still fails a
forced raw-literal probe, and before/after screenshots of every converted
screen at narrow and wide widths match near-zero.
2026-10-16 12:43:19 +01:00
alan a8ff49f423 Merge lane-app2: keep both lanes' reviewed work
Compose the parallel lane (lane-app2) with the work already on main,
preserving both intents rather than picking one side:

- lane-app2's modernised run graph (rounded tonal nodes, pill terminals,
  chipped outcome labels, pass/fail emphasis and active-stage/edge motion)
  plus its remembered list filters/sort and last-run badges, and the
  app-owned run-status palette.
- main's cross-fading loading/empty/error states, animated list items and
  the single geometry token file (Dimens.kt + DimensTest).

Conflicts resolved in android/README.md (kept both appended sections),
RunStatus.kt (kept the shared ColoredChip extraction and made it animate
under MotionQuick), PipelineListScreen.kt (filters/sort/badges composed with
the StateCrossfade/load-phase presentation and animateListItem rows),
RunDetailScreen.kt (kept both the artifact-selection and graph-palette
imports) and RunHistoryScreen.kt (the cross-faded load branch now passes
sort/filters through, and both empty branches keep the Clear filters action
with animated items). LoadPhase.Empty now carries an optional recovery
action so the crossfade can still offer Clear filters. The graph's new
geometry literals moved onto Dimens.kt GRAPH_* tokens so DimensTest passes
and its allow-list shrinks as intended.

Verified: :app:assembleDebug and :app:testDebugUnitTest (259 tests,
0 failures) with the offline Gradle 8.11.1 / JDK 17 toolchain.
2026-10-16 12:04:45 +01:00
alan f6b9424894 Add a single geometry token file and a test that enforces it
Introduce ui/theme/Dimens.kt as the one source of truth for app geometry,
alongside Typography.kt for type. It defines the 4dp spacing scale
(SPACING_XXS/XS/S/M/L/XL/XXL) and receives the geometry constants that
already existed, each with a comment tying it to what it is: PEEK_WIDTH_DP
(the collapsed strip), PEEK_BUDGET_DP, MIN_ACTIVE_PANE_WIDTH_DP and
MIN_COVERED_PANE_WIDTH_DP from SlidingPaneStack.kt, DESTINATION_PILL_RESERVE
from PipelinesApp.kt, and WIDE_RAIL_WIDTH_DP and DETAIL_MAX_WIDTH_DP from
DetailTabs.kt. Call sites now import the tokens; every value is unchanged,
so no layout changes.

Add ui/theme/DimensTest.kt, a JVM test that scans the app's Kotlin sources
for raw dp/sp literals and fails with file:line:literal unless the literal
is a token or an explicit, reasoned allow-list entry. The allow-list records
the 34 literals that predate the token file, each with a written reason, and
is expected to shrink as call sites migrate onto the tokens.

Document the change and its verification in android/README.md.
2026-10-16 11:50:26 +01:00
alan e5bde981ee Modernise the workflow graph's visual language
Replace the old terminal-diagram look on the Graph tab with a tonal
surface language, keeping the same information and every outcome hue.

- Nodes: stages are rounded rectangles from MaterialTheme.shapes.medium,
  terminals become pills (height/2). Fills are tonal surfaces via the new
  pure tonalFill(surface, accent, fraction) with a soft outlineVariant
  border instead of a flat fill plus hard outline.
- Type: node names use the cardTitle role and outcome labels the label
  role, with theme line height/letter spacing; the [brackets] and all-caps
  are gone (nodeDisplayLabel renders Success/Failure title-cased in colour).
- Edges: StrokeCap.Round/StrokeJoin.Round, bends rounded by one
  ROUTE_CORNER_RADIUS (cornerCutRadius clamps short segments), filled
  arrowheads scaled as edgeStrokeWidth * ARROW_HEAD_SCALE, and labels on
  a shared DrawScope tonal chip.
- Spacing: named dp tokens instead of ad-hoc literals.

Adds pure-logic unit tests (WorkflowGraphTest, GraphPaletteTest) and
documents the change in android/README.md.

Verified: :app:assembleDebug and :app:testDebugUnitTest both BUILD
SUCCESSFUL (207 tests, 0 failures) with no Kotlin warnings.
2026-10-16 11:50:08 +01:00
alan d019213c5b Animate selection and live state changes
Animate selection and status changes across the Android UI using the
existing Motion tokens, leaving every resting state unchanged.

- DestinationPill draws one selection indicator and animates its offset
  between the three slots (animateDpAsState, MotionStandard), with the
  glyph tint cross-fading in step; geometry comes from named
  DESTINATION_ITEM_SIZE/GAP tokens via the unit-tested
  destinationIndicatorOffsetDp helper.
- The shared ListRow fades its tonal container and content colour under
  MotionQuick instead of switching.
- New shared CollapsibleSectionBody wraps section bodies in
  AnimatedVisibility (expand/shrink + fade) under MotionQuick, used by
  both the lazy collapsibleSection and the stage pane's StageSection, so
  body and chevron move together.
- StatusChip eases container and label colour and RunStatusIcon eases its
  glyph tint, so a live run's status transition is visible rather than a
  silent colour swap.

Verified: assembleDebug + testDebugUnitTest BUILD SUCCESSFUL, 186 tests
across 23 classes with 0 failures/errors/skips; frames captured on
emulator-5554 for the travelling pill, section collapse and a live status
change; APK published to the run artifact directory. README documents the
change and its evidence.
2026-10-16 11:24:01 +01:00
alan b89ad29c41 Cross-fade loading, empty and error states in data-backed panes
A data-backed pane swapped its loading spinner, empty message, error
message and content with a plain `when`, so content flashed from empty to
full and empty/error states popped.

Introduce a shared presentation model in ui/components/States.kt:
- `LoadPhase` (Loading, Error(message), Empty(message), Content), with
  message-carrying phases capturing their text at classification so a
  fading-out branch never recomposes against cleared error/filter state.
- `listLoadPhase(loading, error, hasData, emptyMessage)` and
  `detailLoadPhase(error, hasData)` pure classifiers preserving the
  existing precedence (failed load with no data, then loading, then
  empty, else content; stale data keeps the pane on content).
- `StateCrossfade(phase)` wraps the branch in a `Crossfade` using the
  existing `MotionStandard` token; both branches share one box so the
  resting layout is unchanged and the outgoing phase fades under the
  incoming one.

Apply to PipelineListScreen, RunHistoryScreen, PipelineDetailScreen and
RunDetailScreen. Detail panes render the fading-out branch from the last
non-null item. The Runs pane keeps its inline empty/error line inside the
list, now fading through animateListItem().

Add LoadPhaseTest covering the classifiers and captured messages, and
document the change and evidence in android/README.md.
2026-10-16 10:45:27 +01:00
alan 934994d7f7 Add named motion tokens and animate list item changes
Introduce ui/components/Motion.kt beside the pane dimension tokens: two
named duration+easing tokens, MotionQuick (120ms) for small in-place state
changes and MotionStandard (220ms) for content that moves or swaps, under a
300ms MAX_MOTION_MILLIS cap. Every animation call site now asks a token for
its spec instead of writing a duration: the pane slide and section
Crossfade use MotionStandard, the section chevron uses MotionQuick, and the
pane-pop stagger moves in as MOTION_STAGGER_MILLIS (the old
PANE_SLIDE_* / SECTION_SWAP_MILLIS constants are gone).

Add a single LazyItemScope.animateListItem() helper (ListRow.kt) wrapping
the supported Modifier.animateItem with the tokens: items fade in/out
(MotionQuick) and slide to new positions on refresh, filter or re-sort
(MotionStandard). Pipelines rows, run rows, version rows and evidence rows
use it. Specs are built at composition time (no per-frame allocation) and
the chevron reads its angle inside graphicsLayer so it turns without
recomposing the header; resting layout is unchanged and the standard
animator duration scale still applies, so disabled animations are instant.

Add MotionTest covering token ordering, per-token bands, the cap, monotonic
easings, self-reversal and spec timing; SlidingPaneStackTest now reads the
pane timing from the token. Document the change and its verification in
android/README.md.
2026-10-16 09:55:41 +01:00
alan 8b39c087fd Animate the active stage and executed edges in the run graph
Show what is happening while a run is live. The executing stage now carries a
subtle pulsing halo (replacing the blink) and a live ticking elapsed badge
derived from the run's current visit start. Executed edges carry a directional
flow of light dots along the path; a finished stage settles into its static
colour. A finished run never animates, the animation pauses when the graph is
off screen, and with the system animation setting disabled it falls back to a
static but clearly marked running state.

The per-frame visual state and should-animate decision live in pure functions
(GraphMotion.kt, Format.kt secondsSince; GraphSemantics exposes executing and
currentStageStartedAt) with unit tests and no frame-timing assertions. Adds
GraphMotionTest and extends GraphSemanticsTest and FormatTest.
2026-10-16 09:52:57 +01:00
alan 0b74903a00 Add long-press artifact multi-select with bulk copy and share
Long-pressing any artifact — a gallery tile in the run summary or a row in
the stage pane's per-visit list — now enters artifact selection: the pressed
item is selected with the app's selected treatment and further taps toggle
items instead of opening them. A contextual bar replaces the surface's top
bar while selecting, showing the count plus Copy links, Share and a close;
it carries the same pane safe-area insets as the bar it replaces, uses 48dp
IconButtons and leaves selection mode on Back before the surface's own Back
runs. Selection applies only to artifacts, never the runs or pipelines lists.

The selection is one shared host: ArtifactSelectionScaffold owns the
remembered ArtifactSelection, the resolvedSelection lookup, the bulk
copy/share actions, the SnackbarHostState and the pane-scoped BackHandler,
and both RunDetailScreen (summary grid) and StageDetailPane (per-visit list)
go through it, so neither screen owns its own SnackbarHostState or
BackHandler. The immutable ArtifactSelection (enter/toggle/selectAll/clear)
treats selection mode as "one or more urls selected", so it can never
restore half-applied; rememberArtifactSelection saves it via a listSaver and
reseeds per run/visit.

Copy links resolves every selected url against the configured server through
the existing resolvedArtifactUrl (no hardcoded host), writes one absolute
link per line through the new single Clipboard.copyText path (now also used
by the code blocks, pipeline source, artifact row and viewer), and confirms
the number of lines actually produced in a Snackbar. Share fetches every
selected artifact through the existing client, reuses the single-item
writeSharedArtifact (same bounded cache, FileProvider and prune), and sends
one ACTION_SEND_MULTIPLE typed by bulkShareMimeType (the common type, else
the wildcard) with the count in the chooser title; when any fetch fails the
whole set degrades in the same action to its resolved links shared as text.

Pure helpers and tests: ArtifactSelectionTest covers enter, toggle,
deselect-last, select-all/clear, the restored state, the one-per-line link
formatting and the labels; ArtifactSharingTest gains shareTargets and
bulkShareMimeType cases. Unit tests plus assembleDebug pass (168 tests,
21 classes, 0 failures). android/README.md documents the model, action bar
and the bulk share flow, and the doc-accuracy pass records that the bulk
copy writes links in gallery (candidate) order.

No new dependency (icons come from the declared material-icons-extended).
2026-10-16 08:51:03 +01:00
alan 1e7862e7c9 Make pass/fail edges the loudest lines in the run graph
Treat `success` and `error` as the emphasised outcomes so pass/fail is
obvious at a glance and from a distance. An executed pass/fail edge now
uses PASSFAIL_EDGE_STROKE=7f (was 3f), a same-hue, more saturated stroke
(PASSFAIL_SATURATION=1.6f via the new pure boostSaturation helper) and a
matched PASSFAIL_ARROW_HEAD_SIZE=20f arrowhead. Other executed outcomes
keep EDGE_STROKE=3f and not-executed routes the finer
INACTIVE_EDGE_STROKE=2.5f, so the two decisive outcomes dominate.

All widths, the arrowhead size and the saturation factor are named
tokens chosen by edgeStrokeWidth/edgeArrowHeadSize/edgeStrokeColor; the
old 12f arrowhead literal at the call site is gone (drawArrowHead now
takes the size as a parameter). Outcome hues are unchanged; the boosted
stroke keeps the original hue and value.

The run Graph tab help line notes that executed success and failure
routes are drawn thickest, and the definition-only view gets the same
emphasis since every route counts as executed there. New unit tests cover
the saturation maths (hue/value/alpha preserved, safe and clamped) and the
per-edge width/arrowhead/colour choices.
2026-10-16 08:06:34 +01:00
alan 9c47527def Make executed vs not-executed unmistakable in the run graph
Carry the two states structurally instead of by fading, so the difference
survives a screenshot, a dim screen and a colour-blind reader.

- Executed edges: solid full-colour stroke plus an arrowhead.
- Not-executed edges: dashed muted stroke (INACTIVE_DASH_EFFECT), no arrowhead.
- Executed nodes: keep their fill and normal border.
- Not-executed nodes: no fill, dashed muted border and a muted but legible label.
- Add a one-line legend (GRAPH_LEGEND / GraphLegendEntry / LegendSwatch) pinned
  TopStart, rendered only when a run is selected.
- Replace the private EdgeLayout.isExecuted/inline visited check with the shared
  edgeIsExecuted/stageIsExecuted predicates and remove the alpha-based dimming.
- Update the KDoc and the run Graph tab help text ("solid ... dashed and outlined").

Tests: executed/inactive predicates over the definition view and a RunGraphState,
the dash pattern as a positive even-length rhythm, and the legend naming both
states with executed first.
2026-10-16 07:04:48 +01:00
alan 1195535852 Add a real share action to every artifact item
Give each gallery image cell and each per-visit file row its own share
control: a 48dp IconButton with an accurate "Share <name>" content
description drawn as a sibling of the item's tap handler, so sharing
never opens the image or the item.

Sharing fetches the artifact through the existing client into a scoped
cache file (cache/shared-artifacts/), exposed via a non-exported
FileProvider declared with the new res/xml/file_paths.xml, and sends it
through ACTION_SEND. When the fetch returns nothing the action falls
back to sharing the resolved link as text. Cache files are named
deterministically per artifact so re-sharing overwrites instead of
growing without bound, and a failed or unreachable fetch cannot crash.

The artifact-to-file naming, mime/extension table and the file-vs-link
fallback decision are factored into ArtifactSharing.kt and covered by
the new ArtifactSharingTest.kt. The existing open and copy-link actions
are unchanged; the viewer's action scrim alpha is shared as
ARTIFACT_ACTION_SCRIM_ALPHA. android/README.md documents the provider
and the share flow. No new dependency is added.
2026-10-16 07:03:18 +01:00
alan d339827b5f Open artifact images in a full-screen zoomable viewer
Tapping an image artifact (run summary grid, per-visit list or stage pane,
all rendered through ArtifactGallery) now opens a new scrim-backed
full-screen viewer instead of the former small centred dialog, which is
removed rather than stacked.

- ArtifactViewer.kt renders a full-bleed Dialog (usePlatformDefaultWidth =
  false, decorFitsSystemWindows = false) whose content re-applies
  paneSafeArea() so the dark backdrop reaches the edges while respecting
  status bar, cutout and navigation bar. A top-right row keeps the
  open-in-new and copy-link actions and adds a close button over a
  translucent scrim capsule.
- Gestures: pinch zooms about the centroid, drag pans via the existing
  graph zoomAbout, double-tap toggles fit <-> 2.5x, and a downward swipe at
  fit dismisses; a plain tap does nothing. Zoom clamps to [1x, 5x] and the
  new pure clampImageOffset keeps pan inside the scaled image. Zoom state is
  keyed on the url, so closing the viewer or opening another image resets to
  fit/centred. System Back and the close button dismiss the viewer without
  closing the pane behind it.
- Loading goes through the existing cached, off-main-thread
  rememberArtifactBitmap/ArtifactImageState path with distinct loading and
  error states, drawn in the light inverseSurface role that contrasts with
  the always-black scrim.
- Pure helpers fitImageSize, clampImageOffset and toggleZoomScale are
  covered by the new ArtifactViewerTest. ArtifactImage.kt widens
  rememberArtifactBitmap/ArtifactImageState to internal and Artifacts.kt
  replaces FullSizeArtifactDialog with ArtifactViewer (openArtifact made
  internal).
- android/README.md documents the viewer, its gestures and the evidence
  gathered on emulator-5554.
2026-10-16 06:35:08 +01:00
alan 54af4535d7 Add remembered filters to the runs and pipelines lists
Give each list a filter control, remembered per list across restarts like
the sort, combined with AND. Filters narrow; the (later) omni search will
find, so they are kept distinct.

- ui/screens/ListFilter.kt: RunTimeRange (AnyTime default, Today, Last7Days,
  Last30Days), RunPresence (Any default, HasRuns, NoRuns) and the
  RunFilters/PipelineFilters data classes, with one pure predicate per facet
  (runMatchesStatuses, runMatchesPipeline, runMatchesTimeRange,
  pipelineMatchesPresence, pipelineMatchesLastRunStatus) and the AND-combining
  filterRuns/filterPipelines. A default narrows nothing; an empty status set
  means "any"; the time windows are inclusive calendar days; a blank,
  unparseable or future timestamp never matches a finite window; a runless
  pipeline has no last-run status; fromStorage tolerates stale/unknown/blank
  values; encodeRunStates/decodeRunStates round-trip the status set.
- ui/components/FilterMenu.kt: the shared top-bar control both screens use -
  an IconButton with a numeric active-filter count badge opening the caller's
  sections plus one Clear filters action (disabled when nothing is active),
  the count folded into the icon description, and a menu capped to the window
  and clear of the navigation inset so it stays scrollable rather than
  clipping.
- PipelineListScreen.kt/RunHistoryScreen.kt wire the control and predicates;
  the existing name search on pipelines stays a separate field, and the new
  pipeline facets depend on the run history.
- ui/components/States.kt: EmptyState gains optional actionLabel/onAction so
  both lists distinguish "nothing exists" from "nothing matches the current
  filters" and offer Clear filters only in the latter.
- data/SettingsRepository.kt + ui/AppViewModel.kt: store each facet under its
  own stable key as a StateFlow, exactly like the sort keys; the screens
  resolve the stored strings so the repository stays unaware of the UI enums.

Verified on this tree with :app:testDebugUnitTest, assembleDebug, and
emulator-5556 persistence and captures; recorded in android/README.md.
2026-10-16 06:01:18 +01:00
alan 7b61906e1b Lead the run summary with a width-derived artifact grid
In the run detail summary, artifacts now appear at the top of the page and as a grid rather than a list:

- RunDetailScreen emits the "run-artifacts" LazyColumn item before the "run-summary" item, so the captured screenshots are the first thing the operator sees. The rest of the summary and its collapsed-by-default sections are unchanged.
- ArtifactGallery derives its geometry from the measured width via the new pure artifactGrid(availableWidth, preferred, spacing): it fits as many preferred-shaped cells as the width allows and stretches them to fill the row, instead of the removed fixed ARTIFACT_GRID_COLUMNS count. A host narrower than one preferred cell falls back to a single narrower cell; a non-positive preferred token never divides by zero. Tiles still open the full-size image on tap; non-image artifacts keep their compact list form.
- ArtifactGalleryTest replaces the fixed-column cases with grid cases covering a narrow pane (fewer, larger cells), a wide window (more columns), a very wide window (cells near the preferred shape), the single-cell fallback and degenerate inputs, asserting the row never overflows the host.

Verified with assembleDebug (APK 17,863,337 bytes, sha256 32e9081b28f5caa85f5bfa24f7fe7149eeddb919d4e71cf497e9017b80f54ce7) and the unit tests (140 tests, 0 failures/errors/skipped); captured on emulator-5554 at both window widths.
2026-10-16 05:28:39 +01:00
alan 6229fc9db5 Keep every pane inside the Android safe area
The stage detail pane covered the status bar. Introduce one shared
paneSafeArea() (WindowInsets.safeDrawing: status bar, display cutout,
navigation bar, gesture area and IME) and apply it from the live window
insets across the pane stack:

- SlidingPaneStack uses it (unioned with systemGestures) for the covered
  peeks' strip geometry.
- Each pane's Scaffold reserves it once via contentWindowInsets, and its
  TopAppBar reserves the top/horizontal part, so no pane sits under the
  status bar, a cutout, the navigation bar or the IME. Applied to the five
  stacked panes and SettingsScreen.
- The connection banner owns the top inset and the NavHost consumes it
  (paneSafeArea().only(Top), was statusBars) so the inset is never doubled.
- The floating destinations pill clears the same safe area, so the keyboard
  no longer hides it.

Scrollable content stays inside the remaining space rather than clipping.
android/README.md records the design and emulator-5554 verification.
2026-10-16 05:08:46 +01:00
alan 1c925d72f7 Remember sort options for the pipelines and runs lists
Add a per-list sort control to each top bar and persist the choice in
SharedPreferences so it survives restarts.

- ui/screens/ListSort.kt: PipelineSort and RunSort enums plus pure
  comparators with explicit tie-breaks, and sortPipelines/sortRuns.
  ServerOrder/NewestFirst remain the defaults; a still-executing or
  unparseable-timestamp run sorts last.
- ui/components/SortMenu.kt: the shared top-bar control, a distinct
  IconButton opening a Material 3 DropdownMenu of every option plus a
  divider and Reset, with the active choice checked.
- data/SettingsRepository.kt + ui/AppViewModel.kt: store the sort key
  per list as a StateFlow; fromStorage falls back to the default for a
  stale/unknown/blank value.
- ui/Format.kt: share parseInstant and durationSeconds so the printed
  duration and the sort key cannot disagree; PipelineLastRun.kt reuses
  the shared latest-run fold.
- PipelineListScreen.kt/RunHistoryScreen.kt wire the control and sort;
  groupRunsByDay preserves the comparator's order.
- ListSortTest.kt covers the comparators and storage fallback;
  RunGroupingTest.kt gains an explicit-order case.

Verified on this tree with :app:testDebugUnitTest (167 tests, 0
failures), assembleDebug, and emulator-5556 persistence, the sort
control, and Reset; captured in android/README.md.
2026-10-16 04:57:53 +01:00
alan 5ad4b58770 Mirror the Android pane close animation
Give every pane one shared slide spec, a fixed 300 ms duration and a symmetric cubic-bezier easing, so a close is the open curve run backwards at the same duration; several levels that pop in one tap now stagger so each reverses in order from the top.

The stack mounts a level while it is open or still sliding out and calls the pane only then, and rememberPaneContent retains each closing pane's full parent identity (item/version/section, stage key, visit). A closing pane therefore keeps rendering the content that opened it instead of vanishing or falling back to an empty node, and a fully closed level composes nothing. Geometry, tokens and insets are unchanged.

Adds three pure unit cases for the symmetric easing and the stagger rule; documents the change and its emulator verification in android/README.md.
2026-10-16 04:31:53 +01:00
alan 3480461ffb Show the last run on every pipeline row
Each pipeline row in the Android list now renders its most recent run:
the status chip, how long ago it started, its recorded duration and its
run id. Pipelines that have never run say "no runs recorded" instead of
leaving a blank line, and the line is withheld until the run history has
loaded so a missing history is never reported as "no runs".

The list_runs history already arrives whole (id DESC), so the join is
client-side: PipelineLastRun.kt folds it onto a Map keyed by pipeline id,
recency decided from the timestamps with the higher run id breaking an
exact tie, and formats "ago · duration · run N", omitting any genuinely
absent fragment. The change is android/-only, adds no server field or
dependency, keeps the existing title/secondary structure and selected-row
highlight, and never starts a run.

PipelineLastRunTest covers most-recent-wins, no runs, unknown pipeline
id, equal timestamps, a bad timestamp, an unknown status word, the
formatRanAgo scales and the "no runs recorded" wording. README records
the verification: :app:testDebugUnitTest (153 tests, 0 failures) and a
full --rerun-tasks assembleDebug (17,863,337 bytes, sha256 b2255066…).
2026-10-16 03:43:29 +01:00
alan 1fece88286 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.
2026-10-16 02:33:30 +01:00
alan 54443903ae Record re-verification evidence for the run-status palette
Add a README evidence subsection for the committed run-status colour change at 24584d8: the unit suite (143 tests, RunStatusPaletteTest 7/7 incl. contrast), assembleDebug with the published APK size and sha256, before/after pixel-sampled captures on emulator-5556, and the APK publish location and LAN URL.
2026-10-16 02:23:03 +01:00
alan 24584d820f Give run status an app-owned palette with correct hues
Run status was mapped onto Material roles, so a succeeded run read amber
(tertiary) and a running run read mint (primary). Replace that mapping with an
app-owned RunStatusPalette: Running/Active blue, Succeeded green, Failed the app
error red, Interrupted amber, Canceled muted grey, Queued neutral grey and
Unknown a low-key surface grey, each with a one-line rationale. runStateColor is
now a pure lookup over the palette.

Keep each state's distinct material glyph and text label so status is never
colour-only, and add a WCAG-AA contrast test for every status colour against the
dark surface plus hue-specific assertions.

Leave the graph's stage-outcome palette untouched. The timeline's step chips are
a stage outcome, not a run status, so point them at the shared graphColors/
outcomeColor factory (extracted from WorkflowGraph) to agree with the graph, and
factor the shared ColoredChip pill out of StatusChip so neither repeats the
layout. Document the change and its evidence in android/README.md.
2026-10-16 02:04:30 +01:00
alan cfd5887311 Lead a run's stage pane with the run's results
A stage opened from a run (Timeline, run graph or run stage list) now leads
with the run-side result instead of the stage's own definition: status,
outcome, duration, visit and target, then the visit's results in the order
Artifacts (gallery first), Output, Input, then the remaining run evidence
under This run. The stage's full definition (type, prompt, output contract,
outcomes, model, provider, configs, tools, limits, memory, notify) moves into
one collapsed "Stage definition" section at the bottom.

StageDetailPane gains a runContext flag: RunStagePane passes true and gets the
collapsed-definition default, while PipelineStagePane passes false and keeps
the definition expanded, since it is then the pane's only content.
rememberSectionExpansion gains an initiallyExpanded set (part of the save key)
so the seed respects an operator's own expand/collapse choices without
inheriting them across contexts.

Nothing visible before is removed - the previous Model/Provider headline
promotion is reverted and those facts remain reachable inside the expanded
definition. The visit tabs and the collapsed-by-default behaviour of the other
sections are unchanged. android/ only; no dependency added.

Updates android/README.md and StageDetailSheetTest.kt accordingly.
2026-10-16 02:02:43 +01:00
alan cd85f6954b Render artifact thumbnails with an honest loading/failure state
The artifact grid could show failure placeholders that were never earned:
a server-relative artifact url that failed to resolve against the configured
server was fetched anyway and blamed with the "!" failure mark, and the
loading state was a bare "…" text.

- Pass the resolved url (nullable) into ArtifactImage; a null short-circuits
  to a new distinct Unavailable state (LinkOff glyph) and issues no request,
  so a fetch that was never attempted is never drawn as a failure.
- Reserve Error/"!" for a fetch or decode that was actually attempted.
- Replace the "…" text with a real Material 3 CircularProgressIndicator.
- Resolve gallery artifact urls in one shared helper (resolvedArtifactUrl)
  so the image tile and the non-image row cannot disagree; non-image
  artifacts keep their file-type icon.
- Add unit tests covering resolution against the configured server and the
  null (unconfigured) case.
2026-10-16 01:40:44 +01:00
alan 66d4856348 Validate Android screenshot captures before use
Add android/scripts/capture_png.sh, which captures on-device (screencap -p -d <SurfaceFlinger id>) to /sdcard, pulls the file, and validates PNG magic bytes plus the reported type, deleting and failing on anything that is not a real image. Document the multi-display warning failure mode and the required helper in android/README.md so every UI-capturing run captures and validates instead of writing adb screencap straight to a file.
2026-10-16 01:22:45 +01:00
alan 3deff18572 Render a compact identity for covered Android panes
On a wide window, a covered pane in the stack used to render a squeezed
copy of a full pane, so a covered entry showed a truncated title and a
crushed tab rail. A covered pane now renders only a compact identity: a
centred title plus at most one status/subtitle line, with no tab rail,
list, gallery or scroll body drawn into the sliver.

- SlidingPaneStack's pane lambda receives a covered flag; on a wide window
  a covered level composes only the new PaneIdentity, while the list, both
  detail screens and the stage pane early-return from their covered branch
  after their data-loading effects.
- Adds MIN_COVERED_PANE_WIDTH_DP (112.dp); peekStripsDp shows at most
  budget / MIN_COVERED_PANE_WIDTH_DP covered peeks and folds the oldest
  levels into a single "<n> more" edge indicator rather than squeezing
  them below the minimum.
- The fixed PEEK_BUDGET_DP (224.dp) and the constant active-pane width
  are unchanged; the peek tap, Back and the narrow layout keep the same
  behaviour.
- Rewrites SlidingPaneStackTest (10 cases) for the fold rule, minimum
  width, constant active width and inset/geometry invariants, and records
  the evidence and the unreachable-fold gap in android/README.md.
2026-10-16 01:16:24 +01:00
alan 206953e067 Show an Android run stage's Model/Provider in the headline
Surface a run stage's recorded Model and Provider configs in the stage
pane's always-visible headline instead of leaving them inside the
collapsed Definition section, so the operator sees them without expanding
anything, and stop rendering them twice.

- StageDetailPane.kt gains the pure STAGE_CONFIG_HEADLINE_LABELS
  ({"Model", "Provider"}), stageConfigHeadlineFields(definition) and
  remainingDefinitionFields(definition). StageDetailBody renders
  headlineFields(runFields) + stageConfigHeadlineFields(definition) as the
  headline and remainingDefinitionFields(definition) inside the collapsed
  Definition section; both derivations are remember(definition)-keyed and
  the run-evidence split stays runStepFields/headlineFields/evidenceFields.
- The definition-only, never-visited stage keeps its existing look; the
  Definition section no longer repeats Model/Provider because they are now
  headline facts, and everything else stays as before.
- StageDetailSheetTest adds
  definitionModelAndProviderArePromotedToTheHeadlineWithoutDuplication and
  aDefinitionWithNoConfigsPromotesNothing.
- android/README.md records the pass: the reported "content lost" symptom
  is not reproducible at 791d3dd (the run-61 definition-only screenshots
  are the Pipelines destination), the promoted facts are the real gap, and
  the unit tests (132/0), assembleDebug, device verification on
  emulator-5554 and the APK publish are noted with what was not verified.
2026-10-16 00:54:22 +01:00
alan 791d3dd3ff Swap Android detail sections in place instead of sliding them
Selecting a section in a run or pipeline detail now cross-fades the body in
place rather than sliding it sideways, so a tap on the rail or tab row is an
ordinary tab change with no lateral motion and nothing to swipe.

- DetailTabs.kt drops the HorizontalPager for section bodies and renders only
  the selected section behind a short Crossfade (SECTION_SWAP_MILLIS = 180).
  Level navigation (list -> detail -> stage pane) still slides via the
  unchanged SlidingPaneStack.
- Each section's saved state (its LazyColumn scroll) is kept under its stable
  tab key with rememberSaveableStateHolder().SaveableStateProvider, so
  returning to a section restores where the operator left off instead of
  resetting it.
- The rail/tab-row selected state and tab semantics are unchanged.
- Update the two call sites' stale "pager" comments and refresh the README
  section describing the section selector.
2026-10-15 23:57:57 +01:00
alan 0b373d0c65 Make Android pane navigation adaptive with a fixed peek budget
Replace the per-level peek with a fixed total peek budget on wide windows
and drop the stack entirely on narrow ones, so a folded phone loses no
width to dead peek space and a deep stack never reserves more than the
budget.

- SlidingPaneStack gains a `wide` parameter (the callers pass the existing
  isWideLayout value). On a narrow window the budget is 0dp, so every
  pane's open offset is 0 and each opened pane is a full-window screen
  that springs in over the last; Back, the gesture and the pane's own back
  control pop one level and nothing is left on the left.
- On a wide window peekBudgetDp (PEEK_BUDGET_DP, 224dp) is the fixed total
  space shared between the covered panes, independent of depth, so the
  active pane's left edge is always exactly the budget and its width
  (hostWidth - budget) stays constant as levels are added. paneOpenOffsetsDp
  widens the leftmost strip first so it stays tappable after the start
  inset (min of PEEK_WIDTH_DP and the platform minimum interactive size),
  then splits the rest evenly. peekBudgetDp clamps so the active pane never
  collapses below MIN_ACTIVE_PANE_WIDTH_DP and paneWidthDp is never
  negative. All geometry is derived from the named tokens, the measured
  host width and the system insets - no new literals.
- The peek-strip hit targets now come from the shared offsets, and panes
  remain opaque, inset inside the safe area, hidden from accessibility when
  covered, and opening/closing stay exact mirrors through the same
  animators. PaneState documents the narrow (no peek) rule.
- SlidingPaneStackTest is rewritten around the pure budget geometry (narrow
  spends no peek, the wide active pane is constant width, four levels share
  one budget with every strip tappable, the budget clamps, tiny hosts never
  go negative), and android/README.md records the pass, its evidence and
  what was not verified.
2026-10-15 23:49:10 +01:00
alan 5314542c13 Make the Android stage detail a pane and add an artifacts gallery
Turn the stage detail into the rightmost pane of a bounded three-level
stack and show every run artifact in a summary gallery.

- The stage detail opens as a real level-2 pane from both entry points (a
  Timeline row and a graph node). StageDetailPane is wrapped in the same
  Scaffold/TopAppBar with a back arrow as the other panes, and its
  identity/result facts (status, outcome, target, duration, visit, model
  target) render outside any collapsible so a fresh pane is never empty.
  StageDetailSheet, ModalBottomSheet and RightSlidingPanel are removed.
- SlidingPaneStack replaces SlidingMasterDetail: pane 0 fills the host,
  panes 1 and 2 overlay at peek*level, each covered pane keeps one
  tappable peek strip, and MasterPane/backStep/popTo/MAX_PANE_DEPTH are
  the pure model. The peek tap, the pane back arrow, the system Back
  button and the predictive-back gesture all pop exactly one level.
- New pure runArtifactGroups(steps) groups a run's artifacts by stage and
  visit (stable order, duplicates kept, empty run -> empty) and
  artifactsEmptyMessage distinguishes the running "capture pending" case.
  ArtifactGallery renders image thumbnails (tap opens full size) and
  non-image rows with name, size, content type and open/copy; urls resolve
  through ServerUrl, never a hardcoded host.
- Run Summary shows the run gallery and the stage pane shows that visit's
  group, keeping the existing per-visit artifacts summary and notes.
- Tests updated/added (PaneStateTest, SlidingPaneStackTest,
  ArtifactGroupsTest, ArtifactGalleryTest, StageDetailSheetTest, refreshed
  DetailTabsTest/PipelinesNavTest, CollapseRemovalTest kept green) and
  android/README.md records the pass, evidence and not-verified list.
2026-10-15 23:34:36 +01:00
alan 059c85add8 Show per-visit artifacts in the Android client and fix the top inset
Implements four Android-only client changes (no server, Go, installer or
Docker changes; nothing under android/ was left uncommitted).

- Per-visit artifacts: model StageArtifact{name, size_bytes, content_type,
  url} plus artifacts/artifacts_skipped/artifacts_truncated on RunStep with the
  exact internal/protocol/runs.go wire names, covered by ProtocolModelTest.
  Add a dedicated artifacts section to the stage detail sheet: one row per
  file with name, humanBytes size and content type, open (ACTION_VIEW) and
  copy-link actions, resolving the server-relative url against the configured
  server URL (never a hardcoded host) and disabling those actions with a hint
  when none is set. Images render an inline thumbnail with a full-size view on
  tap; other types get a type icon. Empty/partial copy matches the TUI
  ("capture pending", "not recorded for this visit", partial-capture notes).
  Timeline rows carry a subtle AttachFile indicator via a pure hasArtifacts
  helper. Pure helpers (humanBytes, resolveArtifactUrl, isImageContentType,
  artifactsSummary, artifactCaptureNotes, artifactMetaLine) carry unit tests.
- Collapsed defaults and self-describing titles: rememberSectionExpansion now
  tracks the set of expanded keys (default emptySet) so every inner section in
  the run detail and pipeline detail starts collapsed while operator choices
  still persist across configuration changes. Evidence sections are titled
  from the correlated step/stage/visit and backend identity instead of a bare
  index; field sections fall back to their prefix so a blank key never yields
  an empty title. Covered by DetailTabsTest.
- Single top inset: zero the outer Scaffold contentWindowInsets so the inner
  Material 3 app bars own the status-bar inset once; the connection banner
  owns the status-bar inset while visible (NavHost consumes it below), and the
  floating destinations pill clears the navigation bar.
- Publish the debug APK as a run artifact named by the short SHA, documented
  with the verified LAN URL and sha in android/README.md.

Verification (unit tests, assembleDebug, live-server APK and run 55 step 4
artifact fetches, emulator narrow/wide drives) is recorded in android/README.md.
2026-10-15 21:16:18 +01:00
alan d00bd37833 Give every outcome its own colour and reach stage visits from the Timeline
- GraphPalette: a curated fixed palette plus a deterministic outcome-to-index
  mapping (no hashCode() % n); every colour is measured at >= 4.5:1 against the
  dark surface. Node fills differ by kind, and selection inverts the fill.
- Run detail: the Steps tab becomes Timeline, one compact line per recorded
  visit. The stage detail sheet takes the ordered visits plus an
  initialVisitIndex and shows a visit 1..N tab row only when there is more than
  one visit; the timeline opens the tapped visit, the graph the most recent.
- List pane: pipelines and runs share one ListRow (flat surface, thin divider,
  leading element, title plus secondary line) with a tonal selected row, and the
  wide list pane collapses to a 56dp strip.
- Navigation: the bottom bar becomes a floating three-icon destination pill at
  the bottom right with Role.Tab selected semantics, used on both window widths,
  with 88dp reserved so nothing scrolls under it.
- Icons come from the already-declared material-icons-extended; no new
  dependency.

Implemented by pipeline run 55 (pipeline 9 v6). Its ui_reviewer stage failed on a
malformed model result rather than on this work, so the change was verified by
hand: assembleDebug plus 93 unit tests pass, and the run's captures were
reviewed (graph colours per outcome, Timeline entries, visit tabs, selected list
row, floating pill).
2026-10-15 19:16:44 +01:00
alan 370eaaed1f Let the detail tabs collapse and rebuild the step and source layouts
DetailTabs: give every tab a meaningful ImageVector from the core Material
icon set and turn the wide rail into a collapsible one. A rememberSaveable
railExpanded flag plus an accessibility-labelled "Collapse tabs"/"Expand
tabs" control shrink the rail to a narrow icon-only strip and back; the
collapsed tile still names its tab via the icon's content description and
still marks the selected tab by container colour and tab semantics, and the
content box reclaims the rail width. Narrow windows keep the top
PrimaryScrollableTabRow. railWidthDp is a pure, unit-tested predicate.

RunDetailScreen: render a step's metadata as aligned label/value rows
(KeyValueRow) instead of a ragged stack of lines, paired into two columns on
wide windows (status/outcome, duration/visit, target/session, agent/model
target) and a single column on narrow ones. Evidence (input, output,
transcript, file changes, notifications, control diagnostics) fills its card
in full-width monospace with a shared padding/line height, and the vertical
rhythm is one bottom gap per step with no doubled gap for a step without
expandable detail. The timeline glyph and connector stay aligned with the
step title. All previously shown fields are retained.

PipelineDetailScreen/CodeBlock: the Source tab now fills the whole tab area
with the tab's single LazyColumn owning all scrolling (CodeBlock gains an
optional maxHeight = null that renders unbounded; the default bounded
behaviour is unchanged for other callers). It renders the parsed definition
as one collapsible section per stage (key, type) built from the same
stageDefinitionFields/StageFieldRow the stage detail sheet uses, covering
prompt, output, tools, configs, edges (outcomes with resolved targets and
#success/#failure terminals), memory, limits and notify policy while skipping
absent fields. A Raw toggle reveals the exact markdown and a copy action
copies the whole definition.

Extract shared formatting helpers (fileChangeLine, notificationLine,
fileChangesSummary, controlVisitLabel) into Format.kt and expose
StageFieldRow/StageTypeChip/stageDefinitionFields so the sheet and the Source
tab agree. Add StageDetailSheetTest and StepMetaTest, extend DetailTabsTest
(icon distinctness, rail width) and FormatTest, and record the build,
unit-test and emulator-screenshot verification in android/README.md; the
captures stay in the git-ignored android/captures/space_pass/.

Assisted-by: DeepSeek V4.1 Flash
2026-10-15 17:18:05 +01:00
alan 238f3fbdd8 Give every graph edge its own track and open a stage detail sheet on tap
Allocate a distinct source port, target port, across-run lane and vertical
track per edge in the pure layoutGraph (stable edge-id order), mirroring the
TUI's per-edge routing, so no two routes share a row or column; each outcome
label follows its own edge's track. Rewrite routePoints to build every
polyline from those precomputed ports/lanes/tracks instead of shared corridor
constants, keeping runs axis-aligned and the layout deterministic.

Add pure hitTest/toGraphPoint plus a tap detector that maps taps back through
the current transform: tapping a node calls onStageTap, tapping empty space
does nothing, and pan/zoom keep working. Add StageDetailSheet, a Material 3
ModalBottomSheet overlay (near full height, scrollable, responsive on wide
windows) showing the stage definition and, on a run graph, that run's step;
wire it into the pipeline and run graph tabs.

Extend WorkflowGraphTest with the no-shared-collinear-run invariant, distinct
port, determinism and hit-test cases.
2026-10-15 16:46:40 +01:00
alan 1828171a9c Give the detail screens tabs, styled code blocks and a foldable layout
- Pipeline detail and run detail are now tabbed: run detail has Summary, Graph,
  Input, Output, Evidence and Steps, pipeline detail has Summary, Graph and Source,
  with the version list in Summary. The graph gets a tab of its own, so it uses the
  whole content area with its Fit and expand controls. Selection is remembered and
  the tabs carry real tab semantics.
- The code-like blocks (Input, Output, Source, prompt, transcripts) are styled
  content cards with a label header, monospace body, a copy action and a bounded
  height that scrolls internally, instead of a raw bordered div.
- Content inside a tab breaks down into collapsible inner sections (DetailTabs.kt,
  CodeBlock.kt), reusing the existing section component with remembered state.
- Foldable layout is driven by window width (WindowSize.kt): narrow windows keep
  the single-pane tabs, wide windows use list-and-detail side by side with the
  detail capped to a readable width.

Verified: :app:assembleDebug and :app:testDebugUnitTest succeed offline with 60
tests and 0 failures (new WindowSizeTest and DetailTabsTest), and the reviewer
drove every tab plus both a narrow and a wide window on the emulator (captures in
android/captures/tabs_pass/view/). The implementer's own capture set in that
directory is unusable: it wrote screencap's multi-display warning into the files
(they begin with ASCII '[Warning', not the PNG magic), so only the reviewer's
captures were reviewed.
2026-10-15 14:34:49 +01:00
alan e843aa08a8 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.
2026-10-15 03:46:06 +01:00
alan 1a890d8c31 Draw workflow-graph edges as straight runs and give the graph a bigger panel
A user reading the graph on their phone said it was not clear what happened, and
asked for the TUI's straight arrows and a larger panel.

- Edges are now axis-aligned orthogonal polylines instead of Bezier curves: the
  stage-to-stage runs and the routes into the bottom-row #success/#failure
  terminals are horizontal/vertical segments joined at right angles, matching the
  Go TUI's routing, and every arrowhead now points along the direction of its
  final segment instead of the straight source-to-target chord (which pointed
  wrongly as soon as a route turned a corner). Routing is a pure function.
- The graph panel is a sensible share of the window height on both screens
  instead of 360dp/340dp, and a new expand/collapse control beside 'Fit graph to
  view' grows it to nearly the full height.

Verified: :app:assembleDebug and :app:testDebugUnitTest succeed offline with 42
tests and 0 failures (WorkflowGraphTest 15 to 23, covering the orthogonal routing
and arrowhead direction), and the app was driven on the emulator with before/after
screenshots of a pipeline graph, a run graph with the executed route highlighted,
a panned state and the expanded panel.
2026-10-15 02:34:15 +01:00
alan 9ca775291b Give the Android client a dark-first Material 3 look and TUI-style graph terminals
Three UI changes requested after reviewing the first on-device screenshots:

- Dark-first theme: the app now owns its colour scheme instead of following the
  system wallpaper. Theme.kt defaults to a deliberate darkColorScheme built from
  a mint/teal seed with an amber tertiary (new Color.kt) so it matches the dark
  Pipelines TUI; dynamic colour is gone and a complete light scheme is retained
  for when it is explicitly requested. themes.xml/colors.xml give the app a dark
  window background and dark system bars with light icons, so launching never
  flashes light.
- Workflow graph matches the TUI: the #success/#failure terminals now share a
  lower row under the stage row, with arrows entering their top borders and the
  error -> #failure route leaving the bottom of its source stage, mirroring
  internal/tui/graph_layout.go ('Terminals share a lower row...') and graph.go's
  '[FAILURE]   [SUCCESS]' bottom row. Fit-to-content, pan clamping, the Fit
  action, run highlighting and the TalkBack description are preserved.
- More style: consistent Material 3 top app bars for Pipelines, Runs and
  Settings, the new colour scheme applied across the screens and state
  components, and monospace retained for hashes, source and run input/output.

Verified on the host and on the device: :app:compileDebugKotlin, :app:assembleDebug
and :app:testDebugUnitTest succeed offline with 34 tests and 0 failures
(WorkflowGraphTest grew to 15 tests covering the terminal row, bottom exits and
fit/clamp), and the app was run on the Pixel_Fold_API_36 emulator in dark mode
against the live server: the whole 4-stage graph renders with its terminal row,
and the list, detail and settings screens use the new theme.
2026-10-14 12:36:58 +01:00
alan cee9fb2f79 Fix graph fitting, pan bounds, auto-connect and run wording in the Android client
An emulator run against the live server exposed four usability defects and one
legibility defect, all fixed here:

- The workflow graph was not fit-to-content: 3- and 4-stage graphs showed only the
  first columns until the user panned. The initial view now fits and centres the
  whole graph, scaling down when it is wider than the viewport.
- A panned graph could be dragged completely out of view with no way back. Pan is
  now clamped so content stays visible, and a 'Fit graph to view' action restores
  the fitted view.
- The app did not connect on launch even with a saved server URL. It now connects
  from the saved URL using the existing bounded backoff; an explicit Disconnect
  still stays authoritative for the session.
- The runs list said 'N steps' while run detail said 'N recorded visits'. Both now
  use the server's own vocabulary ('N completed visits' / 'N recorded visits')
  through one shared helper in Format.kt.
- Outcome labels: labels are drawn after all curves so none is crossed, dimmed
  labels use onSurfaceVariant, and executed labels no longer resolve to
  near-invisible container accents ('rejected' measured ~1.2:1 before).

Verified: :app:compileDebugKotlin, :app:assembleDebug and :app:testDebugUnitTest
succeed offline with 28 tests and 0 failures (WorkflowGraphTest grew to 9 tests
covering fitScale, clampOffset extremes and label slots), and the app was driven
on the Pixel_Fold_API_36 emulator against the live server with before/after
screenshots and no FATAL or Compose exception in logcat.
2026-10-13 21:55:16 +01:00
alan 2881256af3 Fix workflow-graph crashes and label layout in the Android client
Running the client on an emulator against a live server exposed real defects in the
workflow graph, all fixed here:

- DrawScope.drawText's string overload measured against the draw scope's constraints
  and threw when a node or edge label fell outside them (wide or panned graphs),
  crashing the pipeline-detail and run-detail screens. Both call sites now draw a
  pre-measured TextLayoutResult.
- The graph Canvas was not clipped, so panning drew nodes and edges over the
  'Versions' row and the 'Workflow graph' heading. The viewport now clips its
  children.
- Outcome labels overprinted when a stage had more than one outgoing edge ('error'
  over 'success'). Labels are now laid out in one row per source edge, with a
  backing rect for legibility.
- Stage columns followed an iterative rank relaxation, so graphs with a back edge
  rendered out of order (planner before reviewer). rankStages now returns
  declaration order, matching internal/tui/graph_layout.go.

Verified: :app:compileDebugKotlin, :app:assembleDebug and :app:testDebugUnitTest
succeed offline with 20 tests and 0 failures (new WorkflowGraphTest covers the
rank order and label slots), and the app was driven on the Pixel_Fold_API_36
emulator against the live server with no FATAL or Compose exception in logcat.
2026-10-13 19:23:10 +01:00
alan 9a94eabaa3 Add the native Android client for the Pipelines server
Kotlin and Jetpack Compose Material 3 client that speaks the existing WebSocket
protocol: settings requiring an explicit server URL and workspace, pipeline list and
detail with the workflow graph, run history, run detail and evidence, start and
cancel run, reconnect, and the loading/empty/error/disconnected states. It stores no
credentials and keeps execution, definitions and run history on the server.

Verified on the host: :app:compileDebugKotlin and :app:assembleDebug succeed and
:app:testDebugUnitTest passes 19 tests. Ignore Gradle outputs and re-include the
net.awan.pipelines.data package, which the repository runtime data/ rule would
otherwise exclude.
2026-10-13 17:20:18 +01:00