5.8 KiB
P2 stage: read-only definition pane
The definition graph can now open one stage's authored definition without
reading a run. StageDefinitionView receives the graph JsonMap pinned for a
pipeline/version, a stage key and that identity; it performs no request and
shows no visit, status or session data. openStageDefinition pushes the
platform's normal page with one navigation bar and its standard back control,
for the manager's graph hook.
Behaviour
- Fields match
stageDefinitionFields/terminalFieldsinweb/src/graph.js: Type, Prompt, Output, Outcomes (ordered, targets resolved, terminals marked), configs in sorted order with the web labels, Tools, Max visits, Limit on, Memory, Notify on/destination/artifacts. Only non-blank fields are emitted. effectiveStageTypekeeps the web rule that a blank/absent type readsmodel; no other default is invented.- A terminal (
#success/#failure) lists its incoming definition routes and says explicitly that these are definition targets, not recorded visits. Its page is titled with the web's display label (Failure definition/Success definition, vianodeDisplayLabel), never the raw#failurekey. - A stage key this version does not declare gets an explicit missing state. No fields, terminal note or raw JSON are fabricated.
- Every declared stage also shows its exact pretty-printed stage JSON in a selectable raw section, so unknown/future fields stay available. The raw value is the only source for those keys; the structured rows only interpret documented ones.
- Host text roles only: Material
Theme/ColorScheme, CupertinoCupertinoTheme/CupertinoColors, system fonts, light/dark and text scale follow the host. No palette, font family, fixed component size or custom control clone. - Selectable body blocks force a strut derived from that same host style.
Without it, a glyph the host font lacks (the outcomes arrow
→) pulls in a fallback font with taller metrics and doubles only that block's leading. The strut is the host's own family/size, not a font override or fixed height, and selection stays native.
UI review fixes
- Cupertino
Outcomesleading: the block's rendered line pitch matched a fallback font (34 px between outcome lines against 19 px forToolsat 1×, 68 px against 30 px at 2×). With the forced host strut the line pitch is 19 px for both blocks at 1× and 37/39 px at 2×, and the semantics block heights are equal (72/72 at 1×, 123/123 at 2×). The 390×844 / 2× wrap of(terminal)now sits on the same rhythm as the line above it. - Terminal titles:
#failure definition/#success definitionbecameFailure definition/Success definition. The Cupertino widget test now assertsSuccess definitionand the absence of the raw key; a Material test coversFailure definition; the browser probe fails if#failurereappears in the terminal page or if the outcomes/Tools block heights diverge.
Integration dependency
PipelineDetail still has no graph field, so the manager's graph hook must
supply the pinned JsonMap it already draws. This item deliberately does not
change the pipeline repository/model. There is no run-mode latest-visit pane
here; recorded visits remain the separate run-graph/audit work.
Checks run
flutter test test/features/graph- 140 tests passed (138 before; two new regression tests for the terminal title and the forced host strut).flutter analyze- no issues.dart format --set-exit-if-changedon the five Dart files - 0 changed.flutter build web(normal app) - succeeded.flutter build web -t tool/stage_definition_probe.dart- succeeded.node --check tool/stage_definition_probe.mjs.- Real Chrome probe, 1280x900: material dark/light 1x, Cupertino dark/light 1x
and Cupertino dark/light 2x. Each case passed 9 checks and produced 5
captures. The probe now compares the
OutcomesandToolssemantics block heights (equal in every case), fails on any raw#failurein the terminal page, assertsFailure definition, and scrolls to the pane bottom so the raw capture really showsfuture_field.keptandfallback_error. - Real Chrome probe, 390x844: Cupertino dark 2x and Material light 1x. Each
passed 8 checks and produced 5 captures, including the
(terminal)wrap and the raw JSON at the narrow width. The accent-free rhythm check is skipped at this width because the outcomes value wraps to three lines. - Pixel measurement of the final captures: Cupertino 1x outcomes 19 px vs Tools 19 px (was 34 vs 19); Cupertino 2x outcomes 37 px vs Tools 39 px (was 68 vs 30); Material 1x outcomes 19 px vs Tools 20 px.
Captures (under the run's shared artifact folder
public/stage-definition/): <host>-<scheme>-<scale>x-{declared,raw,terminal,unknown,closed}.png
for the six 1280x900 cases, and the same names prefixed with stage-definition-
under narrow-390x844/ for the two 390x844 cases. The raw capture is the real
bottom-scrolled state and its sha1 differs from the declared capture in every
case.
Mobile (Android/iOS) remains unverified; only web was run.
Manager completion after result-validation failure
Run 77's final Review visit returned no parseable outcome, so the runner retained its edits and failed the stage without undoing them. No retry was started. The manager verified the dirty files were the reviewed slice only, ran the focused domain/view tests (10 pass), and drove the real-browser probe on both hosts: Material light 1x desktop and Cupertino dark 2x 390x844. Each run passed and produced five captures (declared, raw, terminal, unknown, closed) under approved temp/stage-def-browser. The Cupertino dark 2x declared pane was inspected: pinned identity, wrapping outcome line, native type roles, readable secondary labels. This remains a definition pane only; run visits and the pipeline graph hook are separate work.