Merge commit 'f9eac4d6a3cc42a133ed74691d5cf2d6119633dc' into pipelines/run-20261112-0144-ctrl-tab-floating-chats-when-shown-else-c9bd

This commit is contained in:
2026-11-12 02:46:07 +00:00
115 changed files with 4484 additions and 677 deletions
@@ -390,19 +390,24 @@ void main() {
await app.stop(tester);
});
testWidgets('X closes the window and returns nothing to the tiling', (
tester,
) async {
testWidgets('X minimises the window: the chat stays open, returns nothing '
'to the tiling, and the chord brings the window back', (tester) async {
await _saved('a', 'b');
final app = _App(_Store());
await app.start(tester);
await _menu(tester, 'b', 'Float (Alt+Y)');
await tester.tap(find.byTooltip('Close'));
await tester.tap(find.byTooltip('Minimise'));
await tester.pumpAndSettle();
expect(app.floating, isEmpty);
// Still a window, hidden; not closed and not docked.
expect(app.floating, ['b']);
expect(app.windows.windows.single.minimized, isTrue);
expect(_shown('Chat b'), findsNothing);
expect(_workspace(tester).panes.map((p) => p.sessionId), ['a']);
expect(_thread('b'), findsNothing);
expect(app.gateway.calls.where((c) => c.type == 'chat_close'), isEmpty);
await _chord(tester);
expect(_shown('Chat b'), findsOneWidget);
expect(_thread('b').hitTestable(), findsOneWidget);
expect(app.floating, ['b']);
await app.stop(tester);
});
@@ -50,7 +50,7 @@ Future<void> _pumpShell(WidgetTester tester, Size size) async {
void main() {
for (final size in [const Size(1280, 800), const Size(800, 830)]) {
testWidgets('a wide window keeps the tab bar and list beside the open chat '
testWidgets('a wide window keeps the rail and list beside the open chat '
'at $size', (tester) async {
await _pumpShell(tester, size);
expect(
@@ -68,8 +68,10 @@ void main() {
find.byType(Navigator).first,
);
expect(navigator.canPop(), isFalse, reason: 'No page covers the shell');
expect(find.byType(NavigationRail), findsNothing);
expect(find.byType(FloatingDestinationBar), findsOneWidget);
// Both sizes are wide enough for the rail (the shell's own bar and list
// beside the open chat sit to its right).
expect(find.byType(NavigationRail), findsOneWidget);
expect(find.byType(FloatingDestinationBar), findsNothing);
expect(find.byKey(const ValueKey('chat-thread-a')), findsOneWidget);
expect(find.text('Second chat'), findsOneWidget);
expect(
@@ -11,7 +11,7 @@ void main() {
testWidgets('chat list stays above labeled navigation ($scale)', (
tester,
) async {
tester.view.physicalSize = const Size(1200, 900);
tester.view.physicalSize = const Size(640, 900);
tester.view.devicePixelRatio = 1;
tester.platformDispatcher.textScaleFactorTestValue = scale;
addTearDown(tester.view.reset);
@@ -87,7 +87,13 @@ void main() {
),
same(scrollable),
);
expect(scrollable.position.pixels, closeTo(retainedOffset, .5));
// The list is narrower at 640 (no rail) than beside the rail, so its
// rows re-wrap into a shorter scroll extent: the offset is kept up to
// that extent, and no further.
final kept = retainedOffset < scrollable.position.maxScrollExtent
? retainedOffset
: scrollable.position.maxScrollExtent;
expect(scrollable.position.pixels, closeTo(kept, .5));
expect(tester.takeException(), isNull);
});
}
@@ -106,7 +106,16 @@ void main() {
expect(find.text('Menu'), findsOneWidget);
await tester.tap(find.text('Menu'));
await tester.pumpAndSettle();
await tester.tap(find.text('Runs'));
// The menu's own row: the rail labels Runs too, so take the text that
// is not in the rail.
await tester.tap(
find.byElementPredicate(
(element) =>
element.widget is Text &&
(element.widget as Text).data == 'Runs' &&
element.findAncestorWidgetOfExactType<NavigationRail>() == null,
),
);
await tester.pumpAndSettle();
expect(find.text('Runs destination'), findsOneWidget);
await tester.tap(find.byTooltip('Chat'));