feat(app): an open pipeline, run or chat fills a phone screen; Back steps up one level; stage tabs end with Session

This commit is contained in:
2026-10-23 22:49:21 +01:00
parent dd324d1f92
commit 0e6db03903
9 changed files with 104 additions and 108 deletions
+20 -1
View File
@@ -213,8 +213,13 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
notifyListeners();
}
/// Back (Android's button, the browser's): close whatever page sits on top
/// first, then step up one level — a stage to its run or pipeline, a run,
/// pipeline or chat to its list — and only leave the app from a list.
@override
Future<bool> popRoute() async {
final navigator = _navigatorKey.currentState;
if (navigator != null && await navigator.maybePop()) return true;
if (searchOpen) {
closeSearch();
return true;
@@ -227,10 +232,24 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
closeTemplates();
return true;
}
if (_route.runId != null) {
final runId = _route.runId;
if (runId != null && _route.stageKey != null) {
goTo(AppRoute.run(runId));
return true;
}
if (runId != null) {
onPopToRuns();
return true;
}
final pipelineId = _route.pipelineId;
if (_route.kind == AppRouteKind.pipelines && pipelineId != null) {
goTo(
_route.stageKey != null
? AppRoute.pipeline(pipelineId, version: _route.version)
: AppRoute.pipelines,
);
return true;
}
if (_route.chatSessionId != null) {
onPopToChat();
return true;
+4
View File
@@ -410,6 +410,10 @@ class _PipelinesAppState extends State<PipelinesApp>
final chatRoute = tab(AppDestination.chat);
return AdaptiveShell(
attentionCount: attentionCount,
detailOpen:
route.runId != null ||
route.chatSessionId != null ||
(route.kind == AppRouteKind.pipelines && route.pipelineId != null),
cupertino: _cupertino,
destination: _destinationOf(route.kind),
onDestinationSelected: _selectDestination,