Compact floating tab bars with circular selection and equal edge gaps

The floating tab bar is now sized to its icon tabs at the bottom right on
every width, the selected icon sits in a tinted circle on both hosts, and
the gap from each outer circle to the pill's sides equals the gap to its
top, bottom and neighbours.
This commit is contained in:
2026-10-31 16:53:24 +00:00
parent 4235cd858f
commit 44ea45150f
9 changed files with 430 additions and 78 deletions
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/pipelines/widgets/pipeline_tabs.dart';
import 'package:pipelines_app/features/pipelines/widgets/pipeline_detail_styles.dart';
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
void main() {
@@ -66,14 +67,15 @@ void main() {
findsOneWidget,
);
final pill = tester.getRect(find.byType(GlassPill));
if (width < 600) {
expect(pill.left, 16);
expect(pill.right, width - 16);
} else {
// Sized to its three tabs at the right edge.
expect(pill.right, width - 16);
expect(pill.width, lessThan(width * 0.6));
}
// Sized to its three tabs at the right edge, on a phone as when wide.
expect(pill.right, width - 16);
expect(
pill.width,
FloatingDestinationBar.pillWidth(
cupertino: cupertino,
tabs: PipelineDetailTab.values.length,
),
);
for (final tab in PipelineDetailTab.values) {
final rect = tester.getRect(
find.byKey(ValueKey('pipeline-detail-tab-${tab.name}')),
@@ -5,6 +5,7 @@ import 'package:pipelines_app/features/runs/ui/run_more_menu.dart';
import 'package:pipelines_app/features/graph/widgets/run_graph_view.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_tab.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_tab_strip.dart';
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
import 'run_detail_graph_support.dart';
@@ -91,8 +92,14 @@ void main() {
find.descendant(of: strip, matching: find.byType(GlassPill)),
);
final body = find.byKey(const Key('run-detail-tab-body-summary'));
// Full width minus the margins, floating above the bottom.
expect(pill.left, 16);
// Sized to its tabs at the right, floating above the bottom.
expect(
pill.width,
FloatingDestinationBar.pillWidth(
cupertino: platform != RunDetailTestPlatform.material,
tabs: renderedRunDetailTabs.length,
),
);
expect(pill.right, 390 - 16);
expect(pill.bottom, 844 - 16);
// The tab's content reaches the bottom edge, behind the bar.
@@ -245,8 +245,8 @@ void main() {
final strip = tester.getRect(find.byType(RunVisitSectionStrip));
expect(strip.bottom, size.height, reason: section.name);
}
// The floating glass bar: full width on a phone, sized to its tabs
// at the right edge of a wide page.
// The floating glass bar: sized to its tabs at the right edge, on
// a phone as on a wide page.
final pill = tester.getRect(
find.descendant(
of: find.byType(RunVisitSectionStrip),
@@ -255,12 +255,8 @@ void main() {
);
expect(pill.right, size.width - 16);
expect(pill.bottom, size.height - 16);
if (size.width < 600) {
expect(pill.left, 16);
} else {
// (The test font draws every glyph a full em wide.)
expect(pill.width, lessThan(size.width * 0.7));
}
// Sized to its tabs at the right on every width.
expect(pill.width, lessThan(size.width * 0.7));
},
);
}