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:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user