Merge: tabs as separate round glass buttons
This commit is contained in:
@@ -127,7 +127,7 @@ void main() {
|
||||
);
|
||||
expect(navigator.canPop(), isTrue);
|
||||
expect(findNativeBack(), findsOneWidget);
|
||||
expect(find.byType(NavigationBar), findsNothing);
|
||||
expect(find.byType(FloatingDestinationBar), findsNothing);
|
||||
|
||||
await tester.pageBack();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -4,7 +4,6 @@ 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() {
|
||||
testWidgets('code-like values still use native host typography', (
|
||||
@@ -61,17 +60,14 @@ void main() {
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
// The host's own tab bar inside the shared glass pill.
|
||||
expect(
|
||||
find.byType(cupertino ? CupertinoTabBar : NavigationBar),
|
||||
findsOneWidget,
|
||||
);
|
||||
final pill = tester.getRect(find.byType(GlassPill));
|
||||
// One floating bar of separate round tab buttons.
|
||||
expect(find.byType(FloatingDestinationBar), findsOneWidget);
|
||||
final pill = tester.getRect(find.byKey(FloatingDestinationBar.rowKey));
|
||||
// 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(
|
||||
FloatingDestinationBar.rowWidth(
|
||||
cupertino: cupertino,
|
||||
tabs: PipelineDetailTab.values.length,
|
||||
),
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:pipelines_app/features/pipelines/pipeline_repository.dart';
|
||||
import 'package:pipelines_app/features/pipelines/pipelines_controller.dart';
|
||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||
import 'package:pipelines_app/features/pipelines/widgets/pipeline_detail_panel.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
|
||||
|
||||
import 'fixtures.dart';
|
||||
import 'test_helpers.dart';
|
||||
@@ -139,7 +140,7 @@ void main() {
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('pipeline-detail-tabs')),
|
||||
matching: find.byType(CupertinoTabBar),
|
||||
matching: find.byType(FloatingDestinationBar),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
@@ -6,7 +6,6 @@ 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';
|
||||
|
||||
@@ -63,7 +62,10 @@ void main() {
|
||||
// The tabs are the floating glass bar: on this 900px detail it is sized
|
||||
// to its tabs at the right edge, above the bottom.
|
||||
final pill = tester.getRect(
|
||||
find.descendant(of: strip, matching: find.byType(GlassPill)),
|
||||
find.descendant(
|
||||
of: strip,
|
||||
matching: find.byKey(FloatingDestinationBar.rowKey),
|
||||
),
|
||||
);
|
||||
expect(pill.right, 900 - 16);
|
||||
expect(pill.bottom, 1000 - 16);
|
||||
@@ -89,13 +91,16 @@ void main() {
|
||||
await pumpRunDetail(tester, platform, size: const Size(390, 844));
|
||||
final strip = find.byKey(const Key('run-detail-tabs'));
|
||||
final pill = tester.getRect(
|
||||
find.descendant(of: strip, matching: find.byType(GlassPill)),
|
||||
find.descendant(
|
||||
of: strip,
|
||||
matching: find.byKey(FloatingDestinationBar.rowKey),
|
||||
),
|
||||
);
|
||||
final body = find.byKey(const Key('run-detail-tab-body-summary'));
|
||||
// Sized to its tabs at the right, floating above the bottom.
|
||||
expect(
|
||||
pill.width,
|
||||
FloatingDestinationBar.pillWidth(
|
||||
FloatingDestinationBar.rowWidth(
|
||||
cupertino: platform != RunDetailTestPlatform.material,
|
||||
tabs: renderedRunDetailTabs.length,
|
||||
),
|
||||
@@ -125,7 +130,10 @@ void main() {
|
||||
|
||||
await pumpRunDetail(tester, platform, size: const Size(1000, 844));
|
||||
final widePill = tester.getRect(
|
||||
find.descendant(of: strip, matching: find.byType(GlassPill)),
|
||||
find.descendant(
|
||||
of: strip,
|
||||
matching: find.byKey(FloatingDestinationBar.rowKey),
|
||||
),
|
||||
);
|
||||
expect(widePill.right, 1000 - 16);
|
||||
expect(widePill.bottom, 844 - 16);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart'
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_facts.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_sections.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_session_state.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
|
||||
|
||||
import 'run_detail_graph_support.dart';
|
||||
import 'run_detail_visit_support.dart';
|
||||
@@ -241,7 +241,7 @@ void main() {
|
||||
final pill = tester.getRect(
|
||||
find.descendant(
|
||||
of: find.byType(RunVisitSectionStrip),
|
||||
matching: find.byType(GlassPill),
|
||||
matching: find.byKey(FloatingDestinationBar.rowKey),
|
||||
),
|
||||
);
|
||||
expect(pill.right, size.width - 16);
|
||||
|
||||
Reference in New Issue
Block a user