Commit Graph

457 Commits

Author SHA1 Message Date
alan 597151cdd1 web: settings destination with connection, workspace and templates (L1)
Completes the item: the Settings view, its pure helpers and the client's
socket-replacement path, plus the fix the review required (a header-side URL
correction clears the Settings field's own error) and a smoke check for it.
2026-10-19 11:30:19 +01:00
alan 27a1605127 web: ui-smoke — C5 after the composer section re-opens the chat
The merge put main's C5 live-stream section after the C8/C9 composer section,
but the composer section closes its throwaway session and returns to the list,
so no conversation was open for C5 to observe. The C5 section now re-opens the
operator's own session (read-only: real subscribe + history, synthetic frames
injected into the page's socket handler) and waits for its newest history page
to render before replaying, so the history load cannot replace the replayed
turn. `node test/ui-smoke.mjs` is green end to end against
ws://127.0.0.1:8080/connect.
2026-10-19 07:36:47 +01:00
alan 672c988136 Merge branch 'main' into web-chat-composer
# Conflicts:
#	web/src/app.js
#	web/src/client.js
#	web/src/protocol.js
#	web/test/chat.test.mjs
#	web/test/repository.test.mjs
#	web/test/ui-smoke.mjs
2026-10-19 07:33:49 +01:00
alan d9f5ba6f75 web: chat composer review fixes — real Stop, /close leaves the pane
Address the review of C8/C9: the composer's Stop control now routes to
`chat_interrupt` (`onStop`) instead of the inert submit path, and the smoke
clicks it and asserts the page's own "Stopping the running turn…" notice with
no `Action failed` dialog (captures/63b). Accepting `/close` finishes the
session locally — the running/queued bits clear and the conversation leaves
the pane for the list, mirroring Android's `finishSession` — and the smoke
asserts the select hint returns. A command notice draws the one terminal
glyph (`CHAT_COMMAND_GLYPH`, `>_`) for both states, tinted only; the growing
textarea accounts for its padding and border so six rows are six whole lines;
remove a shadowed duplicate `chatSessionById`. Wording unchanged; every pure
helper and the wire shapes remain unit-tested.

The smoke creates a throwaway session via `/new`, really prompts, really
interrupts and closes it; the operator's session is never prompted.
2026-10-19 07:26:25 +01:00
alan 776279554c Merge branch 'main' into web-chat-live 2026-10-19 07:01:39 +01:00
alan 7b578498ae web: live chat transcript over chat_event (C5) 2026-10-19 07:01:00 +01:00
alan f660078173 web: chat composer — send, stop, attachments, draft and slash commands (C8/C9)
Add the composer at the foot of an open conversation: a growing 1–6-row
textarea (Enter sends, Shift+Enter newline), an Attach file control with
removable attachment chips (25 MiB limit, failed attachments block sending),
one send/stop control that turns to Stop while a turn runs, and the queued
notice cleared on any incoming frame. Add the five slash commands with the
palette, the pure chatCommand* helpers and the command notices. The prompt
carries native_message_id so OpenCode accepts it, and a rejected prompt
restores the draft and attachments with the server's message. Drafts persist
per chat in memory and localStorage; attachments stay memory-only.

Tests cover every pure helper and the exact chat_prompt/chat_interrupt/
chat_create wire shapes; ui-smoke captures the composer, palette, a failed
command notice, the attachment chips and the Stop control (a real prompt to a
throwaway session that is closed in cleanup).
2026-10-19 06:53:30 +01:00
alan b63c7a1b88 Merge branch 'main' into web-template-create 2026-10-19 06:16:16 +01:00
alan 7df4891f14 web: chat reasoning block and tool calls for the whole lifecycle (C6) 2026-10-19 06:14:48 +01:00
alan b55de770fe web: create a pipeline from a template — validate then submit (P5)
A template detail now offers "Create pipeline from this template". Its
dialog ("Create from {name}", one required field "New pipeline name
(required)", the note that it creates a draft and does not run, Create /
Cancel with Cancel reading Close after a success) validates the
template's source first and, only when it parses, submits it create-only
with the trimmed name. Create is disabled while the name is blank or
while sending; the field locks while sending and after a success. A
refusal shows the server's own error in the still-open dialog; a success
shows `Created "{name}". It is in the Pipelines list.` and refreshes
list_pipelines so the new row is visible.

Pure helpers + both request shapes are unit-tested; the flow is captured
against a scratch server with its own throwaway database. The live
server's pipeline list is never touched: the default ui-smoke run sends
no submit and create runs only under its --scratch flag. Wording matches
android/.../TemplateDetailScreen.kt and PipelinesRepository.kt.
2026-10-19 06:06:05 +01:00
alan f48e53d5c8 web: resolve merge collision in ui-smoke (rename chat query local)
Both web-attention and web-chat declared 'const cleared' in the top-level
module scope of test/ui-smoke.mjs; the auto-merge kept both, which is a
SyntaxError. Rename the chat one to 'clearedQuery'.
2026-10-19 05:42:12 +01:00
alan 96e48e33e2 Merge branch 'main' into web-chat 2026-10-19 05:39:31 +01:00
alan 0688127253 web: chat — session list, open/close, history paging, markdown, scroll (C1/C3/C4/C7/C14)
Browser Chat destination for parity with the Android app:
- session list grouped by directory (closed grouped under "Closed"), kind
  chip, activity badge, work-label meta line, "Search chats" filter (C1)
- open/close/reopen with the Android copy verbatim (C3)
- conversation history paging via the opaque next_cursor (C4)
- markdown subset renderer + code blocks (C7)
- scroll follow / "Jump to latest" / per-session saved position (C14)

Request builders in src/repository.js; pure merge/format/markdown/paging
logic in src/chat.js and src/markdown.js; view in app.js. Every server
string set with textContent, markdown built as DOM nodes.
2026-10-19 05:39:29 +01:00
alan 28d8bdb29d Merge branch 'main' into web-attention
# Conflicts:
#	web/PARITY.md
#	web/src/app.js
#	web/styles.css
2026-10-19 04:55:01 +01:00
alan f3bc6ed126 web: attention / "Needs you" surface — bell, sheet, dismissals (R15, R2) 2026-10-19 04:52:34 +01:00
alan 3d98c60de6 Merge branch 'main' into web-search
# Conflicts:
#	web/src/app.js
#	web/src/protocol.js
#	web/src/repository.js
#	web/styles.css
#	web/test/repository.test.mjs
#	web/test/ui-smoke.mjs
2026-10-19 04:44:54 +01:00
alan 6992ecd4e8 web: run-level actions — human decision, cancel, retry and rename (R11–R14)
Add the run-level operator actions to the browser run detail, matching the
Android client's wording and wire frames:

- R11 human decision: pure model in src/actions.js (pendingDecision,
  lastWaitingStep, waitingPrompt/waitingOptions, humanOptions,
  decisionTargetLabel, DecisionDraft) plus the decision card and sheet;
  decide_run sends run_id, the chosen option and trimmed feedback.
- R12 cancel: a Cancel run action offered only while executing; the Android
  confirm copy; cancel_run then a silent get_run refresh.
- R13 retry: offered only for a loaded, non-executing failed run; resume is
  the default (no retry_mode, like Android) with a browser-only
  Restart from start secondary that sends retry_mode:"restart".
- R14 rename: an inline set_run_title field; refreshes the run and its list row.
- One shared Action failed dialog for all of the above.

Add the protocol constants and typed builders, a hand-written dark-palette
section for the card/sheet/dialogs, focused unit tests for the helpers and
request shapes, and ui-smoke captures for the new states. Update PARITY.md:
R11 stays partial (no live waiting run), R12–R14 done with the stated
shown-not-executed and Android-divergence notes.

Also harden openRunDetail() in the UI smoke: the tabstrip already exists from
the previously opened run, so wait for the target run's identity line before
asserting on its actions (review finding).
2026-10-19 04:37:35 +01:00
alan 26eaec2531 web: add omni-search results and routing (S1/S2) 2026-10-19 04:31:24 +01:00
alan 9555bfe58f Merge branch 'main' into web-connection
Integrate main's run-detail Changes (R4) and Graph (R5) work with the
connection banner/reconnect/foreground-recovery/live-badge work (T3/T4/T5).

Conflicts resolved by keeping both independent additions:
- web/styles.css: the .conn-*/.live-* rules and the .change-*/.diff-* rules
  are separate blocks; both retained under their own comment headers.
- web/test/ui-smoke.mjs: both capture sequences retained (T3/T4/T5 writes
  28-connected-banner/29-disconnected-banner/30-reconnect-recovered; R4/R5
  writes its own distinct 28-34 run-change captures), so no filename collides.

Checks after the merge: node --check on all touched JS/MJS; node --test test/
225 pass / 0 fail; node test/ui-smoke.mjs --out <worktree>/captures UI SMOKE
PASS against ws://127.0.0.1:8080/connect, including the connected banner +
build line + live badge, the disconnected retry banner, the online-event
recovery, and main's R4/R5 captures.
2026-10-19 04:11:50 +01:00
alan 9f6e10bf71 Merge branch 'main' into web-changes
Resolve the web/PARITY.md conflict by keeping main's R3 (now listing the
Graph tab) and R5 rows alongside this branch's R4 row; R4's Changes viewer
merges cleanly into app.js, styles.css and ui-smoke.mjs.
2026-10-19 04:07:48 +01:00
alan 9d1745da1d web: run Summary Changes section with rendered/raw diff viewer (R4)
Add a collapsed-by-default Changes section to the run Summary tab and a
full-screen diff viewer, ported from the Android RunChanges/ChangeDiffViewer
wording. Pure aggregation and unified-patch parsing live in src/changes.js;
app.js wires the section/viewer and sets every server string with textContent.
Unit tests cover the header variants, kind merge, stat sums and hunk parsing;
ui-smoke captures the collapsed/expanded section, rendered and raw viewer,
paging, Escape/backdrop close, binary, truncated and a running run's header.
2026-10-19 04:06:44 +01:00
alan 71342fe027 web: connection banner, reconnect, foreground recovery and live badge (T3/T4/T5)
Close T3, T4 and T5 of web/PARITY.md (the "Transport and connection"
table). T1/T2/T6 are untouched beyond wiring.

