Files
pipelines/android/README.md
T
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

549 lines
34 KiB
Markdown

# Pipelines Android client
A native Android (Kotlin + Jetpack Compose Material 3) client for an existing
Pipelines server. All execution, model credentials, definitions and run history
stay on the server; the app only speaks the existing WebSocket protocol.
## Scope and safety
- **Trusted LAN/VPN only.** The Pipelines API has **no authentication** and is
**not internet-safe**. Do not expose the server to untrusted networks.
- **No secrets.** The app stores no credentials, tokens or provider keys and
sends no auth headers. Only the server URL and workspace path are persisted as
plain, non-secret preferences.
- **No hardcoded server.** The server URL and workspace path must be entered
explicitly by the user; there is no default/disposable address baked in.
- The app does **not** run Docker, execute stages, or reimplement any Go
parsing/execution logic. `android/` contains only the client.
## Requirements
- JDK 17 (see `compileOptions` / `kotlinOptions.jvmTarget`).
- Android SDK with a platform and build-tools matching `compileSdk = 35`
(`app/build.gradle.kts`), and `ANDROID_HOME`/`ANDROID_SDK_ROOT` set.
- Gradle 8.9+ (AGP 8.7.2, Kotlin 2.0.21).
The version numbers above are deliberate defaults chosen without a discovered
SDK; adjust `compileSdk`, `targetSdk`, and the versions in
`gradle/libs.versions.toml` to whatever is actually installed. If a required
SDK/Gradle component is missing, fix the environment rather than downloading
untracked artifacts.
### Gradle wrapper
`gradle/wrapper/gradle-wrapper.jar` is a generated binary and is intentionally
**not committed**. Generate a working wrapper on a machine with Gradle installed:
```sh
cd android
gradle wrapper --gradle-version 8.9
```
Until then, build with a locally installed Gradle:
```sh
cd android
gradle :app:assembleDebug
```
## Build, test and install
```sh
cd android
gradle :app:testDebugUnitTest # protocol/URL/graph unit tests
gradle :app:assembleDebug # debug APK
gradle :app:lintDebug # Android lint
# install on a connected device/emulator:
gradle :app:installDebug
adb shell am start -n net.awan.pipelines/.MainActivity
```
## Configuration
Open the **Settings** tab and enter:
- **Server URL** — `ws://HOST:PORT/connect` (LAN/VPN) or `wss://…/connect`
(proxy/VPN). A path is optional and defaults to `/connect`, matching the Go
server's `GET /connect`. `http(s)`, userinfo and fragments are rejected with a
specific message.
- **Workspace path** — an **absolute directory that already exists on the
execution server**. This is *not* the phone's storage. For Docker, mount the
host directory at the same absolute path with the owner's UID/GID so the
server can resolve it (see `docs/docker.md` and `compose.yaml`). The field
flags a non-absolute path and will not save it, mirroring the repository's
start-run guard.
Tap **Connect** to open the single shared WebSocket (probed with `ping`, showing
the server build). Reconnect uses bounded exponential backoff; **Disconnect**
stops it.
## Features
- Pipeline list (search/refresh, empty/error/loading states), pipeline details
(version list, content hash, source) and the workflow graph.
- Workflow graph composable: content-sized stage nodes laid out in one row in
declaration order, with `#failure`/`#success` terminals sharing a lower row and
arrows entering their top borders (an `error -> #failure` route leaves its
source's bottom); labelled outcome edges (`error*` marks the implicit
fallback), loops and branches, pan/zoom, and run highlighting (executed routes
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. 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
that still fits a 4-stage graph with its terminal row. The graph's TopEnd
control cluster pairs "Fit graph to view" with an expand/collapse toggle that
grows the panel to about the full window height; the expanded state is stored
in `rememberSaveable` and the panel refits on resize. Because the panel lives
inside each screen's `verticalScroll` column, growing it only extends it below
the fold, so expanding also requests `BringIntoViewRequester` to scroll the
taller panel back into the visible viewport instead of leaving the graph
centred off-screen.
- Dark-first Material 3 theme with an app-owned colour scheme (no dynamic/
wallpaper colour): the dark scheme is the default and the window background and
system bars are dark so launching shows no light flash; a complete light scheme
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 are tabbed via one shared `ui/components/DetailTabs.kt`:
run detail exposes Summary, Graph, Input, Output, Evidence and Steps, pipeline
detail Summary, Graph and Source, with Summary first and the default. Every tab
carries a meaningful icon alongside its label. The run's six tabs scroll
horizontally on a narrow window; on a wide window the same tabs render as a
vertical selectable rail that **collapses to a narrow icon-only strip** and
expands back via an accessibility-labelled "Collapse tabs"/"Expand tabs"
control, so the content reclaims the rail's width; the collapsed strip keeps
each icon's accurate content description and still marks the selected tab. Both
the selection and the collapsed/expanded state are `rememberSaveable` (survive
recomposition and configuration changes) and the tabs carry real tab semantics
(`Role.Tab` + selected state), so selection is never conveyed by colour alone.
Only the selected tab's body composes (`when`), each tab is a single
`LazyColumn`, and the Graph tab keeps the full-height `WorkflowGraph` panel
with its Fit and expand controls.
- The Source tab fills the whole tab area and renders the parsed definition
instead of dumping the raw markdown: one collapsible section per stage (name ·
type) holding labelled blocks for prompt, output, tools, configs, edges
(outcomes with their resolved targets, `#success`/`#failure` named as
terminals), memory, limits and notification policy, skipping what a stage does
not have. The rows come from the same `stageDefinitionFields`/`StageFieldRow`
the stage detail sheet uses, so the two views cannot diverge. The exact source
stays available behind a "Raw" toggle and a whole-definition copy action.
- The Summary tab carries what each page header carried: for a run the
status/outcome/executing chip row, recorded + completed visits, pipeline
id/version, stage, workspace, content hash, start/finish/duration and the
failure diagnostic; for a pipeline the name, id/version, stages, content hash,
created/updated, latest version/version-created and the version list.
- Code-like content (Input, Output, Source, session transcripts, per-field and
evidence data, diagnostics) renders through one themed `ui/components/
CodeBlock.kt` card: `surfaceContainer` role, default rounded shape, a small
label header, a whole-block copy action (`LocalClipboardManager`) and monospace
at the shared size/line height, with a bounded height that scrolls internally
instead of pushing the page. `maxHeight = null` renders a block unbounded so the
surrounding page scrolls as a whole (the Source tab uses this); the default
bounded behaviour is unchanged for every other caller. Blank content renders
nothing, and no raw bordered monospace box remains.
- Inside each tab the existing `LazyListScope.collapsibleSection` (`SectionHeader`)
provides inner sections where content naturally breaks down: Output per result
field, Input per labelled part, Steps per stage group and Evidence per entry.
Each defaults to expanded and its collapsed set is `rememberSaveable`, so it
survives configuration changes; the sections are items of the tab's single
`LazyColumn`, so no scrollable nests inside a same-direction scrollable.
- Foldable-responsive layout driven by window size (`ui/WindowSize.kt`,
`isWideLayout(widthDp)` at a 600dp breakpoint, read from
`LocalConfiguration.current.screenWidthDp`): a narrow window keeps the
single-pane lists, top tabs and bottom navigation, while a wide window shows
the pipeline list beside the selected pipeline's tabs and the run list beside
the selected run's tabs (master pane ~360dp), with the detail tabs as a side
rail, the text column capped at a comfortable width and the graph using the
extra width. No material3-adaptive dependency is added.
- Both detail screens' sections are still collapsible via the 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 (kept aligned with the step title),
the stage with its sequence and an outcome chip. A step's metadata is a set of
aligned label/value rows (`KeyValueRow`) — paired side by side in two columns on
a wide window and stacked in one column on a narrow one — with a single
consistent vertical rhythm (one bottom gap per step, no doubled gap when a step
has no expandable detail) and full-width monospace evidence cards. Every
retained field stays: status, outcome, duration, visit/maxVisits/limitReached/
model target, target, session id, agent active, diagnostic and, behind the
collapsed-by-default detail, input, output, transcript, file changes (including
binary/truncated and skipped) and notification receipts.
- 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
record is rendered (sequence/session id/backend/directory/data/diagnostic) on
demand via `get_run_evidence`; it is never part of the 1s poll.
- A shared connection banner above every screen surfaces a distinct
Idle/Connecting/Disconnected state with a Reconnect action (and stays hidden
while connected), so a dropped connection is not just a generic request error.
- Start run (confirmation dialog; sends `PipelineID`, `Version`, a reused
`request_key` ≤128 chars, the configured absolute workspace and `input.prompt`)
and cancel run (confirmation; sends the `RunID`, then refreshes). Retry is
offered only for terminal failed runs.
- A run being polled at a fixed 1s interval is stopped as soon as it is no
longer executing.
## Architecture
```
data/protocol kotlinx.serialization models mirroring internal/protocol/*
(Message, Graph/Stage, RunDetail/RunStep, UsageStats, …) plus
GraphSemantics reproducing internal/tui/graph.go rules.
data/transport ServerUrl validation (mirrors internal/client/config.go) and
PipelinesClient — one reused WebSocket, serialized requests,
client ids matched against replies, unsolicited envelopes
dropped, bounded reconnect backoff.
data SettingsRepository (non-secret prefs) and PipelinesRepository
(typed request builders + per-session graph/detail cache).
ui Compose Material 3 screens, one AppViewModel, navigation.
```
## Verification status
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; **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, 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`.
Settings, pipeline list (all 9 pipelines), pipeline detail, the workflow graph,
run history and run detail were captured to `captures/` and
`captures/style_pass/` (both git-ignored) and reviewed.
- `adb logcat` for the app package contained no `FATAL EXCEPTION`, Compose or
other runtime exception during the sweep.
- The orthogonal-edge / resizable-panel pass was verified the same way: a
baseline APK was built from the pre-change tree and installed, then the new
build was installed and driven to the 4-stage pipeline-detail graph and a
run-detail graph with the executed route highlighted. `captures/graph_pass/`
(git-ignored) holds `pipeline_detail_before/after` and `run_detail_before/after`
pairs plus a panned state and the expanded panel after tapping the toggle
(`pipeline_detail_expanded_after`, `run_detail_panned_after`,
`run_detail_expanded_after`). A review of that pass found the expanded panel
scrolled below the fold (blank) and the PNGs prefixed by an adb stderr warning,
so the expand now scrolls the panel into view and the after-captures were
re-taken with a display id (`adb exec-out screencap -p -d <display-id>`) so no
warning leaks into the files. `adb logcat` showed no `FATAL EXCEPTION` and no
app/Compose exception during the sweep.
Known limitations of that run: pinch-zoom could not be driven through `adb`
(single-touch pan only) and one portrait Fold viewport was used. A follow-up pass
fitted the graph to its viewport on first layout, clamped panning so the content
cannot leave the view, added a "Fit graph to view" action, connected on launch
when a server URL is already saved, and made the completed/recorded visit wording
and the outcome-label contrast consistent. The fitted graph still sits slightly
above the box's vertical centre, because the layout box includes padding that is
not drawn. A later style pass made the theme dark-first (app-owned scheme; the
launch window/bar colours match it) and moved the `#failure`/`#success` terminals
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.
The tabs / code-block / foldable pass was verified on the same
`Pixel_Fold_API_36` emulator (dark mode, `adb shell cmd uimode night yes`) against
the live server: `:app:testDebugUnitTest` reported **60 tests, 0 failures**
(including new `WindowSizeTest` for `isWideLayout` at 400/600/800 and
`DetailTabsTest` for the tab lists and `clampTabIndex`) and `:app:assembleDebug`
succeeded. The debug APK was installed and driven; captures were written to
`captures/tabs_pass/` (git-ignored): every run-detail tab (`05_run_summary`,
`06_run_graph`, `07_run_input`, `08_run_output`, `10_run_evidence`,
`11_run_steps`), every pipeline-detail tab (`01_pipeline_summary`,
`02_pipeline_graph`, `03_pipeline_source`), a long Input/Output block showing the
themed card scrolling internally (`07_run_input`/`08_run_output`, whose block
`ScrollView` measures the 320dp cap), a collapsed inner section
(`09_run_output_collapsed`, `"input, collapsed"`), a step's expanded evidence code
blocks (`12_run_step_expanded`) and the wide two-pane layouts with the vertical
tab rail (`13_wide_runs_split`, `14_wide_run_summary`, `15_wide_pipelines_split`,
`16_wide_pipeline_summary`, `17_wide_pipeline_graph`). Tab-selection persistence
across a configuration change was exercised by switching `wm density` 390→401
with the run detail open; the selected tab stayed selected
(`18_before_config`, `18_after_config`). `adb logcat` for the app package
contained no `FATAL EXCEPTION` and no Compose/other runtime exception.
The space-usage pass (collapsible icon rail, roomier Steps, rendered Source tab)
was verified on the same `Pixel_Fold_API_36` emulator (dark mode after
`adb shell cmd uimode night yes`) against the live server at
`ws://10.0.2.2:8080/connect`:
- `:app:testDebugUnitTest` reported **76 tests, 0 failures** (up from 60:
new `StageDetailSheetTest` for the stage/step field derivation and
`StepMetaTest` for the step metadata pairing + details predicate, plus the
icon/rail-width assertions in `DetailTabsTest` and the file-change/notification
formatting in `FormatTest`). `:app:assembleDebug` and `:app:installDebug`
succeeded; the install reported `Installed on 1 device` (the emulator — no
physical device was attached at install time).
- Captures were written with `adb -s emulator-5554 shell screencap -p
/sdcard/shot.png` followed by `adb -s emulator-5554 pull` (never
`exec-out … >`), to `captures/space_pass/` (git-ignored):
`narrow_pipeline_top_tabs` (narrow window, tabs across the top),
`source_tab_narrow` (rendered definition) and `source_tab_raw_narrow` (the
`Raw` toggle revealing the exact markdown), `wide_source_rail_expanded`
(icon+label rail, Source tab) and `wide_source_rail_collapsed` (icon-only rail,
content visibly wider), `wide_run_steps_expanded` and
`wide_run_steps_expanded_rail_collapsed` (a step with the two-column metadata
grid — Status/Outcome, Duration/Visit, Target/Session — and full-width Input/
Output/File-changes/Transcript cards), plus `wide_graph_stage_sheet` (tapping a
stage on the Graph tab still opens the refactored `StageDetailSheet`). No
clipping, even step spacing and a height-filling Source tab were confirmed by
eye.
- Rail-collapse persistence across a configuration change was exercised by
collapsing the rail on a detail screen and switching `wm density` 390→401: the
activity recreated and the collapsed strip stayed collapsed (`Expand tabs` was
still the control's description after the change; capture
`wide_detail_rail_collapsed_config_change`). The saved tab index is clamped by
`clampTabIndex` (unit-tested), so a stale index never indexes out of bounds.
- The wide layout was exercised by resizing the emulated display
(`adb shell wm size 2000x3400`, ≈820dp at density 390) and reset afterwards
(`wm size reset`); the attached Pixel 10 Pro Fold was never used and no run was
started from the app.
- `adb -s emulator-5554 logcat -d` contained 0 `FATAL EXCEPTION` lines and 0
`E AndroidRuntime` lines. The emulator was stopped with `adb emu kill`; no
`qemu-system-aarch64-headless` process survived.
Because `adb` cannot physically fold the phone, the wide two-pane/rail layout was
exercised on the emulator by resizing the emulated display (`adb shell wm size
2000x3400`, ≈820dp at density 390) and the narrow single-pane layout at the
default width (1080px ≈ 443dp); the attached Pixel 10 Pro Fold was not used to
drive the app. Note that `:app:installDebug` installs to *every* connected
device: that Gradle task therefore also (re)installed the debug APK on the
attached Pixel 10 Pro Fold; all device-driving commands targeted the emulator
serial (`adb -s emulator-5554`) explicitly. The emulator was stopped with
`adb emu kill` plus `kill -9` of the surviving `qemu-system-aarch64-headless`.
## Distinct graph colours, Timeline + visit tabs, real list pane, floating pill
Four UI changes were verified on the same `Pixel_Fold_API_36` emulator (dark mode
after `adb shell cmd uimode night yes`) against the live server at
`ws://10.0.2.2:8080/connect`. Nothing in the Pipelines server, its Go source,
Docker/compose files or the installer was touched, no run was started from the
app, and the attached Pixel 10 Pro Fold was never driven (the debug APK was
installed with `adb -s emulator-5554 install -r`, not `:app:installDebug`, so the
physical device was not re-installed by this pass either).
- **Graph colours.** `GraphPalette` is a curated, fixed palette plus a pure
deterministic outcome→index mapping (no `hashCode() % 4`). `error` stays the
theme error role and `success` the theme tertiary (positive); every other
outcome uses one palette colour for both its edge stroke and its label text.
Node fills differ by kind (`GraphNodeKind`: terminal success, terminal failure,
model, ntfy, other/custom); a selected stage inverts (light fill / dark text)
plus a 4px border, and executed-vs-dimmed alpha still applies on top. WCAG
contrast is *measured*: `GraphPaletteTest` checks the helper against known
reference ratios (white/black 21, `#777`/white 4.48) and asserts every palette
colour is ≥ 4.5:1 against `DarkSurface 0xFF0E1513` (measured values range from
8.63:1, `approved`, to 13.78:1, `fast`; `success` 11.73:1 and `error` 10.89:1 as
the dark scheme supplies them).
- **Timeline + visit tabs.** The run-detail `Steps` tab is renamed `Timeline`
(key kept `steps`); it renders one compact line per recorded visit (stage,
visit number, outcome chip, duration and a brief diagnostic/target description)
and nothing else — the heavy evidence moved entirely into the shared
`StageDetailSheet`. The sheet now takes a stage's ordered `runSteps` plus an
`initialVisitIndex` and shows a `visit 1..N` tab row only when there is more
than one visit; the timeline opens on the tapped visit and the graph on the
most recent. `runStepFields` gained the step Input/Output blocks, so the sheet
still carries status, outcome, duration, visit/max/limit, model target, target,
session, agent, diagnostic, transcript, input, output, file changes,
notifications and the stage definition.
- **Real list pane.** Pipelines and runs now share one `ListRow` (a single flat
`Surface`, thin `HorizontalDivider`, leading element + title + secondary line,
no per-row elevation) instead of a card per item. The selected row uses the
same tonal `secondaryContainer`/`onSecondaryContainer` treatment as the tab
rail and destinations, exposed as `selectable` selected state; opening a row
selects it and Back clears it. The wide list pane collapses to a 56dp strip
(`rememberSaveable`), with the freed width going to the detail.
- **Floating destination pill.** The bottom `NavigationBar` is replaced by a
floating rounded `Surface` at the bottom right holding the three destinations
as 48dp icon targets, inset by the Scaffold's system-bar padding plus 16dp;
selected state is a tonal circle plus `Role.Tab` selected semantics (not colour
alone). The same pill is used on **both** window widths (no compact strip);
the app reserves 88dp at the bottom so no scrollable content is hidden behind
it.
- **Icons.** Icons are taken from `material-icons-extended` (already declared in
`app/build.gradle.kts`/`libs.versions.toml`, BOM-managed — no new dependency
and no non-offline Gradle invocation was needed; the artifact was already in
the cache). Mapping: Pipelines → `AccountTree`, Runs → `History`, Settings →
`Settings`; Graph tab → `Hub`, Timeline → `AutoMirrored.List`, Input →
`AutoMirrored.Input`, Output → `AutoMirrored.Send`, Evidence →
`AutoMirrored.FactCheck`, Source → `Code`; run statuses → Running
`AutoMirrored.DirectionsRun`, Queued `Schedule`, Succeeded `CheckCircle`,
Failed `Error`, Canceled `Cancel`, Interrupted `PauseCircle`, Active `Bolt`,
Unknown `AutoMirrored.HelpOutline`. The debug APK is ~17 MB; note that
`app/build.gradle.kts` sets `release { isMinifyEnabled = false }`, so R8 does
**not** strip unused extended icons in the current release config (that
stripping only applies to a minified build).
- `:app:testDebugUnitTest` reported **93 tests, 0 failures** (new
`GraphPaletteTest`, `TimelineTest`, `PipelinesNavTest`; extended
`StageDetailSheetTest` and `DetailTabsTest`; `StepMetaTest` was removed with the
inline metadata grid it covered). `:app:assembleDebug` succeeded.
- Captures were written with `adb -s emulator-5554 shell screencap -p
/sdcard/shot.png` followed by `adb -s emulator-5554 pull` (never
`exec-out … >`), to `captures/nav_timeline_pass/` (git-ignored):
`01_launch`, `02_runs_narrow` (narrow lists + pill), `04_timeline` (the concise
Timeline tab), `05_sheet_from_timeline_visits` (sheet from the timeline opening
on the tapped visit 1, with visit tabs), `05b_sheet_single_visit_no_tabs` (a
single-visit stage shows no tab row), `06_sheet_run_section` (Input/Output in
the sheet), `07_run_graph` (executed route highlighted), `08_sheet_from_graph`
(same stage opened from the graph, on the most recent visit 2),
`09_pipeline_4stage_graph` + `_2x`, `10_pipeline_1stage_graph` + `_2x`,
`11_wide_pane_expanded`, `12_wide_pane_selected`, `13_wide_pane_collapsed`,
`14_wide_runs_pane`, `15_wide_run_detail`, and the icon close crops
`16_pill_wide_2x`, `17_tabs_wide_2x`, `18_runstatus_icons_2x`,
`18b_failed_status_2x`, `19_pill_narrow_2x`.
- `adb -s emulator-5554 logcat -d` contained 0 `FATAL EXCEPTION` lines and no
Compose runtime exception. The wide layout was exercised with
`adb shell wm size 2000x3400` (≈820dp at density 390); the emulator was stopped
with `adb emu kill` plus `kill -9` of any surviving
`qemu-system-aarch64-headless`.
## Per-visit artifacts, collapsed defaults, single top inset, APK publish (15 Oct 2026)
Four changes were implemented in `android/` only. Nothing in the Pipelines
server, its Go source, Docker/compose files or the installer was touched, no run
was started from the app, and the 8 MiB per-file artifact cap
(`internal/server/artifacts.go` `maxArtifactFileBytes`) was left unchanged.
- **Artifacts.** `RunStep` now models the server's `artifacts`
(`StageArtifact{name, size_bytes, content_type, url}`), `artifacts_skipped` and
`artifacts_truncated` with the exact `internal/protocol/runs.go` wire names.
`ui/graph/Artifacts.kt` renders one row per file (name, `humanBytes` size,
content type) with an open (`ACTION_VIEW`) and a copy-link action, an inline
image thumbnail (OkHttp + `BitmapFactory` with `inSampleSize` off the main
thread, bytes cached once per URL) and a full-size view on tap; other types get
a type icon. URLs are resolved by `ServerUrl.resolveArtifactUrl` against the
configured server URL (ws→http/wss→https, `/connect` dropped), never a
hardcoded host; with no URL configured the actions are disabled and a hint is
shown. Empty/partial states reuse the TUI strings from
`internal/tui/file_changes.go`. The Timeline rows carry a subtle `AttachFile`
indicator (`hasArtifacts`) with a per-visit `contentDescription`.
- **Collapsed defaults + self-describing titles.** `SectionExpansionState` now
persists the set of *expanded* keys (default empty), so every inner section in
the run detail (input/output/evidence) and pipeline detail (Versions, Source)
starts collapsed while operator choices still survive configuration changes.
Evidence section titles are built by `evidenceSectionTitle`, e.g.
`Evidence - step 4, ui_reviewer visit 1, opencode`, correlating
`SessionEvidence.sequence` with the run's steps once per data change; a blank
field key already falls back to its prefix and never yields an empty title.
- **Top inset.** The outer `Scaffold` in `PipelinesApp` now uses
`contentWindowInsets = WindowInsets(0, 0, 0, 0)` so the inner Material 3 app
bars own the status-bar inset exactly once (removing the duplicate top band);
the floating pill clears the navigation bar via
`windowInsetsPadding(WindowInsets.navigationBars)`. While the connection banner
is visible it owns the status-bar inset (padding inside its `Surface`) and the
`NavHost` below consumes `statusBars` so the app bar is not double-padded.
- **APK publish.** `:app:assembleDebug` produced
`app/build/outputs/apk/debug/app-debug.apk` (18,181,943 bytes, sha256
`41c9df314da40bb19df7e3d90f27a83339a275768cefee537c4ba796efe01eab`, rebuilt
after the follow-up fixes below), copied to
`~/.local/share/pipelines/data/artifacts/58/1/pipelines-debug-d00bd37.apk`
(`d00bd37` = short SHA of the last commit touching `android/`) with a matching
`shasum -a 256`. At 17.3 MiB it exceeds the 8 MiB per-file inventory cap
(`internal/server/artifacts.go` `maxArtifactFileBytes = 8 << 20`), so it is
served by direct URL but deliberately absent from the step inventory.
### Follow-up fixes (code review of the first pass)
- `ui/graph/Artifacts.kt` hoists its derivations with `remember(step)` /
`remember(artifact.url, configuredServerUrl)` / `remember(artifact)` so the
summary text, the partial-capture notes, the resolved URL, the image test and
the meta line are computed once per data change, never per recomposition.
- `ArtifactBytesCache` is a byte-bounded `LruCache` (16 MiB) rather than an
unbounded map, so a long session cannot retain every fetched artifact.
- `artifactCaptureNotes` returns no notes for an empty artifact list, matching
`internal/tui/file_changes.go` `artifactLines` (which returns nothing when the
list is empty); the empty-state summary is unchanged.
- The field-section title fallback is the pure `fieldSectionTitle`, covered by
`TimelineTest#fieldSectionTitleFallsBackToPrefixAndIsNeverEmpty`.
Evidence actually obtained in this pass (macOS, JDK 17 from Homebrew
`openjdk@17`, Gradle 8.11.1 from the wrapper cache,
`ANDROID_HOME=/Users/alan/Library/Android/sdk`):
- `:app:testDebugUnitTest` reported **103 tests, 0 failures** (new
`ProtocolModelTest#runStepArtifactsParseWithExactWireNamesOrAbsent`,
`FormatTest` cases for `humanBytes`/`artifactMetaLine`/`artifactsSummary`/
`artifactCaptureNotes`, `ServerUrlTest#resolvesArtifactUrlAgainstTheConfiguredServerUrl`
and `resolveArtifactUrlReturnsNullWhenUnconfiguredOrBlank`,
`DetailTabsTest#sectionsStartCollapsedAndToggleIsRemembered`, and `TimelineTest`
cases for `hasArtifacts`/`evidenceSectionTitle`/`fieldSectionTitle`).
- `:app:assembleDebug` succeeded (18,181,943-byte debug APK).
- `:app:lintDebug` still reports the two pre-existing `NewApi` errors for
`android:windowLightNavigationBar` (minSdk 26) in `res/values/themes.xml` and
`res/values-night/themes.xml`; those files were not modified by this change.
Verified against the live server (running as
`pipelines-server -addr 0.0.0.0:8080`, the app configured
`ws://10.0.2.2:8080/connect`; LAN address `10.0.0.249` from `ipconfig getifaddr en0`):
- The published APK is served at
`http://10.0.0.249:8080/artifacts/58/1/pipelines-debug-d00bd37.apk` (LAN), not a
hardcoded `localhost`/`10.0.2.2` host. `curl -I` returned `HTTP/1.1 200 OK`,
`Content-Type: application/vnd.android.package-archive`, `Content-Length:
18181943`; a streamed `GET` piped to `shasum -a 256` returned
`41c9df314da40bb19df7e3d90f27a83339a275768cefee537c4ba796efe01eab`, equal to the
local `app-debug.apk`.
- Run 55 step 4's real artifacts are served:
`curl -I http://10.0.0.249:8080/artifacts/55/4/graph_crop_error_rejected.png`
→ 200, `image/png`, 52,168 bytes and
`.../swatch_error_vs_rejected.png` → 200, `image/png`, 5,008 bytes.
- The server has no HTTP inventory endpoint (only `GET /artifacts/…`,
`GET /healthz`, `GET /connect`); the step inventory is delivered over the
websocket and clips entries larger than `maxArtifactFileBytes` (8 MiB), so the
17.3 MiB APK is intentionally absent from it.
Not verified in this pass — no device was attached (`adb devices` listed no
devices, and no emulator was running): the on-device/emulator narrow/wide
before/after screenshots for the top inset and the collapsed sections, the
`logcat` sweep and the install on the Pixel 10 Pro Fold. The previous pass's
emulator screenshots for the artifacts sheet (narrow/wide run detail) are in
`~/.local/share/pipelines/data/artifacts/58/3/`.