Merge commit 'ba1cbccdf28e6e57862fc3f50474b1da93a0d6b8' into pipelines/run-20261110-2153-desktop-menus-2b-5-on-desktop-the-files-4544

This commit is contained in:
2026-11-10 22:25:57 +00:00
17 changed files with 458 additions and 580 deletions
+45
View File
@@ -113,6 +113,51 @@ void main() {
expect(find.text('Details body'), findsOneWidget);
});
testWidgets('wide: details taller than the app scroll inside the dialog', (
tester,
) async {
_size(tester, const Size(1280, 600));
await tester.pumpWidget(
MaterialApp(
home: Builder(
builder: (context) => TextButton(
onPressed: () => showAppDetails<void>(
context,
builder: (_) => Column(
mainAxisSize: MainAxisSize.min,
children: [
for (var i = 0; i < 30; i++)
SizedBox(height: 48, child: Text('Row $i')),
],
),
),
child: const Text('Open'),
),
),
),
);
await tester.tap(find.text('Open'));
await tester.pumpAndSettle();
expect(tester.takeException(), isNull);
final dialog = tester.getRect(
find
.descendant(of: find.byType(Dialog), matching: find.byType(Material))
.first,
);
expect(dialog.height, lessThanOrEqualTo(600 * 0.85));
await tester.scrollUntilVisible(
find.text('Row 29'),
200,
scrollable: find
.descendant(
of: find.byType(Dialog),
matching: find.byType(Scrollable),
)
.first,
);
expect(find.text('Row 29').hitTestable(), findsOneWidget);
});
testWidgets('phone: both are bottom sheets', (tester) async {
_size(tester, const Size(430, 900));
final picked = <String>[];
@@ -1,80 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/floating/floating_layer.dart';
void main() {
testWidgets('the layer last pressed or focused paints on top', (
tester,
) async {
tester.view.physicalSize = const Size(800, 600);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final hits = <String>[];
final focus = FocusNode();
addTearDown(focus.dispose);
Widget window(String name, double left, {FocusNode? node}) => Positioned(
left: left,
top: 100,
width: 200,
height: 200,
child: Focus(
focusNode: node,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => hits.add(name),
child: const SizedBox.expand(),
),
),
);
var behind = 0;
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Stack(
children: [
Positioned.fill(
child: GestureDetector(
onTap: () => behind++,
child: const ColoredBox(color: Colors.white),
),
),
// Nested inside a page, like the chat workspace.
Positioned.fill(
child: FloatingLayer(
coverOverlay: true,
builder: (context, bounds) => [
window('chat', 100, node: focus),
],
),
),
Positioned.fill(
child: FloatingLayer(
builder: (context, bounds) => [window('terminal', 200)],
),
),
],
),
),
),
);
const overlap = Offset(250, 200);
await tester.tapAt(overlap);
expect(hits.last, 'terminal');
await tester.tapAt(const Offset(120, 200));
await tester.pump();
await tester.tapAt(overlap);
expect(hits.last, 'chat');
await tester.tapAt(const Offset(380, 200));
await tester.pump();
await tester.tapAt(overlap);
expect(hits.last, 'terminal');
focus.requestFocus();
await tester.pump();
await tester.pump();
await tester.tapAt(overlap);
expect(hits.last, 'chat');
// Space between windows passes through to the page.
await tester.tapAt(const Offset(700, 500));
expect(behind, 1);
});
}