Keep phone pages and window pages for turn changes and shell history

A dialog only in the tiled app on a wide layout: a phone keeps its
full-screen page (run 304 had turned it into a sheet and rewritten the
tests), and a floating window opens it as a page of that window so a diff
or command output it opens stays in the window.
This commit is contained in:
2026-11-10 22:56:32 +00:00
parent 122c849281
commit 3a0577cba0
4 changed files with 67 additions and 11 deletions
@@ -1,3 +1,4 @@
import '../../../shell/windows/window_scope.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -48,10 +49,31 @@ class ChatShellHistoryChip extends StatelessWidget {
}
Future<void> _open(BuildContext context, bool cupertino) {
return showAppDetails<void>(
context,
builder: (_) =>
ChatShellHistoryView(controller: controller, runIds: runIds),
// A dialog in the tiled app on a wide layout. A phone keeps the
// full-screen page, and a floating window opens it as a page of that
// window, so what it opens next (a diff, a command's output) stays in
// the window too.
if (usesDesktopPopups(context) && WindowScope.maybeOf(context) == null) {
return showAppDetails<void>(
context,
builder: (_) =>
ChatShellHistoryView(controller: controller, runIds: runIds),
);
}
return Navigator.of(context).push<void>(
MaterialPageRoute<void>(
fullscreenDialog: true,
builder: (_) => Scaffold(
appBar: AppBar(title: const Text(chatShellHistoryTitle)),
body: SafeArea(
child: ChatShellHistoryView(
controller: controller,
runIds: runIds,
inSheet: false,
),
),
),
),
);
}
}