- src/connection.js (new): the pure, DOM/socket/timer-free helpers behind
  every new state — `bannerState` (the persistent banner's copy and tone),
  `stateBadge` (the compact header indicator, which is also where the retry
  attempt is named), `foregroundAction` (the return-to-foreground policy
  from ConnectionRecovery.kt), `protocolMismatch`, `serverBuildLabel` and
  `liveBadgeState`. Wording and colour roles mirror ConnectionBanner.kt,
  LiveBadge.kt/RunStream.kt and SettingsScreen.kt.
- src/app.js: wiring only. The banner sits in normal document flow under
  the header (never overlaying content); a Reconnect control appears beside
  the URL field whenever `bannerState` offers one and re-opens the same
  validated endpoint through `client.connect`, resetting the backoff;
  `visibilitychange`/`online` drive the foreground recovery; the ping reply
  records the server build and protocol for the banner.
- src/protocol.js: `PROTOCOL_VERSION = 1`, citing internal/protocol/
  identity.go and Message.kt.
- styles.css: the .conn-* banner and .live-badge rules in the app's dark
  palette, on the existing :root variables.
- test/connection.test.mjs (new): 18 focused unit tests for the pure
  helpers, including source-parity assertions against the Android files.
- test/ui-smoke.mjs: assert the connected banner + build line + live badge
  and capture them, then point the page at a closed port to capture the
  disconnected retry banner and recover via the browser's `online` event.
- PARITY.md: T3/T4/T5 done with their captures.

Checks: `node --check` on all five touched JS/MJS files; `node --test
test/` 190 pass / 0 fail (18 new); `node test/ui-smoke.mjs --out ...
/web/captures` UI SMOKE PASS against ws://127.0.0.1:8080/connect, writing
28-connected-banner.png, 29-disconnected-banner.png and
30-reconnect-recovered.png.
2026-10-19 04:06:18 +01:00
alan 94d4ff02d3 web: run detail Graph tab with executed styling and stage panes (R5)
Add the run detail's Graph tab (between Summary and Input), reusing the
shared src/graph.js renderer (P6) rather than a second renderer. In run
mode a visited stage is executed (solid fill + border), an unvisited one
hollow with a dashed muted border; a terminal is executed only when a
visit resolved to it; a route is executed only when a recorded visit
produced that outcome (solid with an arrowhead, success first, error
last, others alphabetical, `error*` for the fallback). The Executed /
Not executed legend shows only for a run. While the run executes the
current stage carries a pulsing halo (static under prefers-reduced-motion)
and a ticking elapsed badge; a finished run shows neither. Clicking a
stage opens the existing visit pane at that stage's latest visit, and
Back/Escape return focus. The empty state is the exact
"This server did not include the run graph."

extend src/graph.js with the run-mode inputs (runState-driven executed
styling, legend, active halo/elapsed badge); keep app.js to wiring.
Extend graph.test.mjs with focused run-mode unit tests and ui-smoke.mjs
with the run 438 / run 440 / live-run captures. Mark R5 done in
web/PARITY.md.

Checks: node --check on every touched file; cd web && node --test test/
(178 pass, 0 fail); cd web && node test/ui-smoke.mjs --out captures
(UI SMOKE PASS, captures 28-31).
2026-10-19 04:05:37 +01:00
alan 2e9ff1704f Merge branch 'main' into web-run-tabs 2026-10-19 03:32:34 +01:00
alan 06965933f4 web: tabbed run detail with summary, IO fields and timeline (R3/R6/R7)
The browser run detail becomes a tab strip — Summary, Input, Output,
Timeline — over the selected tab's body, with the Graph tab key reserved
for the R5 item.

- Summary: run label, status chip + outcome, the run identity line, the
  key/value rows (Pipeline, Stage, waiting-for-resource line, Workspace,
  content hash, Started, Finished, live Duration, Retry of, Diagnostic)
  and the collapsed run artifacts gallery.
- Input / Output: one collapsed section per recorded map entry, the value
  as a monospace block; empty states match the app.
- Timeline: one row per visit with the stage-outcome glyph, `{stage} ·
  visit {n}`, an outcome chip, a paperclip when artifacts were recorded,
  the duration and the description; a row opens the per-visit stage pane.
- Stage pane: headline rows, the Verdict block with inline artifact links
  and the Artifacts / Session / Output / Input / This run / Stage
  definition sections, all closable with Escape.

All new logic is the pure, DOM-free src/runDetail.js ported from the
Android sources; app.js keeps only the wiring and every server string is
set with textContent.

PARITY.md: R3, R6 and R7 marked done with their captures.
2026-10-19 03:32:32 +01:00
alan 9456f8a319 web: workflow graph rendering in the pipeline detail (P6)
Close P6 of web/PARITY.md: the pipeline detail's Graph tab now renders the
pipeline's workflow graph — stage nodes in declaration order, labelled outcome
edges, and the #failure/#success terminals on a shared lower row — plus a
definition pane opened from a node.

- src/graph.js (new): reusable `mount(container, graph, options) -> { unmount }`
  plus the pure helpers it is built from (layout, edges, `error*`, lanes,
  fit/clamp/zoom, hit-test, stage-definition fields). Definition view only, so
  the run-detail Graph tab (R5) can reuse it. Mirrors WorkflowGraph.kt,
  GraphPalette.kt, GraphSemantics.kt, StageDetailPane.kt and RunGraphTab.kt.
- src/app.js: wiring only — mount the graph in the Graph tab, drop the previous
  mount on every re-render.
- styles.css: the .graph-* styles in the app's dark palette.
- test/graph.test.mjs (new): focused unit tests for the pure helpers, no DOM.
- test/ui-smoke.mjs: open "Plan and land", switch to Graph, capture the graph,
  a stage pane and the expanded view, and assert the zoom/pan clamps and the
  empty-pane wording against the live server.
- PARITY.md: P6 done with the 2026-10-19 captures; P3 notes the Graph tab now
  renders the graph; R5 stays todo.

Checks: node --check on all five touched JS/MJS files; `node --test test/`
137 pass / 0 fail; `node test/ui-smoke.mjs --out ../captures` UI SMOKE PASS
against ws://127.0.0.1:8080/connect.
2026-10-19 03:26:50 +01:00
alan 4be740b461 Merge branch 'main' into web-artifacts
Combine the R8/R9 artifacts gallery, viewer and session link with main's
pipelines/runs/templates work. app.js: keep both import blocks. ui-smoke.mjs:
the artifacts step now navigates to Runs and selects run 430 through the
post-main run-row markup (meta[data-run-id=430]) instead of the retired
'.list button.row #430' spike row.

Checks: node --check on every touched file; node --test test/ 108 pass;
live ui-smoke against ws://127.0.0.1:8080/connect passes (run 430: 18 tiles,
viewer '1 of 10 · image/png', session link .../artifacts/430/8/session.html).
captures/ stays untracked.
2026-10-19 03:05:58 +01:00
alan aed65a7431 Merge branch 'main' into web-runs-home
# Conflicts:
#	web/src/app.js
#	web/styles.css
2026-10-19 03:02:42 +01:00
alan 28edc32dc3 Merge branch 'main' into web-runs-home
# Conflicts:
#	web/src/app.js
#	web/styles.css
#	web/test/ui-smoke.mjs
2026-10-19 03:00:13 +01:00
alan 96c315dbec Merge branch 'main' into web-templates
# Conflicts:
#	web/PARITY.md
#	web/src/app.js
#	web/styles.css
2026-10-19 02:58:34 +01:00
alan e753c474ac Merge branch 'main' into web-templates 2026-10-19 02:55:10 +01:00
alan 7c9c872e9c Merge branch 'main' into web-artifacts 2026-10-19 02:55:08 +01:00
alan c1dd8e6afa Merge branch 'main' into web-pipelines 2026-10-19 02:54:46 +01:00
alan e9f55dd5d2 Ignore web review captures so a capture does not dirty a delivery checkout 2026-10-19 02:53:59 +01:00
alan 13404b2a2b web: pipeline list, filter/sort and detail (P1/P2/P3)
Close three rows of the browser client's parity checklist, matching the Android
app's wording and behaviour:

