12 KiB
T1 — native create-from-template prompt
Manager integration: retained both sides' compatible run-test gateway/scroll repairs when merging. Split native field/action controls from dialog state so production files remain under250lines. Added a fail-closed repository guard: an empty/malformed created detail without a positive integral pipeline identity cannot be reported as successful creation. The new regression failed before the guard; all24 template tests pass after.
Browser acceptance now also covers Cupertino at 2x on a phone. The probe found
the prompt open and usable; its old "is the prompt open?" test required a
role=button Create node, which the Cupertino action row does not expose at that
scale even though the action is present and tappable. The probe now tests the
native alert-dialog surface directly and keeps the Material-only aria-disabled
check, with disabled-state coverage for Cupertino in widget tests. The probe's
own opener is now a bounded scrollable column so a long button label cannot run
past a phone viewport. No product layout change was needed: the Cupertino dialog
fits at 2x and its success capture was inspected.
Result
A native Material/Cupertino prompt implements the browser's P5 create flow without a gallery, route, shell wiring, publish/run control or dependency change. Create validates the template's source first and only a passing validate submits it create-only. The accepted detail is reported once through the dialog callback; nothing is sent while typing, on Cancel, or after a validation refusal.
This visit addresses the UI review's blocking findings and the earlier non-blocking notes:
- B1 (2x, short phone hid the feedback): the refusal/success line now sits directly under the field, before the note, inside the dialog's scroll area, and the prompt scrolls it into view when it is outside the visible content. At 2x/360×640 both lines are visible at rest without any scroll.
- B2 (Cupertino field had no accessible name): the field now has a visible
New pipeline name (required)label merged into the text field's semantics node (label + value on one node). The Cupertino placeholder was removed because it duplicated the accessible name; the visible wording is unchanged. - S1 (Material label truncated to
New pipeline name (requ…): the floating label was replaced by the same wrapping label above the field that the browser renders, so the full wording stays visible at 2x. - Advisory in-flight lock: the flow test now asserts the field and Cancel are disabled and that a system back does not dismiss while a validate is pending.
- The earlier note's file count is corrected below.
Files (all new; nothing modified or preserved-changed)
| File | Lines | Responsibility |
|---|---|---|
lib/features/templates/ui/template_create_dialog.dart |
287 | Native prompt, labelled field, validate-then-submit state machine, feedback reveal |
lib/features/templates/ui/template_create_wording.dart |
42 | Browser wording verbatim, title/created-name/error helpers, stable keys |
test/features/templates/ui/template_create_dialog_test.dart |
138 | Material blank/Cancel/happy path and validation-refusal coverage |
test/features/templates/ui/template_create_flow_test.dart |
171 | Submit refusal, in-flight lock/double submit, Cupertino branch |
test/features/templates/ui/template_create_accessibility_test.dart |
225 | 2x/3x layout, feedback visibility, both hosts' field semantics |
test/features/templates/ui/template_create_test_support.dart |
127 | Recording gateway, fixture template, Material/Cupertino host |
test/features/templates/ui/template_create_wording_test.dart |
43 | Exact wording and name fallbacks |
tool/template_create_probe.dart |
167 | Isolated in-process fixture entry; Material or Cupertino, optional text scale |
tool/template_create_probe.mjs |
316 | Loopback static server + real headless Chrome driver |
notes/T1-create.md |
— | This evidence |
TemplateEntry, TemplateRepository, ApiGateway and TemplateRepositoryException
are reused unchanged. pubspec.*, lib/main.dart, the shell, another feature,
web/, the Go server and android/ were not touched.
Behaviour and wire requests
- Exact browser wording: title
Create from {name}(blank name falls back to the template key), fieldNew pipeline name (required), noteCreates a new draft pipeline on the server from this template's source; it is not run., buttonsCancel/Create, in-flightCreating…, post-successClose, andCreated "{name}". It is in the Pipelines list.. - Opening the prompt, typing and Cancel send nothing. Only Create runs
TemplateRepository.validate(template.source)and then, only after it passes,TemplateRepository.submit(typedName, template.source). The repository sends{type: 'submit', name: <trimmed>, source: <verbatim>, create_only: true}; the source is never trimmed or re-encoded. - Blank/whitespace-only name keeps Create disabled. Sending disables the field, both buttons and the confirm action, and blocks back/barrier dismissal. After a success the field and Create stay disabled and the dismiss button reads Close.
_sendingplus_canSubmitguard a second tap/Enter, so a pending validate cannot produce a second validate or submit.- A validation refusal shows the server's own text in the still-open prompt and
sends no
submit. A submit refusal also keeps the prompt and the typed name. Neither refusal calls the callback and neither shows a success line. - Success uses the server's own
detail.namewhen non-blank, else the trimmed submitted name, exactly like the web'screatedPipelineName. The accepteddetailis delivered throughonCreatedonce, before the user presses Close. - The field keeps one layout on both hosts: a wrapping visible label, then the
native
TextField/CupertinoTextField, wrapped inMergeSemantics. A reader gets one text-field node whose label is the full wording and whose value is the typed name. Refusal/success is placed after the field and before the note. - Controls are standard
AlertDialog/AlertDialog.scrollable/TextField/FilledButton/TextButtonandCupertinoAlertDialog/CupertinoTextField/CupertinoDialogAction. Only the semantic error colours are used (colorScheme.error,CupertinoColors.systemRed); there are no font/size/ colour overrides, fixed component sizes or bespoke palette.
Checks actually run
cd app
flutter analyze # No issues found! (1.2s)
dart format --output=none --set-exit-if-changed \
lib/features/templates test/features/templates \
tool/template_create_probe.dart # 0 changed
flutter test test/features/templates # 23 passed
flutter test # whole app, passed
flutter build web -o build/web-normal # normal entry, ✓ Built
flutter build web --target=tool/template_create_probe.dart \
-o build/template_create_probe_web # ✓ Built
PROBE_WEB_ROOT="$PWD/build/template_create_probe_web" \
OPENCODE_ARTIFACT_DIR=…/public/t1-create \
node tool/template_create_probe.mjs # ok: true
PROBE_WIDTH=360 PROBE_HEIGHT=640 PROBE_SCALE=2 \
PROBE_CAPTURE_PREFIX=t1-create-2x-360x640 … # ok: true
PROBE_SCALE=2 PROBE_CAPTURE_PREFIX=t1-create-2x-390x844 … # ok: true
PROBE_HOST=cupertino PROBE_CAPTURE_PREFIX=t1-create-cupertino … # ok: true
git status --porcelain=v1 -uall # only the ten new files below
The focused suite is the prior T1a data tests (13) plus ten UI/wording tests, including: blank/Cancel/happy path; validate and submit refusals; the in-flight lock (disabled field/Cancel, back does not dismiss) and double-submit guard; Cupertino native controls with the visible label; 2x/360×640 feedback visible at rest for both refusal and success; the full label wrapping without ellipsis; the reveal after the content was scrolled; and the field's semantics label + value on both hosts.
Browser evidence (real headless Chrome, loopback only)
The fixture gateway is in-process; the probe never opens a socket and never
submits to a real server. The driver reads globalThis.templateCreateProbe to
verify request counts and payloads, and asserts the field's DOM aria-label is
New pipeline name (required).
1x, 390×844 (public/t1-create/):
- Blank name:
Createhadaria-disabled="true", field empty, editable and labelled. Probe release+ Create: exactly onevalidate, zerosubmit, callback count 0; the server'sinvalid definition: fixture stage "añadir" has no typewas shown and the field still heldProbe release.- Retrying Create: second
validate, exactly onesubmitwith{name: "Probe release", source: <verbatim fixture>, create_only: true}, one created callback, the exact success line, field locked,Closeshown. - Close sent no further request and dismissed the prompt.
2x captures (public/t1-create-2x-360x640/, public/t1-create-2x-390x844/):
- The full
New pipeline name (required)label wraps and is visible at rest on both viewports; the refusal and success lines are visible at rest on 360×640 without scrolling or any other interaction. - The title remains visible above them; only the note is clipped by the short viewport, and it stays scrollable.
Cupertino captures (public/t1-create-cupertino/, 390×844, Chrome): blank,
refusal and success with the same label, wording, request counts and locked
field. The DOM input exposes aria-label New pipeline name (required).
Captures (public, shared with later stages):
public/t1-create/t1-create-blank-name-disabled.pngpublic/t1-create/t1-create-validation-refusal.pngpublic/t1-create/t1-create-accepted-success.pngpublic/t1-create-2x-360x640/t1-create-2x-360x640-blank-name-disabled.pngpublic/t1-create-2x-360x640/t1-create-2x-360x640-validation-refusal.pngpublic/t1-create-2x-360x640/t1-create-2x-360x640-accepted-success.pngpublic/t1-create-2x-390x844/t1-create-2x-390x844-blank-name-disabled.pngpublic/t1-create-2x-390x844/t1-create-2x-390x844-validation-refusal.pngpublic/t1-create-2x-390x844/t1-create-2x-390x844-accepted-success.pngpublic/t1-create-cupertino/t1-create-cupertino-blank-name-disabled.pngpublic/t1-create-cupertino/t1-create-cupertino-validation-refusal.pngpublic/t1-create-cupertino/t1-create-cupertino-accepted-success.png
The probe defaults to the Material host; PROBE_HOST=cupertino,
PROBE_WIDTH/PROBE_HEIGHT, PROBE_SCALE and PROBE_CAPTURE_PREFIX select the
other evidence above. The driver types the name once and retries Create after the
server refusal, so the same typed name is retained and then accepted.
Task diff
?? app/lib/features/templates/ui/template_create_dialog.dart
?? app/lib/features/templates/ui/template_create_wording.dart
?? app/notes/T1-create.md
?? app/test/features/templates/ui/template_create_accessibility_test.dart
?? app/test/features/templates/ui/template_create_dialog_test.dart
?? app/test/features/templates/ui/template_create_flow_test.dart
?? app/test/features/templates/ui/template_create_test_support.dart
?? app/test/features/templates/ui/template_create_wording_test.dart
?? app/tool/template_create_probe.dart
?? app/tool/template_create_probe.mjs
All changes are additions in the working tree; no tracked file was modified and no other lane's work was changed. Nothing was staged, committed, pushed or deployed.
Honest limits
- Not wired into a gallery or shell: this slice exposes
showTemplateCreateDialog(...), as instructed. The manager owns registration and the real detail action. - Mobile (Android/iOS) is unverified: no Android/iOS build, emulator, device or ADB was used. The Cupertino captures are Chrome's rendering of the Cupertino widgets, not iOS; VoiceOver/TalkBack behaviour was not run.
- No real Pipelines server, credentials or operator pipeline was touched. Browser
evidence uses the in-process fixture gateway and no
submitreached a server. - The app's real dark shell theme was not exercised; both native hosts use semantic theme colours (the Cupertino capture happened to run in dark mode).
- Not committed/pushed/deployed; the candidate is the uncommitted working tree above.