Files
pipelines/app/notes/P2-tab.md
T

76 lines
4.2 KiB
Markdown

# Pipeline detail Graph tab — pinned definition wiring
Candidate for the graph-tab slice. All work is under `app/`; no commit, push,
deployment or production mutation was made.
## Implemented
- `PipelineDetail` retains `graph` and optional `shape` as raw JSON from the
reply. Source, versions and every existing field keep their previous parsing;
an absent graph stays `null` rather than becoming an empty definition.
- The detail panel gives its tabs the remaining bounded height: Summary and
Source scroll inside that slot, the Graph tab fills it.
- `PipelineGraphTab` renders the landed `DefinitionGraphView` (measured nodes,
routed edges/labels, stock pan/zoom) and the web's guidance vocabulary adapted
to host gestures. Selecting any node, including `Success`/`Failure`, opens the
landed `openStageDefinition` pane with the pinned pipeline id, name and
resolved version. No run status or visited styling is read.
- The selected node key lives in `PipelineDetailPanel`, not in the tab, so a
Summary/Source round trip keeps the mark (the web keeps its
`pipelineGraphSelection` across in-place tab changes). A different pipeline or
resolved version clears it, including an in-place reconnect reload that keeps
a detail rather than nulling it.
- A reply without `graph` states that the definition is missing and draws
nothing. Empty definitions still get `This pipeline has no stages.` from the
graph view.
- The obsolete P2 `graphBuilder`/`PipelineStageRef` hook and its pending-state
test were removed; the production shell never supplied one.
## Bounded-height fix (review must-fix)
The first candidate made the guidance note a fixed child above
`Expanded(DefinitionGraphView)`. When the tab slot was shorter than the note,
the column overflowed and the canvas was laid out at 0 height (390x600 @2x,
1100x400 @2x, 1100x900 @3x), and the note also took most of the slot at
390x844 @2x.
- `PipelineGraphTab` now measures the slot with `LayoutBuilder` and caps the note
at `pipelineGraphNoteShare` (one third). A note longer than its share scrolls
inside it, so the canvas always keeps at least two thirds and can never be
zero. At ordinary sizes the note keeps its natural height.
- `PipelineDetailPanel` keeps a `kPipelineDetailMinContentHeight` reserve for the
selected tab and lets the header/banners/tabs scroll when a very short panel
(for example 390x300 @3x) would otherwise squeeze the tab away. Normal sizes
keep the header's natural height.
- Regression tests cover 390x844 @2x, 390x600 @2x, 1100x400 @2x, 1100x900 @3x,
an empty definition in a 200 px slot, and the 390x300 @3x panel header.
- The test fixture now pins a distinct v1 graph, so the version-switch test
proves the mark is cleared rather than reusing the newer definition.
## Checks
- `flutter analyze` — no issues.
- `flutter test test/features/pipelines test/features/graph` — 198 pass.
- `flutter test` — 788 pass.
- `flutter build web` — pass.
- Review repro (`public/review/graph_tab_overflow_repro_test.dart`): all 4
cases now pass, including the three that failed before the fix.
- Browser fixture (`tool/pipeline_graph_tab_probe.dart`,
`tool/pipeline_graph_tab_probe.mjs`), actual `PipelinesScreen` with the
in-memory fixture gateway, dark, both hosts, at 1280x900 @2x, plus Material at
390x844 @2x, 390x600 @2x and 1100x900 @3x: every run 4 checks and 3 PNG
captures. Captures and JSON:
`/Users/alan/.local/share/pipelines/data/artifacts/85/public/pipeline-graph-tab-probe-fixed/`
- Not verified: live authenticated server, Android/iOS builds or devices, shell
URL routing for graph selection. Initial fit-to-viewport is not implemented
(the web auto-fits on mount); pan/zoom and the guidance note cover discovering
off-screen nodes, and the now-larger canvas keeps more of the graph in view.
## Manager completion after the Code deadline
The last Code visit reached its deadline while active; the retained tree is
complete and its pipelines suite passes (62 tests), including the 390x844/2x,
short-slot and pinned-definition cases. Manager merged it directly: the Graph tab
now renders the measured definition canvas in a bounded slot and opening a node
shows its authored definition for the pinned version. No run evidence is implied.