- P1 pipeline list: name; "id {id} · v{version} · {N stages}"; "updated d MMM
  HH:mm"; a last-run line joined from list_runs (status chip plus
  "{ago} · {duration} · run {id}", or "no runs recorded").
- P2 filter + sort: Filter menu (name contains, Runs Any/Has runs/No runs, the
  seven server run statuses, Clear filters) and Sort menu (Server order default,
  Name A-Z/Z-A, Most recent run, Fewest/Most stages, Reset). Server order is
  preserved.
- P3 pipeline detail: Summary/Graph/Source tabs; Summary shows the content hash
  (monospace), latest version, created/updated and a collapsed-by-default
  Versions section. The Graph tab carries the browser guidance note only; the
  rendered graph stays P6.

New src/pipelines.js holds the pure, DOM-free helpers (timestamps, durations,
last-run join, comparators, filter, empty states); app.js is wiring only.
web/test/pipelines.test.mjs covers the helpers; web/test/ui-smoke.mjs captures
the list, controls and detail against the live server. All server strings are
set with textContent.
2026-10-19 02:52:35 +01:00
alan 849a184561 web: run history list, filter and sort (R1/R2)
Day-grouped run list with sticky day headers (Today / Yesterday / d MMM
yyyy / Unknown date), a usage roll-up block, the app's row hierarchy and
a bounded filter/sort menu — mirroring RunHistoryScreen.kt, ListFilter.kt
and ListSort.kt. New pure helpers live in src/runs.js with focused unit
tests; app.js keeps the wiring and sets server strings with textContent.

