Add first-run walkthrough

Guide new users through connecting a server, configuring an agent harness, starting runs, and chatting with agents. Persist completion per device and offer the walkthrough again for empty servers or from Settings, with widget coverage and implementation notes.
This commit is contained in:
2026-11-12 02:23:15 +00:00
parent 2330f50268
commit 30ba70ade8
14 changed files with 1430 additions and 26 deletions
+39 -25
View File
@@ -28,6 +28,8 @@ import '../features/runs/ui/run_search_selection.dart';
import '../features/search/domain/search_target.dart';
import '../features/settings/settings_screen.dart';
import '../features/settings/settings_store.dart';
import '../features/walkthrough/walkthrough_gate.dart';
import '../features/walkthrough/walkthrough_store.dart';
import '../features/updates/app_updates.dart';
import '../features/updates/launch_update.dart';
import '../features/updates/launch_update_dialog.dart';
@@ -579,6 +581,10 @@ class _PipelinesAppState extends State<PipelinesApp>
_attentionCount.value = count;
}
/// The device's first-run walkthrough record (per device, not per server).
final WalkthroughStore _walkthroughStore =
const SharedPreferencesWalkthroughStore();
@override
Widget build(BuildContext context) => widget.servers == null
? MyApp.router(routerConfig: _config)
@@ -837,32 +843,40 @@ class _PipelinesAppState extends State<PipelinesApp>
_bodyRoutes[AppDestination.pipelines] ?? AppRoute.pipelines,
),
destinationBodies: {
AppDestination.pipelines: (_) => PipelinesDestination(
session: _session,
server: widget.server,
active: _destinationOf(route.kind) == AppDestination.pipelines,
legacyPendingEndpoints: widget.legacyPendingEndpoints,
refreshToken: _pipelinesRefresh,
onRunStarted: _runStarted,
onViewPipelineRuns: (id) =>
_delegate.goTo(AppRoute.runsForPipeline(id)),
onOpenSchedules: _delegate.openSchedules,
onOpenSettings: () => _delegate.goTo(AppRoute.settings),
// The open pipeline is part of the route, so Back steps out of it.
onSelectionChanged: (id) {
final current = _delegate.route;
if (current.kind != AppRouteKind.pipelines) return;
if (id == null) {
if (current.pipelineId != null) {
_delegate.goTo(AppRoute.pipelines);
AppDestination.pipelines: (_) => FirstRunWalkthroughGate(
store: _walkthroughStore,
enabled: _destinationOf(route.kind) == AppDestination.pipelines,
serverScope: _navigationScope,
connection: _session,
connected: () => _session.connected,
gateway: _session.client,
child: PipelinesDestination(
session: _session,
server: widget.server,
active: _destinationOf(route.kind) == AppDestination.pipelines,
legacyPendingEndpoints: widget.legacyPendingEndpoints,
refreshToken: _pipelinesRefresh,
onRunStarted: _runStarted,
onViewPipelineRuns: (id) =>
_delegate.goTo(AppRoute.runsForPipeline(id)),
onOpenSchedules: _delegate.openSchedules,
onOpenSettings: () => _delegate.goTo(AppRoute.settings),
// The open pipeline is part of the route, so Back steps out of it.
onSelectionChanged: (id) {
final current = _delegate.route;
if (current.kind != AppRouteKind.pipelines) return;
if (id == null) {
if (current.pipelineId != null) {
_delegate.goTo(AppRoute.pipelines);
}
} else if (current.pipelineId != id) {
_delegate.goTo(AppRoute.pipeline(id));
}
} else if (current.pipelineId != id) {
_delegate.goTo(AppRoute.pipeline(id));
}
},
initialPipelineId: pipelinesRoute.pipelineId,
initialVersion: pipelinesRoute.version,
initialStageKey: pipelinesRoute.stageKey,
},
initialPipelineId: pipelinesRoute.pipelineId,
initialVersion: pipelinesRoute.version,
initialStageKey: pipelinesRoute.stageKey,
),
),
// The one place a field or artifact hit's selection can be resolved: the
// run detail owns the recorded visit and Summary section.