Close the chrome gaps: content behind bars on Templates, run detail, stage page and Schedules; Search field fills the bar
- SegmentedBar.titleWidget (and ShellBar/ShellBarSpec titleWidget, backgroundColor): a bar's main pill can be an input in place of the title; Search uses it so the field fills the bar with Kind and info, capped at the result column width so field and results share edges on wide windows. - Templates page/frame drop the top SafeArea again (BelowTopBar gate, TopBarNotices banners); Cupertino uses the grouped background. - Settings on Cupertino in the shell publishes the grouped background so the bar scrim matches the page (no white band or seam). - TopGlassStrip: the run detail header (status, actions, decision, notices) and the Schedules search/filter toolbar float as glass under the bar; tabs and lists scroll behind both. - Stage page: stage title and Visit/Run subtitle in the bar, facts lead the Summary scroll, sections scroll behind the bar under floating tabs. - Tests for content-behind-bar on each page and the title-widget bar mode; notes/chrome-gaps-fixes.md.
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/application/templates_destination.dart';
|
||||
import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
||||
import 'package:pipelines_app/features/templates/screen.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_theme.dart';
|
||||
|
||||
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
||||
import '../features/pipelines/fixtures.dart';
|
||||
import 'pipelines_replies.dart';
|
||||
import 'templates_wiring_test.dart' show openSettings, openTemplates, pumpApp;
|
||||
|
||||
/// The app-level Templates page: one bar (Back + Refresh), the gallery and an
|
||||
/// open template reach the top edge, start below the bar at rest and scroll
|
||||
/// behind it. Cupertino draws inset-grouped rows on the grouped background.
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
final host = cupertino ? 'Cupertino' : 'Material';
|
||||
|
||||
testWidgets('$host: the gallery and detail scroll behind the bar', (
|
||||
tester,
|
||||
) async {
|
||||
final channel = FakeChannel()..readyCompleter.complete();
|
||||
final client = PipelinesClient(channelFactory: (_) => channel);
|
||||
final provider = PlatformRouteInformationProvider(
|
||||
initialRouteInformation: RouteInformation(uri: Uri.parse('/pipelines')),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: cupertino,
|
||||
);
|
||||
await replyPipelines(tester, channel, PipelineFixture());
|
||||
await openSettings(tester, channel, provider);
|
||||
await openTemplates(tester, channel, provider);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final bar = find.ancestor(
|
||||
of: find.byKey(templatesPageBackKey),
|
||||
matching: find.byType(SegmentedBar),
|
||||
);
|
||||
final barBottom = tester.getRect(bar).bottom;
|
||||
// One bar: Back and Refresh are its pieces.
|
||||
expect(
|
||||
find.descendant(of: bar, matching: find.byKey(templatesRefreshKey)),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
final gallery = find.byKey(templatesGalleryKey);
|
||||
expect(tester.getTopLeft(gallery).dy, 0);
|
||||
final row = find.byKey(templateRowKey('release'));
|
||||
expect(tester.getTopLeft(row).dy, greaterThanOrEqualTo(barBottom - 8));
|
||||
// Scrolling moves the row up behind the bar.
|
||||
final before = tester.getTopLeft(row).dy;
|
||||
await tester.drag(gallery, const Offset(0, -40));
|
||||
await tester.pump();
|
||||
expect(tester.getTopLeft(row).dy, lessThanOrEqualTo(before));
|
||||
|
||||
if (cupertino) {
|
||||
final scaffold = tester.widget<CupertinoPageScaffold>(
|
||||
find
|
||||
.ancestor(
|
||||
of: gallery,
|
||||
matching: find.byType(CupertinoPageScaffold),
|
||||
)
|
||||
.first,
|
||||
);
|
||||
expect(scaffold.backgroundColor, AppColors.groupedBackground);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: gallery,
|
||||
matching: find.byType(CupertinoListSection),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
}
|
||||
|
||||
await tester.tap(row);
|
||||
await tester.pumpAndSettle();
|
||||
final detail = find.byKey(templateDetailKey);
|
||||
expect(tester.getTopLeft(detail).dy, 0);
|
||||
expect(
|
||||
tester.getTopLeft(find.byKey(templateCreateActionKey)).dy,
|
||||
greaterThanOrEqualTo(barBottom - 8),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user