feat(app): open pipeline and template deep links and route search results

This commit is contained in:
2026-10-22 09:58:09 +01:00
parent edfcfb0bc9
commit 7aa7007aee
8 changed files with 119 additions and 7 deletions
+21
View File
@@ -27,6 +27,8 @@ class PipelinesScreen extends StatefulWidget {
this.embedded = false,
this.syncToken = 0,
this.onRunStarted,
this.initialPipelineId,
this.initialVersion = 0,
});
final ApiGateway gateway;
@@ -42,6 +44,12 @@ class PipelinesScreen extends StatefulWidget {
/// the existing run route. The feature never navigates on its own.
final ValueChanged<int>? onRunStarted;
/// The pipeline a deep link names, opened after the list read starts.
final int? initialPipelineId;
/// The pinned version for [initialPipelineId]; 0 means latest.
final int initialVersion;
@override
State<PipelinesScreen> createState() => _PipelinesScreenState();
}
@@ -54,6 +62,11 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
super.initState();
_controller = PipelinesController(PipelinesRepository(widget.gateway))
..load();
final id = widget.initialPipelineId;
if (id != null) {
// The detail read owns its own failure state; the list read continues.
_controller.openPipeline(id, version: widget.initialVersion);
}
}
@override
@@ -67,6 +80,14 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
// The socket was replaced; re-read through the existing controller so the
// selected pipeline and requested version survive the reconnect.
_controller.load();
} else if (oldWidget.initialPipelineId != widget.initialPipelineId ||
oldWidget.initialVersion != widget.initialVersion) {
final id = widget.initialPipelineId;
if (id != null) {
_controller.openPipeline(id, version: widget.initialVersion);
} else {
_controller.clearSelection();
}
}
}