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.
This commit is contained in:
2026-10-15 14:34:49 +01:00
parent e843aa08a8
commit 1828171a9c
9 changed files with 902 additions and 247 deletions
+68 -3
View File
@@ -111,9 +111,43 @@ stops it.
is retained for when it is explicitly requested.
- Consistent Material 3 top app bars on Pipelines, Runs and Settings (and the
existing back/refresh/start/cancel/retry bars on the detail screens).
- Both detail screens render a single `LazyColumn` whose sections ("Versions",
"Workflow graph", "Source" on a pipeline; "Run graph", "Input", "Output",
"Session evidence", "Steps" on a run) are collapsible via a shared
- 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. The run's
six tabs scroll horizontally on a narrow window; on a wide window the same tabs
render as a vertical selectable rail. Selection is `rememberSaveable` (survives
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 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. 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
@@ -232,3 +266,34 @@ 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.
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`.