Remove shared backdrop from main tab labels

This commit is contained in:
2026-11-07 22:01:40 +00:00
parent 6e4e11aca2
commit cd034db77a
4 changed files with 58 additions and 46 deletions
+19
View File
@@ -5,6 +5,7 @@ import 'package:pipelines_app/shell/list_detail_policy.dart';
import 'package:pipelines_app/shell/adaptive_shell.dart';
import 'package:pipelines_app/shell/destination.dart';
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
import 'package:pipelines_app/ui/adaptive/floating_destination_labels.dart';
/// Main navigation keeps visible captions and full-size targets, floating at
/// the trailing edge on a phone and centered under the list on a wide window.
@@ -39,6 +40,22 @@ void main() {
expect(bounds.width - contentBounds!.width, inInclusiveRange(0, 32));
}
Future<void> expectNoSharedBackdrop(WidgetTester tester) async {
expect(
find.descendant(
of: find.byType(FloatingDestinationLabels),
matching: find.byWidgetPredicate(
(widget) =>
widget is DecoratedBox &&
widget.decoration is BoxDecoration &&
(widget.decoration as BoxDecoration).borderRadius ==
BorderRadius.circular(16),
),
),
findsNothing,
);
}
Future<void> setSize(WidgetTester tester, Size size) async {
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1;
@@ -80,6 +97,7 @@ void main() {
await tester.pumpWidget(shell(cupertino: cupertino));
final rect = tester.getRect(pill());
await expectLabeledTargets(tester, rect);
await expectNoSharedBackdrop(tester);
expect(rect.width, lessThanOrEqualTo(390 - 2 * 16));
expect(rect.right, 390 - 16);
expect(rect.bottom, 844 - 16);
@@ -111,6 +129,7 @@ void main() {
expect(rect.width, lessThan(1200 * 0.6));
// Captions participate in the bar's content-driven width.
await expectLabeledTargets(tester, rect);
await expectNoSharedBackdrop(tester);
expect(
rect.width,
lessThanOrEqualTo(listDetailListWidth(1200, 1200, null) - 2 * 16),