Float detail tabs at the bottom of the split detail pane and keep its bars below the status bar

This commit is contained in:
2026-10-31 12:41:18 +00:00
parent 1423159839
commit dbfecaa201
10 changed files with 341 additions and 49 deletions
+25 -12
View File
@@ -12,7 +12,8 @@ import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
/// Beside a list each pane owns its bar on one shared top row, and an open
/// item's tabs never stack on the shell's tab bar at the bottom.
/// item's tabs float at the bottom of its own pane, beside (never on) the
/// shell's tab bar over the list.
void main() {
Future<void> setSize(WidgetTester tester, Size size) async {
tester.view.physicalSize = size;
@@ -149,18 +150,20 @@ void main() {
expect(find.text('Its context'), findsOneWidget);
});
testWidgets('$host 1200: the item\'s tabs float under its bar, not on '
'the shell\'s tab bar', (tester) async {
testWidgets('$host 1200: the item\'s tabs float at the bottom of its '
'pane, beside the shell\'s tab bar', (tester) async {
await setSize(tester, const Size(1200, 800));
await tester.pumpWidget(shell(cupertino: cupertino));
await tester.pump();
await tester.pump();
final shellTabs = tester.getRect(
find.descendant(
of: find.byKey(const ValueKey('shell.destination.runs')).first,
matching: find.byType(Icon),
),
find
.ancestor(
of: find.byKey(const ValueKey('shell.destination.runs')).first,
matching: find.byType(GlassPill),
)
.first,
);
final itemTabs = tester.getRect(
find.descendant(
@@ -168,16 +171,26 @@ void main() {
matching: find.byType(GlassPill),
),
);
final body = tester.getRect(
find.byKey(const ValueKey('list-detail-body')),
);
// Near the bottom of the detail pane, never on the shell's tabs.
expect(itemTabs.bottom, closeTo(800 - kFloatingBarMargin, 0.5));
expect(itemTabs.left, greaterThanOrEqualTo(body.left));
expect(itemTabs.overlaps(shellTabs), isFalse);
// The item's list starts below its bar and clears its tabs at rest.
final paneBarPill = tester.getRect(
find.descendant(of: paneBar(), matching: find.byType(GlassPill)).first,
);
expect(itemTabs.top, greaterThanOrEqualTo(paneBarPill.bottom));
expect(itemTabs.top, lessThan(200));
expect(itemTabs.bottom, lessThan(shellTabs.top - 100));
// The item's list starts below its tabs at rest.
expect(
tester.getTopLeft(find.text('item row 0')).dy,
greaterThanOrEqualTo(itemTabs.bottom),
greaterThanOrEqualTo(paneBarPill.bottom),
);
expect(
MediaQuery.paddingOf(
tester.element(find.byKey(const Key('item-list'))),
).bottom,
greaterThanOrEqualTo(800 - itemTabs.top),
);
});
}