359912f822
The full-screen viewer now opens markdown/text artifacts (text/markdown, text/plain, .md/.markdown/.txt) through the resolved artifact URL and renders them with the page's own DOM markdown renderer, with an honest failure message and an external fallback. ArrowLeft/ArrowRight page the shared media+document list, and a backdrop click closes the viewer while panel clicks do not. The run gallery and per-visit artifacts present input.md, memory.md and output.md as ordinary Document tiles with a drawn glyph and open the viewer. Adds isMarkdownArtifact/isViewerArtifact with unit coverage, deterministic viewer fixtures, and ui-smoke assertions/captures for rendered markdown, keyboard paging, the honest 404 and backdrop dismissal.
166 lines
89 KiB
Markdown
166 lines
89 KiB
Markdown
# Web client — parity checklist
|
||
|
||
The browser client's acceptance gate. **The target is the Android app's feature
|
||
set** (`android/`), rendered for the web. A row is only `done` when the feature
|
||
works in the browser against a live server **and** a review stage captured the
|
||
rendered result through `test/ui-smoke.mjs` (or an extension of it). A green unit
|
||
test, or a code change without a capture, is `partial` at best.
|
||
|
||
Status legend: `todo` · `partial` (some of it works) · `done` (working + captured).
|
||
|
||
## Transport and connection
|
||
| # | Feature (Android counterpart) | Protocol | Status |
|
||
| --- | --- | --- | --- |
|
||
| T1 | Server-URL entry + validation rules (`data/transport/ServerUrl.kt`) | — | done |
|
||
| T2 | One reused socket, id matching, request timeout, not-connected guard (`PipelinesClient.kt`) | — | done |
|
||
| T3 | Connect / disconnect / manual reconnect | `ping` | done — connection now lives only in the Settings Connection section (L2–L4 moved it out of the chrome). `Connect` is connect-only, `Disconnect` closes the shared socket, and `Reconnect` re-opens the validated endpoint immediately, resetting the client's attempt/backoff; all three drive the page's one client. Captured 2026-10-19: `captures/84-shell-settings-connection-1440x900.png` (the connected status card and the Disconnect/Connect pair) and `captures/L1-settings-idle.png` (idle: Connect + Reconnect). The shell's rail/dock dot+word control mirrors the state and is a Settings shortcut (`captures/85-shell-status-indicator-1440x900.png`); the old header URL field, Connect/Disconnect button and state badge are gone |
|
||
| T4 | Backoff recovery + foreground reconnect after sleep/blur (`ConnectionRecovery.kt`, `ForegroundReconnector.kt`) | — | done — the client's capped backoff is surfaced honestly rather than rewritten: `captures/29-disconnected-banner.png` shows the Settings status card `Disconnected` / `Connection closed (1006)` / `Retrying with backoff…`, while the shell's compact indicator reads `Disconnected`. The attempt number is named only while Connecting (`Connecting (attempt N)…`), matching `ConnectionBanner.kt`; the disconnected card deliberately omits it rather than diverging from Android's wording. The foreground-reconnect **decision** (`foregroundAction`) is unit-tested in `test/connection.test.mjs` (Idle→LeaveAlone; Connecting/Disconnected→Reconnect; Connected→`confirmedAlive ? LeaveAlone : Reconnect`); the **rendered recovery** is captured in `captures/30-reconnect-recovered.png`, where the page (asserted still `Disconnected`) is pointed back at the live server and the browser's own `online` event drives it to a green Connected. The browser uses its `online`/`visibilitychange` event as the liveness signal, so a still-Connected socket is left alone (no in-page positive ping probe is needed; a documented deviation from `ForegroundReconnector`'s positive ping) |
|
||
| T5 | Connection status + live badge; build/protocol mismatch warning | `pong` build/protocol | done — the full status card lives in Settings (never overlaying content): green `Connected` + `Server build …` + `Server time …` (`captures/84-shell-settings-connection-1440x900.png`), `Disconnected` + the server's message + `Retrying with backoff…` (`captures/L1-settings-disconnected.png`), `Connecting (attempt N)…` (`captures/L1-settings-connecting.png`) and idle `Not connected` (`captures/L1-settings-idle.png`). The shell keeps only a compact dot+word indicator (connected / connecting / disconnected / not connected / not configured) in the rail footer and the narrow bar; it is never colour-only. The protocol-mismatch warning is rendered in the same Settings Connection section (and remains unit-tested via `protocolMismatch`); no live mismatch is expected because the server reports protocol 1. A minimal dot+word live badge still marks the run stream in the runs list/detail (`live` / `reconnecting` / `not live`, per `LiveBadge.kt`/`RunStream.kt`). The build line comes from the `pong` in `SettingsScreen.kt`'s own shape, `Server build {version} ({commit})`; a dirty tree is already marked in `version` by `internal/buildinfo` (`-dirty`), so no duplicate `+dirty` marker is added |
|
||
| T6 | Artifact URL resolution against the configured server (`resolveArtifactUrl`) | `GET /artifacts/…` | done (URL only) |
|
||
|
||
## Pipelines
|
||
| # | Feature | Protocol | Status |
|
||
| --- | --- | --- | --- |
|
||
| P1 | Pipeline list | `list_pipelines` | done — row: name; `id {id} · v{version} · {N stages}`; `updated d MMM HH:mm`; last-run line joined from `list_runs` (status chip + `{ago} · {duration} · run {id}`, or `no runs recorded`) |
|
||
| P2 | Filter + sort (status/name/updated) | client-side | done — Filter menu (name contains, Runs Any/Has runs/No runs, Last run status over the 7 server states, Clear filters) + Sort menu (Server order default, Name A–Z/Z–A, Most recent run, Fewest/Most stages, Reset); server order preserved |
|
||
| P3 | Pipeline detail: stages, graph, versions, last run, content hash | `get_pipeline` | done — Summary/Graph/Source tabs; Summary shows content hash (monospace), latest version (`v{n}` or blank), created/updated, and a collapsed-by-default Versions section. Graph tab shows the browser guidance note plus the rendered workflow graph (P6) |
|
||
| P4 | Templates gallery + template detail | `list_templates`, `validate` | done |
|
||
| P5 | Create pipeline from a template (validate then submit) | `validate`, `submit` | done — a template detail offers the action `Create pipeline from this template`; its dialog's title is `Create from {name}` (a blank name falling back to the template key), it has one required field labelled `New pipeline name (required)`, the note `Creates a new draft pipeline on the server from this template's source; it is not run.`, and Create/Cancel buttons (Cancel reads `Close` after a success). Create is disabled while the name is blank (whitespace counts) or while sending, and the field locks while sending and after a success. Submitting validates the template's source first (`validate`); a validation refusal shows the server's own error in the still-open dialog and sends no `submit`. A passing validate submits exactly `{type:'submit',name:<trimmed>,source:<template source>,create_only:true}`, shows `Created "{name}". It is in the Pipelines list.` and refreshes `list_pipelines` so the new row is visible; a `submit` refusal shows the server's error in the still-open dialog. The pure helpers and both request shapes are unit-tested (`test/templates.test.mjs`, `test/repository.test.mjs`). Captured against a **scratch server with its own throwaway database** (never the live one): `captures/51-template-create-dialog.png` (blank name, Create disabled), `captures/52-template-created.png` (the exact success line; Cancel now `Close`) and `captures/53-pipeline-created-list.png` (the created pipeline shown in that scratch server's Pipelines list). **The live server's pipeline list was not modified**: the create flow runs only under `ui-smoke.mjs`'s explicit `--scratch` flag, the default run sends no `submit`, and the scratch server was stopped and its database deleted afterwards |
|
||
| P6 | Workflow graph rendering (nodes, edges, stage panes) | `get_pipeline` | done (captured 2026-10-19: nodes + labelled outcome edges + success/failure terminals, an opened stage definition pane and the expanded view — `captures/08-pipeline-graph.png`, `captures/08a-pipeline-graph-stage-pane.png`, `captures/08b-pipeline-graph-expanded.png`). Reusable `src/graph.js` (`mount` + pure helpers: layout, edges, `error*`, lanes, fit/clamp/zoom, hit-test, stage-definition fields); the definition view (every route executed, no legend) plus, since R5, a run-mode view driven by `runState` (executed/not-executed stages and routes, the Executed / Not executed legend, the live halo/elapsed badge). Pane labels match the app's own vocabulary (`Outcomes`, `Tools`) rather than the checklist's category words |
|
||
|
||
## Runs
|
||
| # | Feature | Protocol | Status |
|
||
| --- | --- | --- | --- |
|
||
| R1 | Run history list with status roll-up | `list_runs` | done |
|
||
| R2 | Filter by status, sort, "needs you" markers | client-side | done — status/pipeline/time filter + sort implemented and captured (`captures/09-runs-day-groups.png`–`captures/15-runs-sorted.png`); the "needs you" requirement is delivered exactly as the app does it: a bell/badge + sheet (R15), not a per-row mark. No other R2 work is outstanding |
|
||
| R3 | Run detail: run fields, steps/visits, targets, sessions | `get_run` | done — tabbed Summary / Graph / Input / Output / Timeline; the Timeline opens a per-visit stage pane with the headline rows (Status, Outcome, Duration, Visit `{v} / {max}`, Model target, Target, Session), the Verdict block (option chip + reason with inline artifact links) and the visit sections Artifacts / Session / Output / Input / This run / Stage definition. Captured 2026-10-19: `captures/20-run-430-summary.png`, `captures/23-run-430-timeline.png`, `captures/24-run-430-stage-artifacts.png`, `captures/25-run-440-verdict.png` |
|
||
| R4 | Summary tab incl. collapsible **Changes** viewer (raw + rendered diff), plus each visit's own file-change record | `get_run` file changes | done — the Summary's collapsed-by-default **Changes** section describes the run's **final state**, not a sum: steps are read in numeric sequence order, each path keeps first-seen order and reports its **last recorded step's** kind, patch, `+A -D` stat, binary/truncated flags and before/after modes, while `changed by A → B` still lists every stage that touched it in run order. Header wording is unchanged (`{N} file(s) changed · ±stat · partial capture`; empty variants `Changes · capture unavailable` / `partial capture` / `not recorded for this run` / `capture incomplete` / `no changes observed`). The aggregate is rendered **only when the run status is `succeeded`**; a failed or running run has no settled final state and shows no Summary Changes section at all. This is a **deliberate divergence from Android**, which shows the aggregate for failed runs too — the browser keeps the evidence in each visit's pane instead. That pane's existing **This run** section now shows the selected visit's own capture: a `File changes` line with the honest status word, file count, skipped/omitted counts and diagnostic; a `Changed files` list of `{kind} {path}` plus the parseable `+A -D` stat and `(binary)`/`(truncated)` markers; and neither row when the step recorded no capture. Each visit therefore shows its own set even when a stage ran three times. Summary rows still open the full-screen diff viewer with **Rendered** (each `@@` hunk header on a raised surface, old/new gutter numbers, the shared `+`/`-`/space line language) and **Raw patch** forms, Previous/Next file paging (disabled at the ends), a raw-patch copy control, Escape/backdrop/Close close, and honest binary/truncated/no-patch messages instead of a fabricated diff. Pure logic in `src/changes.js` and `src/runDetail.js`; `showRunChangesSummary` gates the aggregate. Captured 2026-10-19: `captures/28-run-438-changes-collapsed.png`, `captures/29-run-438-changes-expanded.png` (final-state `+42 -12` for the twice-edited `internal/server/retry_test.go`, header `+934 -156`), `captures/30-run-438-changes-diff-rendered.png`, `captures/31-run-438-changes-diff-raw.png`, `captures/32-run-449-changes-binary.png`, `captures/33-run-450-changes-truncated.png`, `captures/78-run-438-implementer-visit-changes.png` (that visit's own `partial (1 files)` and one Changed files line), `captures/79-run-440-no-summary-changes.png` (failed run: no aggregate), `captures/80-run-440-visit-changes.png` (its visit's `File changes`, no recorded rows), `captures/81-run-442-failed-visit-changes.png` (a failed run's implementer visit keeps its own Changed files) and `captures/82-run-<id>-no-summary-changes.png` (a running run: no aggregate) |
|
||
| R5 | Graph tab (per-stage panes, verdicts) | `get_run` | done — the run detail's Graph tab (between Summary and Input) mounts the shared `src/graph.js` renderer in run mode with the app's run note: a visited stage is executed (solid fill + border), an unvisited one hollow with a dashed muted border, a terminal executed only when a visit resolved to it, a route executed only when a visit produced that outcome (solid with an arrowhead; success first, error last, others alphabetical, `error*` for a fallback error route), the Executed / Not executed legend (runs only, never the definition view), and — while executing — the current stage's pulsing halo + elapsed badge (a static ring under `prefers-reduced-motion`; nothing for a finished run). Clicking a stage opens the existing visit pane at that stage's latest visit with its Verdict; Back/Escape close it and restore focus. The empty state is the exact `This server did not include the run graph.` (unit-tested; no live run currently carries a graph-less payload). Captured 2026-10-19: `captures/28-run-438-graph.png` (finished run 438: legend + executed styling + dashed untaken routes), `captures/29-run-438-graph-pane.png` (a graph-opened stage pane showing a Verdict), `captures/30-run-440-graph.png` (failed run 440: hollow/dashed not-executed stages) |
|
||
| R6 | Input / Output field sections per stage | `get_run` | done — one collapsed section per recorded entry, expanded as a monospace block (primitives verbatim, arrays `, `-joined, objects `k=v` `, `-joined), empty states "No input recorded." / "No output recorded.". Captured 2026-10-19: `captures/21-run-430-input.png`, `captures/22-run-430-output.png`, `captures/27-run-output-empty.png` |
|
||
| R7 | Timeline | `get_run` | done — one compact row per visit (`{stage} · visit {n}`, stage-outcome chip, paperclip when artifacts recorded, duration, description = first non-blank diagnostic line else `→ {target}`); empty state "No visits recorded.". Captured 2026-10-19: `captures/23-run-430-timeline.png`, `captures/26-run-428-timeline-empty.png` |
|
||
| R8 | Artifacts gallery + full-screen viewer (images inline, markdown/text rendered, others download/open) | `GET /artifacts/…` | done — the gallery keeps images (lazy thumbnails) and videos (poster, never autoplay) and now also presents `text/markdown`, `text/plain`, `.md`, `.markdown` and `.txt` artifacts as ordinary **Document** tiles (drawn page glyph + the existing `Document` label; `data-artifact-name` / `data-artifact-kind` metadata), including the stage-turn `input.md`, `memory.md` and `output.md` in both the per-visit section and the run gallery. Clicking one opens the existing full-screen viewer, whose dim backdrop contains one `.viewer-panel`; only a click on the backdrop (never inside the panel) or Escape/Close dismisses it. The document is fetched through the resolved artifact URL (same-origin via `serve.mjs`'s `/artifacts/` proxy) once per viewer session and rendered with the page's own `src/markdown.js` DOM renderer (headings, lists, tables, fenced code, links; never `innerHTML`); a failed fetch/render shows `describeError`'s honest message plus `Open {name} externally` at the resolved URL, while Open/Copy link/Share stay available. Images/videos are unchanged. ArrowLeft/ArrowRight page the same media+markdown list as the buttons (clamped, no wrap, disabled at the ends), and a re-render keeps focus inside the viewer. Pure selection in `src/artifacts.js` (`isMarkdownArtifact`, `isViewerArtifact`, extended `pagedArtifacts`), unit-tested in `test/artifacts.test.mjs`. Captured 2026-10-19 with the deterministic `--viewer` fixture run (ordinary artifacts, no new wire field): `captures/44-viewer-turn-documents.png` (input.md/memory.md/output.md as Documents in both galleries), `captures/45-viewer-markdown-rendered.png` (heading + fenced code fetched from the resolved URL), `captures/46-viewer-markdown-next.png` (ArrowRight advanced to the image artifact), `captures/47-viewer-markdown-failure.png` (honest 404 message + `Open missing.txt externally`) and `captures/48-viewer-markdown-backdrop-closed.png` (a panel click stayed open; the backdrop closed it). The pre-existing image viewer capture `captures/05-artifact-viewer.png` remains the unchanged-behaviour evidence. |
|
||
| R9 | Session export link (read-only `session.html`) | `GET /artifacts/…` | done (captured 2026-10-19: `captures/06-session-export-link.png`) |
|
||
| R10 | Live run updates: subscribe/unsubscribe + event fold | `subscribe`, `unsubscribe`, `run_event` | done — one app-wide watch owned by the connection, never by a screen: becoming connected best-effort `unsubscribe`s the previous watch, sends `{type:'subscribe',workspace:''}` send-only (no `run_ids`; `{type:'unsubscribe'}` drops it), then takes one authoritative resync (`list_runs`, plus one `get_run` when a run detail is open); a socket drop clears the watch and no screen change ever unsubscribes. `src/runEvents.js` is the pure fold ported from `ui/RunEvents.kt` (in-place list update preserving order, insert-at-head from the frame's pipeline identity, `needsResync` without identity, detail merge with explicit `resource_wait` set/clear, one step matched by `sequence` and inserted in sequence order, the monotonic run/step ladders and the full-sync decision) and is unit-tested in `test/runEvents.test.mjs`; the send-only path (`src/client.js#sendOnly`), the exact watch frames (`src/repository.js`) and the `run_event`/unsolicited-frame dispatch are unit-tested in `test/client.test.mjs` and `test/repository.test.mjs`. The 1 s run-detail poll is removed — pushed frames drive the detail and a settled/terminal frame triggers one coalesced `get_run` (at most one in flight per kind plus one queued follow-up, retried at 500 ms × attempt at most 3 times before the badge drops to `reconnecting`); the only surviving intervals are render-only clocks. The badge is the explicit stream state (`live` / `reconnecting` / `not live`, LiveBadge.kt words), independent of whether a run is executing, on the Runs list and the run detail. Captured 2026-10-19 against the live server with a **real pushed run** started by the smoke in a throwaway workspace: `captures/75-run-live-list.png` (the new run's row inserted from its own frame, badge `live`), `captures/76-run-live-detail.png` (the open detail folded to `running` from pushes, badge `live`) and `captures/77-run-live-terminal.png` (the pushed terminal fold to `canceled`, no poll), plus the reachable badge states `captures/28-connected-banner.png` (live), `captures/29-disconnected-banner.png` (not live while idle; reconnecting while the socket retries) and `captures/30-reconnect-recovered.png` (live again). `test/ui-smoke.mjs` asserts the reconnect wire order (unsubscribe → subscribe blank-workspace → list_runs) and that at least one genuine `run_event` frame for the started run arrived. The R10 step itself passes on every run; the full smoke can still fail later in unrelated, pre-existing steps on the shared live server (observed after the main merge: a flaky L1 stale page-level error on one run, a C5 chat fold `expected at least one folded agent turn, got 0` on another, and a C8 composer assertion while the operator's live chat session was streaming, so the composer correctly showed Stop; the focused `--notify` run is `UI SMOKE PASS`), which is not an R10 defect. |
|
||
| R11 | Human decision sheet: prompt, options, feedback | `decide_run` | done — the pure model (`src/actions.js`: `pendingDecision`, `lastWaitingStep`, `waitingPrompt`/`waitingOptions`, `humanOptions`, `decisionTargetLabel`, `DecisionDraft`) and the card + sheet are implemented with the Android copy verbatim: card title `Waiting for your decision`, meta `{stage} · run {id} · {runLabel}`, action `Decide`; sheet title `Decide {stage}`, meta `run {id} · {runLabel}`, the recorded instructions verbatim when non-blank, one selectable row per option in author order showing the option and `→ {target}` only when the declared edge resolves, the `Feedback (optional)` field, and `Cancel` / `Confirm decision` (reading `Sending…` while in flight). Selecting a row sends nothing and Confirm is disabled until a non-blank option is chosen; a refusal keeps the sheet open with the server's exact reason and re-reads the run. The request shape is unit-tested (`decide_run` = `{type, run_id, option, stage?, feedback?}`, stage/feedback omitted when blank, feedback trimmed). **Live, end to end (2026-10-19)**: `test/ui-smoke.mjs` gained an explicit `--decide` mode (the only mode allowed to submit). It reused the entry-stage human-only pipeline submitted create-only as `Web R11 decision 2026-10-19T14-59-18-785Z` (id 30: one `type=human` `gate` stage, `approve -> #success`, `hold -> #success`, `error -> #failure`, so no model stage runs) and started two runs in separate fresh temp workspaces. Run 513 parked in `waiting`; the browser asserted the card (`Waiting for your decision`, `gate · run 513 · Web R11 decision 1 (feedback)`, `Decide`), opened the sheet (`Decide gate`, `run 513 · …`, the recorded instructions `R11 live decision: review the run and choose approve or hold.`, `approve`/`hold` in author order each with `→ SUCCESS`, `Feedback (optional)`, Confirm disabled), selected `approve` (still no `decide_run`, and the run was still `waiting` via `pipelines inspect`), typed feedback, and pressed `Confirm decision`: exactly one frame `{"type":"decide_run","run_id":513,"option":"approve","stage":"gate","feedback":"Approved in the live browser decision sheet."}` was sent, the run left `waiting`, resumed and reached `succeeded`. Run 514 proved the no-feedback shape: selecting `hold` sent nothing, Confirm sent `{"type":"decide_run","run_id":514,"option":"hold","stage":"gate"}` with **no** `feedback` key, the run reached `succeeded`, its recorded feedback is blank and its verdict carries no reason. Captured: `captures/41-run-513-decision-card.png` (waiting card), `captures/42-run-513-decision-sheet.png` (open sheet with the options), `captures/43-run-513-decision-selected.png` (selected + feedback, Confirm enabled), `captures/44-run-513-decision-confirmed.png` (resumed detail, `succeeded`), `captures/45-run-513-decision-verdict.png` (`gate · visit 1` Verdict chip `approve → success` and the exact reason), and the no-feedback path `captures/46-run-514-decision-card.png`, `captures/47-run-514-decision-sheet.png`, `captures/48-run-514-decision-selected.png`, `captures/49-run-514-decision-confirmed.png`, `captures/50-run-514-decision-verdict.png` (`hold → success`, no reason). Command: `cd web && node test/ui-smoke.mjs --decide --out "$PWD/captures"` → `UI SMOKE PASS` (the reused pipeline means no new submit on the capture run); `cd web && node --test test/` stays green. Both runs are terminal, no R11 run remains active and both temp workspaces were removed. The submitted definition is intentionally retained and named here; no operator pipeline, version, run, chat or repository was modified. Re-verified after merging `main` (2026-10-19): the same reused pipeline parked runs 522 and 523, the same `--decide` check ended `UI SMOKE PASS` with `captures/41-run-522-decision-card.png` through `captures/50-run-523-decision-verdict.png`, and the full default live suite also ended `UI SMOKE PASS` (its R11 step still skips only because no operator run was waiting at that moment) |
|
||
| R12 | Cancel run | `cancel_run` | done — `src/actions.js` `canCancel` offers a `Cancel run` action only while the run is `executing`; the confirm dialog is the Android copy verbatim (title `Cancel run {id}?`, `This asks the server to stop the active run.`, confirm `Cancel run`, dismiss `Keep`), and the request is exactly `{type:'cancel_run',run_id}` followed by a silent `get_run` refresh (unit-tested in `test/repository.test.mjs`). Captured `captures/40-run-459-cancel-confirm.png` on the executing run present at capture time. **Shown, not executed**: the only candidate was another live pipeline's executing run, so the dialog was shown and dismissed with `Keep` — no `cancel_run` was sent (a real cancel is only safe against a run started in a scratch workspace, which this stage did not do) |
|
||
| R13 | Retry failed stage (resume) / restart from start | `retry_run` | done — `canRetry` is true only for a loaded, non-executing, `failed` run; the Retry confirm is the Android copy verbatim (title `Retry run {id}?`, `Only failed runs can be retried. The server starts a new run from the same input.`, confirm `Retry`, dismiss `Keep`) and the default send carries only `run_id` + a fresh `request_key` (**no** `retry_mode`, so the server's `resume` default applies exactly like the Android client's mode-less call; unit-tested). Captured `captures/35-run-440-run-actions.png` (failed run 440 offers Retry and no Cancel) and `captures/36-run-440-retry-confirm.png`. **Divergence from the Android UI, stated here**: Android exposes resume only while the protocol has both modes, so the browser adds a clearly-labelled secondary `Restart from start` confirm that states it `replays the whole pipeline from the start instead of resuming the failed stage` and sends `retry_mode:"restart"` (`captures/37-run-440-restart-confirm.png`). Both dialogs were shown and dismissed with `Keep`; no run was started |
|
||
| R14 | Rename a run | `set_run_title` | done — an inline field on the Summary title row (pre-filled with the current title, `Rename` / `Save` / `Cancel`) sending exactly `{type:'set_run_title',run_id,title}` and then refreshing the run and the runs-list row (unit-tested). Captured `captures/38-run-440-rename-field.png`. The one shared `Action failed` dialog was exercised by a real refused rename: `captures/39-run-440-action-failed.png` shows the live server's exact reason `a title with usable text is required` (a blank title mutates nothing). **Divergence from the Android UI, stated here**: Android does not surface `set_run_title` at all (its README records the deliberate omission), so this control is browser-only |
|
||
| R15 | Attention / "Needs you" surface: counts, open, individual dismiss, clear all | derived from `list_runs` + run events | done — the pure `src/attention.js` model mirrors `ui/Attention.kt` and feeds a bell action in the Runs list heading (badge only when non-empty; accessible name `Notifications` / `Notifications, {n} needing attention`) and a bottom sheet titled `Needs you` in `src/app.js`. Because the shell has no global top bar, the same count is mirrored as a badge on the Runs destination in the rail/dock, so an operator on Pipelines, Chat or Settings can still see that something needs attention without opening Runs; the bell itself stays the Runs-local entry point. Only a `waiting` run (kind Decision, rank 0) and a `failed` run (kind Failed, rank 1) qualify; order is kind rank, then recency descending (`finished_at` else `created_at`), then run id descending. Rows carry a status icon, the trimmed-title-else-pipeline label, the exact `{pipeline} · {detail}` line (`Waiting for your decision`, or the trimmed diagnostic else `Run failed`) and a trailing `Dismiss`; tapping a row opens the run, dismissing a Failed row first while a Decision row is left for its answer. Clear all acts only on the snapshot taken when the sheet opened; dismissals persist as one JSON array of `{runId}:{kind}` identities under `pipelines.web.attention.v1` with no expiry (blank/unreadable storage decodes to empty and never throws). Entries are derived from `list_runs` here; R10 will feed the same pure model the pushed `run_event` summaries, with no wording or ordering change. Captured 2026-10-19: `captures/35-attention-bell.png` (bell + badge on the Runs list), `captures/36-attention-sheet.png` (the open sheet), `captures/37-attention-dismissed.png` (one entry individually dismissed, badge 171→170), `captures/38-attention-cleared.png` (Clear all: the empty copy, no Clear all, badge gone). No run was parked in `waiting` on the live server at capture time, so the sheet is exercised with real failed runs and the decision-open path is unit-tested |
|
||
|
||
Two wording decisions in R3's stage pane, recorded here as the app-authoritative
|
||
choice: the visit's exported session is titled **Session** (the item text said
|
||
"Session export"; Android's `STAGE_SESSION_TITLE` is `Session`), and the step's
|
||
`session_id` renders as a **headline** row (Status, Outcome, Duration, Visit,
|
||
Model target, Target, Session), so it is not repeated in the "This run" evidence
|
||
section. R5's Graph tab now renders that same shared graph in run mode (see the
|
||
row above), reusing the visit pane this section describes.
|
||
|
||
One wording decision from R4, recorded here as the app-authoritative choice: the
|
||
Changes disclosure's title **is** `runChangesHeader`, so a run that recorded files
|
||
reads `{N} file(s) changed · ±stat · …` with no `Changes · ` prefix — only the
|
||
empty-capture variants carry the `Changes · ` prefix — while the expanded body's
|
||
own summary line repeats the count and stat. The header is rendered verbatim, not
|
||
re-composed.
|
||
|
||
R11–R14 share one `Action failed` dialog (title `Action failed`, the server's own
|
||
message, a single `OK`), matching `RunDetailScreen.kt`; every server string is set
|
||
with `textContent`, never `innerHTML`. Where a live action was unsafe this stage
|
||
says so rather than mutating shared state: the R12 cancel and the R13 retry/restart
|
||
sends were shown and dismissed with `Keep` (never executed); R11's live Confirm
|
||
**was** executed end to end against a run it started in its own throwaway
|
||
workspace (see the row above). The request shapes for all four are
|
||
unit-tested in `test/repository.test.mjs` and the model in `test/actions.test.mjs`;
|
||
`test/ui-smoke.mjs` captures the rendered dialogs, the rename field, the refused
|
||
rename's exact server reason and, under `--decide`, the full live decision flow.
|
||
|
||
## Search
|
||
| # | Feature | Protocol | Status |
|
||
| --- | --- | --- | --- |
|
||
| S1 | Omni-search across pipelines, versions, runs, steps, fields, artifacts | `search` | done — the shell's `Search` control (rail on wide, dock on narrow) opens a full-width panel in the workspace flow (field autofocused, placeholder `Search pipelines, runs and artifacts`, a `Close search` control; opening and closing leave the current view, selection and loaded data untouched, Escape closes the field and returns focus to the Search control). One flat result list with no kind grouping, over a controls row: the kind select (`All kinds`/`Pipelines`/`Runs`/`Steps`/`Fields`/`Artifacts`/`Versions`), the sort select (`Relevance`/`Newest first`/`Name`), the one-line `{Kind} · {Sort}` summary and a `Clear filter` reset. The request is exactly `{type:"search",search:{query,kind,limit:0}}` — the server's own default cap, never above `SearchMaxLimit` 200 — debounced 250 ms after the last keystroke with Enter sending at once; a blank query clears locally with no request; the previous results stay visible (a thin progress bar above them) while a newer query loads and a stale reply is dropped by token; the first load shows the spinner and `Searching…`; an error takes precedence over the results. Failure copy is `AppViewModel`'s: a rejection naming an unknown command, or an older server's reply without `search_results`, reads `This server does not support search. Update the Pipelines server, then try again.` and any other failure carries the server's own text. Row text and blank fallbacks mirror `OmniSearchResults.searchRow` (a field hit's snippet emphasises the first case-insensitive query occurrence, never via `innerHTML`) and the empty state keeps Android's `No matches for "{query}".` / `No {kind} match "{query}".`. Captured 2026-10-19: `captures/01-search-results.png` (flat mixed list for the query `plan`, the controls row and summary `All kinds · Relevance`), `captures/02-search-kind-filter.png` (the `Pipelines` filter narrowing the list and the summary to `Pipelines · Relevance`) |
|
||
| S2 | Result routing (open the pipeline, run, stage, artifact) | — | done — every selection closes and clears the search first, then routes through the page's existing navigation: a pipeline/version hit opens the pipeline detail at the result version (version 0 = latest); a run hit opens the run detail; a text hit opens the run-detail tab holding the match, resolved from the hit's `matched_field` (`input` → Input, `output` → Output, else Summary — the browser item's deliberate rule, not the recorded field name); a step or artifact hit opens the recorded visit's stage pane (the zero-based visit index within the stage, falling back to the plain run detail when the visit cannot be located); an unknown/absent payload is read-only and never navigates. Captured 2026-10-19, each with the routed destination asserted in the smoke run: `captures/03-search-route-pipeline.png` (`pipeline:24:v5` → `Plan and land` detail), `captures/04-search-route-run.png` (`run:457` → Runs detail), `captures/05-search-route-field.png` (`run:458:3`, `matched_field input` → the Input tab active), `captures/06-search-route-step.png` (`run:457:1` → the `planner` visit stage pane), `captures/07-search-route-artifact.png` (`/artifacts/355/2/…` → the `implementer` visit pane), `captures/08-search-route-version.png` (`pipeline:22:v6` → the `Server` detail) |
|
||
|
||
Two wording decisions in Search, recorded here as the app-authoritative choices:
|
||
the controls summary is exactly `{Kind} · {Sort}` (the browser item's wording, with
|
||
none of the Android panel's ` (in hand)` note), and the kind-filtered empty state
|
||
keeps Android's invariant `No {kind} match "{query}".` — the same sentence shape
|
||
the pipeline list already carries — rather than a pluralised verb.
|
||
|
||
## Chat
|
||
| # | Feature | Protocol | Status |
|
||
| --- | --- | --- | --- |
|
||
| C1 | Session list (operator sessions, closed grouped as history) | `chat_sessions` | done — captured 2026-10-19: `captures/44-chat-sessions.png` (the live server's one operator session: "New chat", the `Operator` kind chip, the meta line `Idle · /Users/alan/repos/pipelines` and a `Close chat…` row action) and `captures/50-chat-no-match.png` (the narrowed-to-nothing state `No chats match "zzz-no-such-chat".` with its `Clear search` action). A row is the title (`sessionTitle`: the server title, else the id's first 18 characters, else `Untitled chat`), the kind chip derived from the server tag (`operator` → `Operator`, any other tag verbatim, a blank tag no chip), a `Closed` chip only when closed, the activity badge word (`Streaming` / `New` / `Open`, `Open` only while its conversation is open), and meta = work label · directory · model with blanks omitted (`Running` / `Running {tool}` / `Running {N} tools` while a turn is in flight, else `Busy · read-only`, else `Idle`). Active sessions are grouped by directory only when there is more than one group (header = the directory or `No directory`); closed sessions sit below under a `Closed` header, each reopenable. The search field is labelled `Search chats` and narrows by title or directory, case-insensitively, never re-sorting; the empties are `Loading chats…`, `No chat sessions on this server yet.` with a `New chat` action (C2) and `No chats match "{query}".` with `Clear search`. The `Loading chats…` and `No chat sessions on this server yet.`/`New chat` states are implemented but not captured: the live server always lists its one operator session, so neither state is reachable against it |
|
||
| C2 | Create a chat (directory picker) | `chat_directories`, `chat_create` | done — captured 2026-10-19: `captures/75-chat-create-picker.png` (the list's `New chat` action opens `Start a chat`; back `Cancel new chat`, prompt `Where should this chat live?`, home `Home (~)` first and selected with `/Users/alan` beneath it, two recents labelled by their full paths, the model note, and the footer `Start in ~` / `Cancel` / `New chat`), `captures/76-chat-created-list.png` (the one real session `ses_eabc47a91ffe31C6zNX4ieXN6e`, titled `New chat`, created with exactly `{title:"New chat",directory:"~",operation_id:"…"}`, at the head of the list and active with its empty history) and `captures/77-chat-created-closed.png` (the same session closed through the `Close chat…` → `chat_close` confirm, now carrying the `Closed` chip as history). Blank directory entries are dropped, an empty reply still yields home, `~` is sent for home and the absolute path for a recent, and the create is guarded against double submission; a refusal stays in the open pane with the server's own text. The operator's own `ses_eae413f50ffeLQDExlg8cYnscN` was not selected, closed, reopened or prompted by this item. The smoke created exactly one real session and closed it; nothing was deleted |
|
||
| C3 | Open / close / reopen a session | `chat_close`, `chat_reopen` | done — captured 2026-10-19: `captures/49-chat-close-confirm.png`. Selecting a row opens the conversation (see C4); an open row offers `Close chat…` and a closed row offers `Reopen`. The confirm is the Android copy verbatim: title `Close chat?`, the body naming the session title (`Closes "{title}" and marks it closed on every device. A turn that is running is stopped first. Nothing is deleted — the chat and its history are kept, and you can reopen it from the list.`), confirm `Close chat`, dismiss `Cancel`; only the confirm sends `chat_close` (and `Reopen` sends `chat_reopen`), then the list is refreshed from the server. The `Close chat…` action is offered on every open row, so its confirm is rendered from the pane's overlays **whether or not a conversation is open** — the smoke exercises the row-level path with no session selected (`ui-smoke` asserts the confirm appears and dismisses it), not only the path after opening the row. **Shown, not executed**: the live server has exactly one session — `ses_eae413f50ffeLQDExlg8cYnscN`, the operator's own — so the dialog was shown, captured and dismissed with `Cancel`; **no `chat_close` was sent** and that session was not closed or reopened by this stage |
|
||
| C4 | History with paging / "load older" | `chat_messages` | done — captured 2026-10-19: `captures/45-chat-transcript-newest.png` (the opened `ses_eae413f50ffeLQDExlg8cYnscN` transcript with the `Load older messages` control beside the conversation's identity while the server reports `has_more`) and `captures/48-chat-load-older-empty.png` (after pressing it: the live session's own opaque cursor returned an empty older page, so `has_more` went false and the control disappeared — the honest result of the server's cursor, distinct from 45). The request is exactly `{type:"chat_messages",chat_query:{session_id,limit:200,cursor}}`; the newest page is read with an empty cursor and an older page with the server's own opaque `next_cursor` passed back verbatim (never interpreted), and the reply is `chat_history.{messages,next_cursor,has_more}` with an older server's bare `chat_messages` falling back to `hasMore:false`. `mergeHistoryPage` prepends an older page, dedupes by id (order-preserving, the page's copy winning) and replaces `nextCursor`/`hasMore`; the prepend itself is unit-tested (`test/chat.test.mjs`) because the live server returned no older rows. Nothing auto-loads on scroll and there is no end-of-history row |
|
||
| C5 | Live transcript: user/assistant text, one reply = one turn | `chat_subscribe`, `chat_event` | done — captured 2026-10-19: `captures/56-chat-live-turn.png` (the answer text growing inside the existing single agent bubble while the reasoning step count grows), `captures/57-chat-running.png` (the running indicator: spinner + `Running a tool…` + `· 1s` + the `shell npm run build` line), `captures/58-chat-long-call.png` (a 61 s-old call tinted ` · long`), `captures/59-chat-settled.png` (the tools completed and the step ended: no indicator, the same one agent bubble). Opening a conversation attaches its shared live stream with exactly `{type:'chat_subscribe',chat_subscribe:{session_id}}` (the `chat_subscribe` field, **not** `chat_query`; internal/protocol/message.go, chat_stream.go) and folds every pushed `chat_event` into the open thread; the session is never read-only and any number of clients may watch it. `client.js` surfaces an envelope with no matching pending id as a DOM-free `frame` event (a matched reply is still resolved by id and not broadcast) and `src/app.js` folds only `chat_event` frames for a session this client has open. There is **no** `chat_unsubscribe` on the wire: the server detaches a subscription when the connection closes (chat_hub.detachClient / websocket.go), so on a socket drop the page clears its subscription set and settles every running thread, and on reconnect re-subscribes the open chat and replaces its conversation with the newest history page wholesale (`historyResync`, no stale held turn) — captured by the smoke's own reconnect. The pure fold lives in `src/chat.js` (`applyChatEvent` and helpers) and is unit-tested: a `user` frame needs a non-blank message id and text, is ignored when the id already exists and keeps the sender's `client` label (the server never echoes this client's own prompt); `text`/`reasoning` deltas append to the part their kind started (`deltaPartId`, so the two kinds can never share a part) and a live turn that spans several assistant message ids stays one `transcriptRows` agent bubble; `tool` frames merge field by field (a non-empty incoming field wins, `state.status/input/content/metadata/error` each retained when omitted, `executed` sticky, `time` retained), so a later frame never blanks what an earlier one taught; `step` runs the turn unless the status is `ended`; a `shell` frame is C11's and never marks the turn running; `usage` is not folded; any frame clears `queued`. The live badge uses the same words as the run badge — `live` while subscribed on a connected socket, `reconnecting` while the socket is coming back, `not live` when idle/refused (`chatStreamState`, unit-tested; the smoke logs all three). The running indicator (under the transcript, after the last agent turn) is a spinner plus the phase headline (`Thinking…` / `Running a tool…` / `Waiting…`) and ` · {elapsed}`, then one line per running tool with its own elapsed; a call at or past 60 s is tinted and marked ` · long`. **Replayed vs real, stated plainly**: the live server had no turn to prompt (its only session is the operator's, and this stage does not write to it), so `ui-smoke.mjs` subscribes through the real server and every history reply is real, then replays exact `chat_event` frames through the socket's own `onmessage` (a WebSocket recorder shim installed before the page's scripts via `Page.addScriptToEvaluateOnNewDocument`); the smoke log names the replayed frames and asserts the subscribe ack and history came from the real server |
|
||
| C6 | Reasoning block + tool calls with name/input for the whole lifecycle | `chat_event` | done — the assistant turn draws, in order, its one collapsible reasoning block and its one tool-call chip (then the answer). Reasoning labels match the app: `Thinking…` / `Reasoning` for a single step and `Thinking · {N} steps` / `Reasoning · {N} steps` for several, with ` · {duration}` appended when the parts' timing gives a settled span (earliest start → latest completed), through chevrons named `Show reasoning` / `Hide reasoning`. The chip reads `1 tool called` / `{N} tools called`, announces `… expand for details`, wears the shared spinner while a call is in flight and an error tint once one failed, and opens a fixed overlay panel under the chip (flipped above / clamped into the viewport when there is no room) with the same count, a `Close tool calls` control and an internally scrolling, independently-expandable row per call: the name (else `tool`), the first of `description`/`command`/`filePath`/`file_path`/`path`/`pattern`/`query`/`url` collapsed and elided to 72 characters, the `+N -M` edit stat when present, the `formatToolDuration` value (`340ms`/`1.2s`/`2m 3s`), and `Expand {name}`/`Collapse {name}`; a failed row is marked `Failed tool call`. An expanded row shows INPUT (pretty-printed JSON, or the raw partial string), the LCS edit diff (at most 200 rendered lines with the remaining `… {N} more changed line(s) not shown`), then ERROR (the server's `error.message`, else the output) or OUTPUT (`(no output)` when settled and empty, nothing while in flight). Lifecycle words `streaming`/`running` are in flight and `completed`/`error` settled; a settled call never spins or wears the ` · long` mark. Because the panel is a fixed overlay, opening or closing it never re-flows the transcript nor moves its scroll (C14). Captured 2026-10-19 against `ses_eae413f50ffeLQDExlg8cYnscN` (one folded turn, 80 reasoning steps, 122 tool calls): `captures/51-chat-reasoning-collapsed.png`, `captures/52-chat-reasoning-expanded.png`, `captures/53-chat-tool-chip.png`, `captures/54-chat-tool-panel.png` (an opened `read` row showing INPUT + OUTPUT) and `captures/55-chat-edit-diff-sample.png`. The live history carries no failed or edit-family call, so that capture renders a labelled page-rendered sample — a `shell` row marked `Failed tool call` with INPUT + ERROR and an `edit` row with a `+2 -1` diff — through the page's own row builder; the transcript stayed put across open/close (top 43065 → 43065). **Live arrival over `chat_event` is C5**: the renderer is built from the same part shapes (`ChatPart{type,name,state{status,input,content,error},time}`) and takes a `streaming` flag plus a live elapsed source so C5 can drive in-flight calls; the chip's in-flight spinner, the ` · long` 60s mark, the panel flip-above and an edit-family call are not reachable against the live server, so they are unit-tested (`test/chat.test.mjs`) rather than claimed as captured |
|
||
| C7 | Markdown rendering + code blocks | — | done — captured 2026-10-19: `captures/45-chat-transcript-newest.png` (opened at the newest content: bold, bullet lists, a `|` table with its `---` delimiter row and inline code spans from the live assistant answer), `captures/47b-chat-markdown-code.png` (a rendered fenced code block — label `js`, the pre body `const answer = 42;` — drawn in the live browser by the page's own `renderMarkdown`, the same function that renders the answer) and `captures/47-chat-reasoning-code.png`. The subset is exactly `Markdown.kt`: paragraphs, `#`–`######` headings, fenced code (```/~~~, the language label else `code`), block quotes, bullet/ordered lists, `|` tables with a `---` delimiter row, thematic rules, inline code, bold, italic (underscore only at word boundaries, so `snake_case` stays plain), `[label](url)` links and bare http(s) autolinks; HTML entities are decoded first in one pass, and HTML, reference links, strikethrough and nested lists render as plain text and are never dropped. **Code-block caveat, stated plainly**: the live assistant answer carries **no** fenced block — its four fences live in the reasoning transcript, which the app draws as plain text, not as markdown (`captures/47-chat-reasoning-code.png` shows one such fence as muted plain text; that is C6 material, not the markdown path). So the rendered `<pre>` code block is captured from a labelled sample through the page's real renderer (`47b`), and the same path plus its `code`-else-language label is unit-tested in `test/markdown.test.mjs`. Only `http(s)` link targets become clickable — the transcript is untrusted model output, so a `javascript:`/`data:` target renders as its label, never as a live link |
|
||
| C8 | Composer: send, stop, attachments, draft | `chat_prompt`, `chat_interrupt` | done — the composer at the foot of an open conversation: a growing 1–6-row `<textarea>` (placeholder `Message the agent… or / for commands`) where Enter submits and Shift+Enter inserts a newline (the submit routing is the pure `composerSubmit`), an `Attach file` control opening a multi-file picker, a removable chip per attachment (an image thumbnail else a file glyph, the display name, then the error text or `humanBytes(size)`, and a remove control named `Remove {name}`), and one primary control: Stop (`aria-label`/title `Stop`, error tint) while a turn runs, else Send (`aria-label` `Send`, disabled unless a non-blank draft with no failed attachment — or a slash draft). The 25 MiB guard reads `"{display}" is too large (25.0 MiB limit).` and an unreadable file `"{display}" could not be read.`; the web file picker cannot produce an unreadable file, so only the limit branch is captured and both are unit-tested (`test/chat.test.mjs`). Send trims the draft, clears the draft and the attachments at once, calls `chatPrompt` with `{session_id,text,operation_id,native_message_id}` (+ `files` only when present) and reads the reply's `chat_queued` into the notice `Queued — it will send when the current turn finishes.`; a rejected prompt restores the draft and the attachments (each flagged with the server's own message) and shows the shared `Action failed` dialog. The queued flag clears on any incoming frame (the client fans unsolicited envelopes out as a `frame` event; the composer folds it). The draft is kept per chat in memory **and** mirrored into `localStorage` (`pipelines.web.chatDraft.v1`) — the web analogue of per-device persistence — while attachments stay memory-only. Captured 2026-10-19 against a **freshly created** session (never the operator's own): `captures/56-chat-composer-draft.png`, `captures/60-chat-attachment-chips.png`, `captures/61-chat-attachment-removed.png`, `captures/63-chat-composer-stop.png` (a real prompt to the throwaway session turned Send into Stop), `captures/63b-chat-stop-interrupt.png` (the Stop control was **clicked**: it sent `chat_interrupt` and the page showed `Stopping the running turn…`, with no `Action failed` — the control is wired to `chat_interrupt`, never to the inert submit path) and `captures/64-chat-throwaway-closed.png` (after `/close`, the closed row plus the conversation pane left for the list). The throwaway session was created with `chat_create`, really prompted, really interrupted and closed with `chat_close`; the operator's session `ses_eae413f50ffeLQDExlg8cYnscN` was never prompted |
|
||
| C9 | Slash commands | client-side | done — the palette appears above the composer only while the trimmed draft starts with `/` and has no whitespace, filtered case-insensitively by name prefix, each row showing `/name` and the summary and the highlighted row marked `aria-selected`; Up/Down move the highlight and Enter runs it, a tap runs a row directly, and running a command always consumes the draft and never reaches the prompt path. The five commands and their summaries are `CHAT_COMMANDS` (`/new`, `/close`, `/rename <title>`, `/stop`, `/help`), unit-tested verbatim, with `chatCommandHelp()` the `usage — summary` lines. Effects: `/new` sends `chat_create` directly (one step, separate from C2's picker) and opens the created session, `/close` reuses the C3 `Close chat?` confirm, `/rename` writes through C13's durable device-local store (the same one the row's `Rename…` dialog uses), `/stop` interrupts (`chat_interrupt`) and `/help` shows the command list. Error wording is the Android source verbatim: the unknown command reads `“{token}” is not a command, so nothing was sent to the agent. Send it as a message, or cancel.` with the draft offered back and `Send as message` / `Cancel`; an extra argument on an argument-less command reads `{usage} does not take an argument.`; `/rename` with no title reads `Usage: /rename <title> — renames this session on this device.`; `/stop` with nothing running reads `No turn is running in this chat.`. A notice renders as a full-width line after the turns (not a bubble) with the label `Command` / `Command failed` and a terminal glyph, error-coloured when failed. Captured 2026-10-19: `captures/57-chat-command-palette.png`, `captures/58-chat-command-palette-selected.png` (ArrowDown moved the highlight), `captures/59-chat-command-unknown.png` (the failed notice and its offer, dismissed with Cancel), `captures/62-chat-new-session.png` (`/new`'s created session and its `Command` notice) |
|
||
| C10 | Permission/approval cards (allow once/always/reject) | `chat_permission`, `chat_reply` | done — captured 2026-10-19: `captures/65-chat-approval-pending.png` (the pending card as the transcript's last item: the amber outlined shield + `Approve bash`, `Waiting for your response`, the request's six monospace resource lines, the amber `RISK REVIEW` panel, the `Allow once` / `Always allow` / `Reject` controls, and the chat pane's `Waiting for your approval` control, with `#chatRunning` stood down), `captures/66-chat-approval-answered.png` (`Allowed once` / `Waiting for the agent to continue…`, controls and the jump control gone), `captures/67-chat-approval-resolved.png` (a server resolution: `Always allowed` with its note `Another client already allowed this.`, no controls, no risk panel) and `captures/68-chat-approval-rejected.png` (a blank-action request answered `Reject`: `Rejected` / `Waiting for the agent to continue…`, the risk panel kept with the fallback sentence, no controls). The pure model is `src/chat.js` (`approvalCard`/`applyChatPermission`/`permissionRiskText`/`decisionLabel`): while pending `Approve {action}` (blank action → `Approve tool call`), after answering the decision label (`Allowed once` / `Always allowed` / `Rejected`, an unknown decision → `Resolved`) and `Waiting for the agent to continue…`, and once the server reports `resolved`/a decision that label (else `Already resolved`) with its `message` as the status (else `Another client already answered this request.`); the amber `RISK REVIEW` box shows only while pending or after a reject. Resources drop blanks and cap at six visible lines: `approvalResourceText` caps the joined text at six lines with an ellipsis on the last kept line, and the rendered text is a padding-free `-webkit-line-clamp: 6` block inside a padded frame, so a long resource that wraps is elided at the content edge and no seventh line paints into the frame's padding — matching Android's `maxLines = 6, Ellipsis` (the smoke asserts six clipped lines, a hidden overflow and the block ending at the frame's content edge, with seven lines unclamped). `Allow once` is rendered as the browser's filled primary control, matching the app's filled `Button` versus its two `TextButton`s; the head and risk-panel shields are inline SVG stroked with `currentColor` so the warn hue actually tints them (a colour emoji cannot be tinted). A server resolution always outranks a local answer, a new request replaces the settled card and clears the answer, and the same request keeps it. `PipelinesRepository.chatReply` sends exactly `{type:'chat_reply',chat_reply:{session_id,request_id,decision,client}}` (`message` only when non-blank) and refuses blank ids or a decision outside once/always/reject; answering settles the card optimistically, and a refused send reopens the same request and reports the server's reason on the thread's error line (ignored if a different request has replaced the card), so an unaccepted decision is never shown as accepted. The card is fed by `chat_permission` frames through `client.js`'s unsolicited-frame path, folded only for sessions this client has open. **Replayed, not real**: no live pending approval was available, so the captures were driven by synthetic `chat_permission` frames replayed through the page's own socket handler against the live session; the page's real `chat_reply` path was exercised but the smoke's shim suppressed every reply for the synthetic request ids (suppressed 3, one of them answered with a server error to prove the reopen path, forwarded 0), so **no approval decision was sent to the operator's server**. Unit-tested in `test/chat.test.mjs` and the reply shape in `test/repository.test.mjs`; the DOM assertions and log lines are produced by `test/ui-smoke.mjs` |
|
||
| C11 | Background tasks bar: running shells only, capped + scrollable, bounded output page | `chat_shells`, `chat_shell_output` | done — captured 2026-10-19 into a live session: `captures/65-chat-background-tasks.png` (the bar with five running tasks — heading `Background tasks`, count `5 running`, three visible rows and a scrolling list), `captures/66-chat-background-task-detail.png` (a selected task's detail: `Command` + the command, `Task identity` + the id in monospace, `Status: running`, then `Output` + the monospace text and `Refresh`), `captures/67-chat-background-task-empty.png` (`No output yet.`), `captures/68-chat-background-task-unavailable.png` (`Output unavailable for this task.`), `captures/69-chat-background-task-truncated.png` (`Output is bounded to 64 KiB.` plus `Refresh`), `captures/70-chat-background-task-loading.png` (the spinner while the page loads) and `captures/71-chat-background-tasks-exited.png` (the bar gone after the last exit). The bar is shown only while at least one shell is running and disappears with the last exit; only running shells are listed (an exited shell is never a task). Its visible rows are capped at 3 (`BACKGROUND_TASK_VISIBLE_ROWS`) and the list scrolls beyond that instead of growing; each row is a play glyph + `Running` + `shellCommandSummary(command)` (trimmed, whitespace-collapsed, elided past 72; blank → `background process`) + `Details` only while selected, and tapping a row toggles its detail pane. Refresh always rereads the page from cursor 0 with `limit` 65536 (`SHELL_OUTPUT_LIMIT`, the server's 64 KiB bound) and never appends, so the client's output cannot grow unbounded — the smoke's own Refresh click issues exactly such a second read and the smoke asserts its `{cursor:0,limit:65536}` bounds. `chat_shells` is fetched when the conversation opens (`chat_query` body `{session_id}`) and again on every stream reconnect, and `chat_shell_output` sends `chat_shell_output_query` (`{session_id,shell_id,cursor,limit}`); both the request shapes and the pure model (`runningBackgroundShells`, `shellCommandSummary`, `mergeShellFrame`, `shellsLoaded`, `shellOutputState`, every wording constant) are unit-tested (`test/chat.test.mjs`, `test/repository.test.mjs`). A `shell` frame folds its shell into the retained set, merges a blank command from the previous frame, and never marks the thread running — a background process outlives the turn (a step ending does not clear it; only the reconnect drops and re-learns it). Every server string is set with `textContent`; shell output is never parsed as markup. **Replayed vs real, stated plainly**: only the `shell` frames (injected synthetic `chat_event` frames) and the `chat_shell_output` pages (answered by a socket reply hook) are synthetic, because the live server had no running shell to read safely; the `chat_shells` list, the `chat_subscribe` ack and every `chat_history` reply came from the real server, and the smoke asserts the real `chat_shells` fetch on open and after a reconnect. The one drop that hit a bounded read mid-section was recovered by the smoke's own bounded retry through the page's controls |
|
||
| C12 | Human-decision notices inside chat + dismiss | `chat_event` | done — the local command-notice surface is captured and dismissible per notice. Captured 2026-10-19: `captures/72-chat-command-notice.png` (a full-width `Command` line after the turns, never a message bubble: the shared terminal glyph `>_`, the `/help` command list and its own `Dismiss`), `captures/73-chat-command-failed-offer.png` (an unknown command: `Command failed` in the error tint, the exact Android sentence and the `Send as message` / `Cancel` pair) and `captures/74-chat-command-dismissed.png` (the `/help` notice dismissed; the failed offer line and its controls remain — exactly one notice removed). A notice is a local `ChatCommandNotice`, never a `ChatMessage`: it lives in that conversation's `state.chatThreads` entry, survives switching away and back while the page is open, and never enters the prompt path — the smoke's recorded sends show **no** `chat_prompt` for `/help` or an unknown command. `Send as message` takes the offered draft through the ordinary `postChatPrompt` path, removing the notice **before** sending, so a stale second tap sends nothing (the smoke verifies both on a throwaway session). The pure model lives in `src/chat.js` (`makeChatNotice`, `appendChatNotice`, `dismissChatNotice`, `takeChatNoticeOffer`, `chatNoticeLabel`) and is unit-tested (`test/chat.test.mjs`): append, dismiss one, take the offer, a stale/offerless offer returning null and leaving the list untouched, per-conversation scoping, and the failed label/tint flag. **Wire finding, not an invented source**: `chat_event` kinds are exactly `user`, `text`, `reasoning`, `tool`, `shell`, `step` and `usage` (`internal/protocol/chat.go` `ChatEvent*`), and `chat_permission` is the only approval frame — there is **no** in-chat run-decision notice on the wire. Run-level human decisions live on R11's run-detail decision sheet (`decide_run`) and C10's approval cards (`chat_permission` / `chat_reply`), exactly as the app does it. **Stated browser divergence**: Android's `ChatCommandNoticeItem` shows actions only when `offer != null`, so it cannot dismiss a `/help` or `/new` line; the browser adds a `Dismiss` control (accessible name `Dismiss command notice`) on offerless notices to meet "each is individually dismissible", keeping the app's `Send as message` / `Cancel` pair verbatim on offer notices. |
|
||
| C13 | Local rename/hide, seen state, persistence to `localStorage` | client-side | done — the row's `.chat-menu-button` (`Chat actions`) opens, in Android's order, `Rename…`, `Close chat…` (open rows) or `Reopen` (closed rows) and `Hide on this device`; the list is unclipped only while the menu is open (`.chat-list.menu-open`, mirroring `.list.runs`) so the panel is never cut off at the list's bottom edge, and the smoke hit-tests the last row's `Hide on this device` at its own centre. **Rename (device-local)**: the dialog is titled `Rename chat`, has a field labelled `Name` pre-filled with the current effective title, the helper `The server has no rename for a chat, so this name is kept on this device.`, and `Save` (disabled while the trimmed value is blank) / `Cancel`; backdrop and Escape close it, typing toggles Save in place without re-rendering the transcript, and saving sends nothing. A local title is trimmed and wins over the server's on every later list refresh. **Hide (device-local, distinct from the server close)**: the row disappears here, the open conversation closes (its thread dropped, `chatActiveId` cleared, its subscription forgotten) and one snackbar reads `Hidden on this device; the chat stays on the server.` with `Undo`; a newer hide replaces the in-flight report rather than queueing, and `Undo` restores the row and clears the hidden list — nothing on the server is touched. **Seen markers**: the row's dot+word badge is `Streaming` / `New` / `Open`, precedence exactly Streaming > New > Open, with `Open` only while that conversation is open (never colour alone; word is always rendered). A session is new only when it is not the active one and either it is in the explicit unseen set (a pushed `chat_event` for a backgrounded chat) or it has never been opened here and its `updated_at` is strictly greater than the stored watermark; the first sight of a session is seeded as a baseline only when its watermark is 0 and `updated_at > 0`, so pre-existing chats are never all "new", and opening a conversation advances the watermark (monotonically — a stale read cannot rewind) and clears its mark. **Persistence** is the web analogue of the app's SharedPreferences, one JSON value per key, both decoding blank/corrupt/wrong-typed input to their empty model: `pipelines.web.chatOverrides.v1` = `{"titles":{"<id>":"<title>"},"hidden":["<id>"]}` and `pipelines.web.chatSeen.v1` = `{"seenAt":{"<id>":<updated_at ms>},"unseen":["<id>"]}` (Android field names `titles`/`hidden` and `seenAt`/`unseen`). The pure model lives in `src/chat.js` (`renameChatOverride`/`hideChatOverride`/`restoreChatOverride`/`applyChatOverrides`, `chatSeenWatermark`/`seedChatSeen`/`readChatSeen`/`markChatUnseen`/`isChatSessionUnseen`, the tolerant `decode`/`encode`) and is unit-tested in `test/chat.test.mjs`. C9's `/rename <title>` now writes through the same durable store. Captured 2026-10-19, all live (no synthesised frames): `captures/72-chat-rename-dialog.png` (the dialog, blank field, Save disabled), `captures/73-chat-renamed-row.png` (a closed row showing its local title `Local capture chat` after a server list refresh), `captures/74-chat-hide-snackbar.png` (the hidden open conversation closed, one snackbar with `Undo`) and `captures/75-chat-new-marker.png` (the non-active prompt-and-stopped throwaway, reloaded and reconnected, carrying the coloured dot + `New`). The New marker is **not** synthesised: the smoke `/new`s a throwaway, sends a real prompt, clicks `Stop`, reloads the page and reconnects, then asserts the row's `.chat-activity-new` word `New` while the persisted watermark predates the turn |
|
||
| C14 | Scroll behaviour: follow newest, "jump to newest", restored position | client-side | done — captured 2026-10-19: `captures/45-chat-transcript-newest.png` (the conversation opens at its newest content instantly — the only live session has no saved position, so it lands at the end rather than at the top of a turn taller than the viewport) and `captures/46-chat-transcript-top.png` (after a **real wheel gesture** on the transcript — the app's own listener, not a programmatic scroll, which by the implementation's own rule cannot change intent — `Jump to latest` is offered; the smoke asserts the control and performs the gesture, `ui-smoke` log line "after a real wheel gesture (scrollTop 0) 'Jump to latest' is offered at the top"). A thread with a saved position is restored to it (a saved top, index 0, is a real position and is never treated as "new"); while within the 32 px bottom threshold the view follows, and only the operator's own wheel/drag changes that intent (a programmatic placement or follow cannot); `Jump to latest` is offered only when not following and something is below the fold; the position is saved per session in `localStorage` (`pipelines.web.chatScroll.v1`). A re-render (opening/dismissing a dialog, a refresh, or the loading frame of a paging fetch) captures the live position first and puts the operator back exactly where they were — the smoke asserts the transcript stays put across the `Close chat?` dialog (`ui-smoke` log line "the transcript stayed put across the dialog (top 7141 -> 7141)"); the paging anchor is held until the frame that actually carries the older page, so a real prepend stays on the previously visible message. No auto-load on scroll. The pure decisions are unit-tested (`chatBottomDistancePx`, `chatFollowsAt`, `chatShowJumpToLatest`, `chatOpensAtNewest`, `chatFirstScroll`) in `test/chat.test.mjs`, and the live measurement uses `chatBottomDistancePx` itself |
|
||
|
||
Three decisions in Chat, recorded here as the browser client's own choices where
|
||
the app has no exact counterpart. The list's `New chat` action — in the toolbar
|
||
and in the empty state — opens C2's create pane (`Start a chat`), which owns the
|
||
detail slot while it is open and leaves the list visible beside it. The
|
||
conversation pane outside a selection reads
|
||
`Select a chat to open it.`: the browser always shows a two-pane split (the app's
|
||
narrow layout covers the list instead), so this stands in for `PaneIdentity`'s
|
||
covered-pane title rather than a second feature. And the markdown renderer only
|
||
makes `http(s)` targets clickable, because a transcript is untrusted model
|
||
output: a `javascript:`/`data:` target renders as its label, never dropped and
|
||
never a live link. The transcript, the session rows and every server string are
|
||
built from DOM nodes and set with `textContent`, never `innerHTML`.
|
||
|
||
Four decisions in the composer (C8/C9), recorded here as the browser client's own
|
||
choices and dependencies. **Attachments are not delivered to the agent yet**: the
|
||
server's prompt path (`internal/server/chat_stream.go`) consumes only `text`
|
||
today, so the browser collects, validates and blocks on a failed attachment and
|
||
then sends it best-effort as the file's own reference string, but the file is not
|
||
yet forwarded to OpenCode. **`/new` sends `chat_create` directly** as a one-step
|
||
create in the current directory (C2's pane is the directory chooser); it creates
|
||
a session titled `New chat` and opens it. **`/rename` writes through C13's durable,
|
||
per-device store** (the browser item mirrors C13's dependency rather than
|
||
inventing a server rename), so a `/rename`d chat keeps its local title across a
|
||
refresh and shows the same `Renamed this session to “{title}” on this device
|
||
only; the server's title is unchanged.` notice. And the **draft is held per chat
|
||
in memory and mirrored into
|
||
`localStorage`** (`pipelines.web.chatDraft.v1`), the web analogue of per-device
|
||
persistence, while attachments are memory-only because a `File` handle cannot be
|
||
serialised. The composer's Stop control appears the moment a prompt is accepted
|
||
(optimistically, as the app does) and is released when a `chat_event` `step`
|
||
frame reports the turn `ended`; clicking it calls `stopChatTurn` (`chat_interrupt`,
|
||
as Android's `onStop` does) rather than the submit path, and the smoke clicks it on
|
||
the throwaway turn. Accepting `/close` finishes the session locally too: the
|
||
running/queued bits clear and the conversation leaves the pane for the list
|
||
(mirrors Android's `finishSession`); the rest of the live-transcript fold is C5's
|
||
item. The UI smoke creates one throwaway session per run (via `/new`, marked ephemeral
|
||
so it never enters the operator registry), really prompts and really interrupts
|
||
it, then closes it again. C2's step separately creates one **real** session,
|
||
captures it and closes it with `chat_close`; the server keeps a closed chat as
|
||
history, so that row stays as closed history (there is no delete command). The
|
||
page keeps its own ephemeral throwaway row in memory so the check can switch back
|
||
to it, but the server never lists it and a reload drops it.
|
||
|
||
## Settings, layout, platform
|
||
| # | Feature | Protocol | Status |
|
||
| --- | --- | --- | --- |
|
||
| L1 | Settings: server URL, workspace | — | done — a `Settings` destination in the existing navigation, matching `SettingsScreen.kt`'s three sections in one pane. **Connection**: a `Server URL` field (placeholder `ws://192.168.1.20:8081/connect`, helper `ws:// on a trusted LAN/VPN, or wss:// through a proxy/VPN. No authentication is used.`); the emphasised primary action with its secondary beside it (`Disconnect`/`Connect` while connected or connecting, otherwise `Connect`/`Reconnect`), all driving the page's existing single client so there is no second socket or path: `Disconnect` calls `repo.disconnect()`, `Reconnect` calls the shared `onReconnectClicked` (`openConfiguredEndpoint` → `repo.connect`) and `Connect` calls the connect-only `openConfiguredEndpoint` directly — never a toggle, which would close a live socket while its label reads `Connect` (Android's `AppViewModel.connect()` is connect-only). Pressing `Connect` re-opens the shared client exactly as `PipelinesClient.connectLocked` does: `client.js` now replaces the current socket, fails a request already sent on it (`Connection replaced`) and ignores the superseded socket's late callbacks, so no second socket is left live and a late close cannot mark the new one disconnected. The smoke presses the secondary `Connect` while connected and asserts the shell status goes `connecting` → `connected` and never `idle`; `test/client.test.mjs` covers the replacement (old socket closed as `superseded`, its request failed `Connection replaced`, its late close ignored). The status card `Not connected` / `Connecting (attempt N)…` (with the app's spinner, SettingsScreen.kt's `CircularProgressIndicator`) / `Connected` + `Server build <version> (<commit>)` + `Server time <t>` from the real `pong` / `Disconnected` + the message + `Retrying with backoff…` while retrying. A `Trusted LAN/VPN only` warning card carries the app's body text verbatim. The `Server URL` field's own validation error (Android's `urlError`) is rendered as its supporting text with `aria-invalid`/`aria-describedby` and is cleared on the next edit — never left as a stale page-level banner — and this is now the only server-URL field in the app. **Workspace**: a `Workspace path (on the server)` field (placeholder `/Users/you/repos/pipelines` and the Android helper), `Save workspace` enabled only for a trimmed absolute path (deliberately stricter than Android, which also enables Save on a blank field), the `Saved workspace: {path|(none)}` line, and an error-tinted helper with `aria-invalid`/`aria-describedby` for a relative path (Android's `isError`). **Templates**: one `Browse templates` card with the row's leading glyph and forward chevron and the secondary `Reusable pipeline definitions offered by the server.` that opens the existing Templates gallery. **Persistence**: the browser analogue of `SettingsRepository` — the server URL under **`pipelines.web.serverUrl.v2`** (the key `openConfiguredEndpoint` already wrote) and the workspace under **`pipelines.web.workspace.v1`**, trimmed on save; nothing else is written and no credential ever is. Every server-derived string is set with `textContent`. The saved workspace is not yet consumed by a run/chat create (not required by this item). **Connection now lives only here**: L2–L4 removed the header URL field, Connect/Disconnect button, state badge, top connection banner and the top trust strip, leaving the shell's dot+word status shortcut. Captured 2026-10-19 against the live server at `ws://127.0.0.1:8080/connect` (via the page's own proxy, `ws://127.0.0.1:8091/connect`), all four status-card states rendered and asserted live: `captures/L1-settings-connection.png` (the connected card — `Connected` + `Server build v0.0.0-…` + `Server time …`; the smoke asserts the build and time lines, not just the screenshot), `captures/L1-settings-idle.png` (`Not connected`, `Connect` emphasised, `Reconnect` secondary), `captures/L1-settings-disconnected.png` (`Disconnected` + the live message `Connection closed (1006)` + `Retrying with backoff…`; the smoke asserts all three lines) and `captures/L1-settings-connecting.png` (`Connecting (attempt 1)…` against a non-routable endpoint, so the attempt number is asserted). Workspace and Templates: `captures/L1-settings-workspace.png` (the saved path, `Saved workspace: /Users/alan/repos/pipelines`, Save enabled) and `captures/L1-settings-templates.png` (taken after pressing the card, showing the existing Templates gallery it opens, so it is independent evidence rather than a duplicate of the Workspace frame; the smoke also asserts the card's label and secondary line before pressing it). The two field-error states are captured too: `captures/L1-settings-url-error.png` (an invalid Connect shows `That is not a valid URL.` under the field, error-tinted, `aria-invalid`) and `captures/L1-settings-workspace-error.png` (`The workspace must be an absolute path that exists on the execution server.` under the workspace field, error-tinted). The pure logic and copy live in `src/settings.js`, unit-tested in `test/settings.test.mjs` (21 tests: validation, Save validity, the four status-card states, the shared connecting line, the actions, both keys' round-trip, and the Android-source wording), so the unit suite goes from 440 declared tests at HEAD to 462 (+21 in the new file and +1 client socket-replacement test). The `ui-smoke.mjs` chat steps now open whichever live session actually carries a transcript, so a changed live session set cannot block the L1 captures |
|
||
| L2 | Wide layout: left rail + two panes | client-side | done — the shell is a 200px left destination rail (brand, Pipelines/Runs/Chat/Settings as real tabs, a same-rail Search control, the detail section rail and a dot+word status footer) beside the list and detail panes. The rail is the deliberate web reading of Android's bottom pill (`DestinationBar.kt`), recorded in the brief and `docs/layout-spec.md`; the two pane columns are `minmax(200px,360px)` plus `minmax(200px,1fr)`, so neither track collapses at the 600px breakpoint. The document never scrolls: the list body, the detail body, the chat transcript and the Settings column are the only owners, each with `overflow:auto`/`overscroll-behavior:contain`. Captured 2026-10-19 at 1440×900: `captures/80-shell-wide-pipelines-1440x900.png`, `captures/80-shell-wide-runs-1440x900.png`, `captures/80-shell-wide-chat-1440x900.png`, `captures/80-shell-wide-settings-1440x900.png`, `captures/81-shell-wide-run-detail-1440x900.png` (the section rail), `captures/84-shell-settings-connection-1440x900.png` (connection hosted in Settings) and `captures/85-shell-status-indicator-1440x900.png` |
|
||
| L3 | Narrow layout: bottom section strip + bottom navigation | client-side | done — below 600px the same four destinations render in a bottom bar (icon + label, 48px targets) with the Search control beside them; a detail's Summary/Graph/Input/Output/Timeline strip sits in normal flow directly above that bar (measured bottom 817px = bar top 817px at 420×900), and a Back-to-list control keeps every destination reachable in the single-pane stack. The bar includes a compact status shortcut and respects `env(safe-area-inset-bottom)`. Captured 2026-10-19 at 420×900: `captures/82-shell-narrow-pipelines-420x900.png`, `captures/82-shell-narrow-runs-420x900.png`, `captures/82-shell-narrow-chat-420x900.png`, `captures/82-shell-narrow-settings-420x900.png` and `captures/83-shell-narrow-run-detail-420x900.png` (strip directly above the bar) |
|
||
| L4 | Responsive switch by viewport width (no hardcoded device) | `WindowSize.kt` analogue | done — one CSS breakpoint (`@media (min-width:600px)`), the exact analogue of `isWideLayout(widthDp)` at 600dp; no device sniffing, `screen.width` or fixed width. `ui-smoke` resizes the real browser with `Emulation.setDeviceMetricsOverride` at device scale 1 and asserts at both 1440×900 and 420×900 that the correct mount is visible, the other is `display:none`, no page-level scrollbar exists (`scrollHeight<=innerHeight+1`, `scrollWidth<=innerWidth+1`), each visible pane has at most one scrollable descendant and every visible tablist is a real roving tablist; it also opens a pipeline detail at 600×900 and asserts the detail pane is at least 200px and its title at least 120px wide |
|
||
| L5 | Notifications for failed/waiting runs (browser Notification API; HTTPS/localhost only) | derived from `subscribe` / `run_event` | **partial** — the browser notification path is implemented and captured in Settings, but **no real OS notification was observed**, so the row is not `done`. The exact reason: headless Chrome cannot reliably show or capture an OS notification; the smoke stubs and records the `Notification` constructor, while the transition decisions run through the page's real socket `onmessage`/`frame` path. Pure logic lives in `src/notify.js` and mirrors `notify/RunAlerts.kt` + `ui/Attention.kt`: only a run becoming `failed` (headline `A run failed`) or `waiting` (headline `A run needs your decision`) notifies; `queued`, `running`, `succeeded`, `canceled`, `interrupted` and unknown statuses never do. Body is the attention label (trimmed title else pipeline) then ` · {pipeline}`, with no separator when the pipeline is blank or equal; identity/tag is the attention key `{runId}:{kind}` so one run+kind notifies once, duplicate frames repeat nothing, a key is forgotten when the run leaves that qualifying state, and a genuinely new transition may notify again. First-seen `failed`/`waiting` from the initial `list_runs` or the `subscribe` snapshot raises nothing (the snapshot is bracketed as a seed); a disconnect drops the baseline but keeps the page session's dedupe set and reseeds before resubscribing, so a gap never notifies. A key present in the attention surface's `dismissed` set (`state.attentionDismissed`) is suppressed. Settings now shows the Android rationale verbatim (`Pipelines can notify you when a run is waiting for your decision or has failed. Without it, those runs still appear in the in-app Needs you surface.`) and honest copy for unsupported, insecure context, default, granted and denied; only `default` on a supported secure page offers the explicit `Enable notifications` control, which is the only call to `Notification.requestPermission()` (never on load). Only `{asked:true|false}` is stored under `pipelines.web.notify.v1`; malformed storage decodes to never-asked and the wording never claims consent. Clicking a notification focuses the page and opens Runs with the run selected through the **existing** navigation; **L6's `/runs/:id` URL route is still `todo`**, so no URL route is invented. `subscribeRuns`/`unsubscribeRuns` send exactly `{type:'subscribe',workspace:''}` and `{type:'unsubscribe'}` (no `run_ids`, no polling timer) and are sent only after the page is connected. Unit-tested in `test/notify.test.mjs` (qualification, wording/body, per-run dedupe, seed/snapshot suppression, dismissed keys, permission copy, asked storage) and `test/repository.test.mjs` (both request shapes + the not-connected guard). Captured 2026-10-19: `captures/L5-notifications-settings.png` (default state, control offered, 0 requests on load), `captures/L5-notifications-granted.png` (after the one explicit grant) and `captures/L5-notifications-denied.png` (honest denied copy, no control). The same checks live in `test/ui-smoke.mjs` behind `--notify` (a focused mode that runs exactly this evidence); that run finished `UI SMOKE PASS` and logged: queued→failed and running→waiting each raised exactly one recorded notification, duplicates/terminal/unknown statuses/first-seen/dismissed raised none, and the click opened the run. **Not observed:** the OS notification itself. On 2026-10-19 the default full live suite reached and passed this block with the same logged assertions, then failed later in an unrelated C13 hit-test (`the last row's menu item is not clickable`, its centre at y=919.5 in a 900 px viewport after the list's re-render reset the scroll); the L5 captures and assertions above come from the focused `--notify` run, which finished `UI SMOKE PASS`. |
|
||
| L6 | Deep links to a run (`pipelines://run/…` analogue → URL route) | — | done — the page's destinations are real URLs through a pure, total route model in `src/routes.js`: `/pipelines`, `/runs`, `/chat`, `/settings` and `/templates`; `/pipelines/:id` and `/pipelines/:id/:version` (version 0 or absent = latest); `/pipelines/:id[/:version]/stage/:key`; `/runs/:id` with `?action=decide`; `/runs/:id/stage/:key[?visit=N]`; `/settings/templates` and `/settings/templates/:key` parse as aliases of `/templates` and `/templates/:key`. `visit` is a zero-based index into that stage's visits, dropped when invalid while the stage route stays; a malformed or unknown path (a bad percent escape, a zero/negative run id, a non-numeric version or path, or a trailing extra segment on either stage branch, e.g. `/runs/440/stage/planner/extra`) resolves to the Pipelines list and never throws, and search/query state is never a route. The serialiser percent-encodes path segments, omits version 0 and an absent visit, and round-trips under `parse(serialize(…))`; an id, version or key the parser would reject is never emitted — it falls back to the nearest canonical route (an invalid id to the list, an invalid version to latest) so the address bar can never carry a path the parser would discard. `serve.mjs` serves `index.html` for any page route (a first segment naming a destination, so a stage key that ends in an extension — `plan.js`, `plan.v2` — still deep-links) or any non-asset GET, with a root `<base>` so the shell's relative asset URLs resolve under a deep path, while an asset-looking path outside a page prefix such as `/nope.js` stays 404. Navigation moves the URL with `pushState` only on a real change (top-level tabs, pipeline/run/template selection, Settings' Browse templates, opening/closing either stage pane; a user click on a pipeline graph node pushes `/pipelines/:id/:version/stage/:key` through the shared graph's `onSelectionChange` (a synthetic click is never used); a deep-linked stage instead opens at mount through the graph's `selectedKey` option without notifying), and one `popstate` listener parses and applies Back/Forward without a reload; in-detail tabs (Summary/Graph/Source, run tabs) and search stay in-place. A deep link is parsed at boot, kept pending until the first successful connection, and then loaded list-first (later reconnects never replay it; any move made while still disconnected replaces the pending boot link, so the URL and the first connected view agree). An unknown or malformed boot path renders the Pipelines list and `replaceState`s the address bar to the canonical `/pipelines` so the URL and the view agree. A later reconnect refreshes the lists and re-applies the route: the URL and a detail already in hand survive the drop, while a detail that is not in hand (never loaded, or cleared while disconnected) is fetched again. Only a genuine server refusal — never a timeout or a socket drop — discards the deep link. A run link's `?action=decide` opens the existing decision sheet once, only when the run is genuinely waiting, then `replaceState`s to the action-free `/runs/:id`. A valid but out-of-range `?visit=N` is clamped to the stage's last visit and the entry is corrected, so the address bar and the pane agree; a pipeline-stage path naming a key the loaded graph does not declare falls back to `/pipelines/:id[/:version]` rather than leaving a pane-less stage URL, while a key the mounted graph can select — including its `#success`/`#failure` terminals — re-opens the same definition pane (the graph writes those URLs itself, so the loader accepts them). A run-stage path naming a stage that is neither visited nor a node of the run graph falls back to the plain run detail. A deep link to an executing run installs its 1 Hz refresh; leaving Runs for any other destination stops it, and a reply discarded for a view that no longer shows Runs stops it too, so no get_run loop survives the move (asserted in the smoke when an executing run is live). A deep-linked stage pane is revealed clear of the sticky top bar (its head and the Close control stay visible), which the smoke asserts. A run the server does not have falls back honestly to `/runs` — the real list, the server's own refusal in the banner and no stale pane or throw (the same for a missing pipeline → `/pipelines`). A run or run-stage route also loads the pipeline list when it has not been seen, so the nav badge stays honest (`Pipelines (29)` at capture time, never a false `Pipelines (0)`) — asserted in the smoke. Captured 2026-10-19: `captures/L6-deeplink-run-440.png` (a hard navigation to `/runs/440` opening run 440's detail), `captures/L6-deeplink-pipeline-24.png` (a hard navigation to `/pipelines/24` opening `Plan and land`), `captures/L6-deeplink-pipeline-24-stage.png` (a hard navigation to `/pipelines/24/stage/planner` opening the Graph tab and the stage's definition pane in view), `captures/L6-deeplink-pipeline-24-terminal.png` (a hard navigation to `/pipelines/24/stage/%23failure` re-opening the Failure terminal pane — the live graph's first terminal at capture time — with its URL unchanged), `captures/L6-history-back.png` (an in-page Pipelines→Runs→run-detail sequence, then `history.back()` restoring the Runs list, with a window marker proving no reload), `captures/L6-missing-run.png` (`/runs/900000000` landing on `/runs` with the real list — 407 rows at capture time — and the banner `run not found`) and `captures/L6-missing-pipeline.png` (`/pipelines/900000000` landing on `/pipelines` with the real pipeline rows and the server's refusal banner). Parsing, serialisation, version/visit semantics and round-tripping are unit-tested in `test/routes.test.mjs`. **The live server had no waiting run, so the `?action=decide` path was not exercised live**; `test/ui-smoke.mjs` captures the sheet automatically the moment a waiting run exists |
|
||
| L7 | Accessibility: focus order, labels, keyboard operation | — | done — every must-fix finding in `web/docs/a11y-audit.md` is addressed. **M1/M2 are this change:** one shared DOM-only controller (`web/src/modal.js`) now owns every listed `role="dialog"` surface (attention sheet, stage pane, changes viewer, artifact viewer, decision sheet, cancel/retry/restart confirm, Action-failed, chat Rename/Close, template create): it records the opener, re-parents the panel into `#modalLayer` outside `.app-root`, focuses the first control (or the panel with `tabindex=-1`), traps Tab/Shift+Tab, sets native `inert` on `.app-root` (exact-prior restoration; the no-inert fallback uses `aria-hidden` plus saved `tabindex` and a `focusin` guard), routes Escape/backdrop/the close control through the same view callback, and restores focus to the re-resolved trigger or a sensible heading. Same-id re-renders replace the panel without recapturing the trigger, a second overlay inerts the first and gives it back on close, and the one document keydown/focusin listener is removed when the stack empties. **M3/M4/M8** were built into the shell (tablist/tab/tabpanel with roving `tabindex` and arrow keys, the `Skip to detail` link plus list→detail focus handoff, and one `h1` per route with list `h2`s). **M5/M6/M7/M9** previously landed (named keyboard artifact tiles; sibling Chat actions with unique names; named attention Dismiss controls; timeline focus ring). No markup copy, roles or CSS was changed by this item. Focused proof: `node --test test/modal.test.mjs` (focusable discovery, both wrap directions, empty-panel fallback, idempotent open/listener cleanup, stack inertness, exact inert/aria-hidden/tabindex restore) and `node test/modal-probe.mjs --out ../captures` passed against the live server for the attention sheet, run 440 Retry confirm, run 438 changes viewer and the artifact-viewer-over-stage-pane stack, with `captures/86-modal-focus-attention.png` as the keyboard-opened focus-visible capture. `node --test test/` is green (603 tests). The **S1–S12** should-fix items remain notes and are not claimed fixed here; the full `ui-smoke` run reached the unchanged live-chat markdown-table assertion, which the current operator session does not satisfy (no table anywhere in its history), so it is recorded as an environmental live-data limitation rather than a modal regression. |
|
||
|
||
## Deliberately out of scope
|
||
- **Operator-only transport** — `inspect_resource`, `reconcile_resource`,
|
||
`inspect_resource_pool`, `configure_resource_pool` are loopback-only and must
|
||
not be exposed by a browser client.
|
||
- **Device/ADB features** — the Android app's device work is the UI reviewer's
|
||
lease-based work, not a client feature.
|