R1 done, R2 partial: no per-row "needs you" mark exists in the Android
app; its wording is deferred to R15 (separate attention surface).
2026-10-19 02:50:51 +01:00
alan 67120947c2 web: artifacts gallery, full-screen viewer and session export link (R8/R9)
Port the Android artifact derivation into a pure, DOM-free src/artifacts.js
(presentedArtifacts with the retired session.md hidden everywhere, grouping by
stage/visit, the header/summary/capture-note wording, kind and size formatting,
viewer paging and sessionExportArtifact) and unit-test it.

Wire it into src/app.js: a run-level artifacts gallery with per-(stage,visit)
groups, per-visit summaries and tiles, a full-screen viewer overlay (paging,
Escape/backdrop close) and the read-only session.html link. Every server string
is set with textContent; captures/ stays untracked.

Captured live against run 430 through test/ui-smoke.mjs:
captures/04-run-430-artifacts.png, 05-artifact-viewer.png,
06-session-export-link.png. PARITY.md marks R8 and R9 done.
2026-10-19 02:38:48 +01:00
alan da3c488506 web: templates gallery and template detail (P4) 2026-10-19 02:30:39 +01:00
alan 4721b8af10 web: prepare the client workstream for feature parity
Adds the area map (web/AGENTS.md), the parity acceptance checklist
(web/PARITY.md, one row per Android feature), and a zero-dependency browser
verification harness: test/browser.mjs drives the installed Chrome over the
DevTools protocol, and test/ui-smoke.mjs serves the page, connects it through
its own /connect proxy, and captures the rendered pipeline list, a pipeline
detail and a run detail as PNGs.

