From b55de770feb5546495ab8234f9909926a7ed1744 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Mon, 19 Oct 2026 06:06:05 +0100 Subject: [PATCH 1/2] =?UTF-8?q?web:=20create=20a=20pipeline=20from=20a=20t?= =?UTF-8?q?emplate=20=E2=80=94=20validate=20then=20submit=20(P5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- web/PARITY.md | 2 +- web/src/app.js | 213 +++++++++++++++++++++++++++++++++++ web/src/protocol.js | 6 + web/src/repository.js | 23 ++++ web/src/templates.js | 65 +++++++++++ web/styles.css | 43 +++++++ web/test/repository.test.mjs | 61 ++++++++++ web/test/templates.test.mjs | 64 +++++++++++ web/test/ui-smoke.mjs | 109 +++++++++++++++++- 9 files changed, 583 insertions(+), 3 deletions(-) diff --git a/web/PARITY.md b/web/PARITY.md index e8c86f43..18555f91 100644 --- a/web/PARITY.md +++ b/web/PARITY.md @@ -25,7 +25,7 @@ Status legend: `todo` · `partial` (some of it works) · `done` (working + captu | 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` | todo | +| 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:,source: