feat(app): open a pipeline stage from its URL
The route `/pipelines/:id[/:version]/stage/:key` now opens the pipeline detail's Graph tab with the named stage selected and its authored definition pane for the pinned version. A key the pinned definition does not declare opens the Graph tab with nothing selected and no pane; no key keeps the ordinary Summary tab. The request is scoped to the pipeline and version the URL names, consumed once the named pin's first reply is shown, and never replayed by a re-read, a later version switch or a different pipeline. A route change from a pin to latest re-reads latest, matching the web's requested-version rule.
This commit is contained in:
@@ -212,6 +212,7 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
||||
onRunStarted: _runStarted,
|
||||
initialPipelineId: route.pipelineId,
|
||||
initialVersion: route.version,
|
||||
initialStageKey: route.stageKey,
|
||||
),
|
||||
AppDestination.runs: (_) => RunsDestination(
|
||||
session: _session,
|
||||
|
||||
@@ -21,6 +21,7 @@ class PipelinesDestination extends StatelessWidget {
|
||||
this.onRunStarted,
|
||||
this.initialPipelineId,
|
||||
this.initialVersion = 0,
|
||||
this.initialStageKey,
|
||||
});
|
||||
|
||||
final AppSession session;
|
||||
@@ -38,6 +39,9 @@ class PipelinesDestination extends StatelessWidget {
|
||||
final int? initialPipelineId;
|
||||
final int initialVersion;
|
||||
|
||||
/// The definition stage a deep link names, or null for no stage request.
|
||||
final String? initialStageKey;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AnimatedBuilder(
|
||||
animation: session,
|
||||
@@ -75,6 +79,7 @@ class PipelinesDestination extends StatelessWidget {
|
||||
onRunStarted: onRunStarted,
|
||||
initialPipelineId: initialPipelineId,
|
||||
initialVersion: initialVersion,
|
||||
initialStageKey: initialStageKey,
|
||||
// A reconnect or an accepted template create both advance this counter;
|
||||
// either change re-reads through the mounted controller.
|
||||
syncToken: session.connectionEpoch + refreshToken,
|
||||
|
||||
Reference in New Issue
Block a user