This closes the spike's 'rendered page not verified' gap (29 pipelines rendered,
three captures) and gives review stages real UI evidence without a phone or an
npm install. Hosting is unchanged: serve.mjs stays alongside the Pipelines
server and proxies /connect.
2026-10-19 02:13:39 +01:00
alan 4e4d09b6a4 Show only running background tasks in a compact chat bar
The chat background-task bar now lists only tasks that are still running, so an
exited task no longer lingers and the bar disappears when the last one ends. The
one-line 'running now and recently observed exits' subtitle is replaced by a
compact 'Background tasks · N running' header, and the list is capped at three
touch-sized rows and scrolls beyond that instead of pushing the composer down the
screen. Unit-tested (running-only set and the row cap) and the stale note
updated.
2026-10-19 01:24:20 +01:00
alan a98688f977 Hide the destination pill while a pipeline detail is open
Opening a pipeline is a detail surface that owns the foot of the Pipelines
destination, so the floating pill now stands down there exactly as it already
does for a run detail (any non-list pane depth), and returning to the pipeline
list restores it. Verified on the foldable emulator: pill drawn on the pipeline
list, hidden on the Android pipeline detail, restored on Back.
2026-10-19 01:24:20 +01:00
alan b37ade8f0e Fix Android root build commands 2026-10-19 00:43:22 +01:00
alan 4ab65692d6 Schedule Android UI review through the android-devices pool
The Android UI reviewer declares the android-devices pool instead of one
hard-coded Pixel, so a second UI run can use the idle foldable emulator instead
of waiting behind the single phone. Updates the Android map's device rules to
match the pool (replacing the old single-phone / no-emulator rule) and records
the pool, its members and the delivery-only personal Fold in a note. Safety
rules are unchanged; configuration and the pipeline version are separate steps.
2026-10-19 00:40:10 +01:00
alan 7259513d92 Label incomplete run file captures honestly
An empty partial capture no longer collapses to "no changes observed": the run
summary keeps partial/unavailable/missing capture evidence explicit, reports
skipped files, and preserves real earlier patches when a later commit-only stage
has a complete empty capture. Adds focused RunChanges tests and the stale-doc
note. UI-verified on the foldable emulator against a controlled fixture: an empty
partial capture shows 'Changes · partial capture' with the skipped-file note, and
a clean complete capture still shows 'Changes · no changes observed'.
2026-10-19 00:39:48 +01:00
alan d4dd7cb3df Merge branch 'main' into manager-honest-diffs 2026-10-19 00:36:15 +01:00
alan e59b61b659 Move notification access to the app action bar
Relocates the attention entry point from the floating above-pill chip into the
existing main/detail app bars (bell + count badge), removing the old floating
indicator and its reserved scroll spacing. Preserves Clear all, individual
dismiss, open-run and badge-count behavior. UI-verified on the foldable
emulator: action-bar bell with badge on Runs and run detail, sheet opens from
it, no floating chip.
2026-10-19 00:31:46 +01:00
alan c464aa5188 Merge branch 'main' into small-actionbar-notifications
# Conflicts:
#	android/app/src/main/java/net/awan/pipelines/ui/theme/Dimens.kt
2026-10-19 00:31:10 +01:00
alan 63cae54fb4 Merge branch 'main' into chat-cross-client-echo-order 2026-10-19 00:08:33 +01:00
alan 7da3d54013 chat: reconcile history by canonical message identity 2026-10-19 00:08:30 +01:00
alan 7c6424971d Merge branch 'main' into small-fullwidth-body 2026-10-19 00:07:03 +01:00