fix(app): float content behind top bars and give each wide pane its own bar row
- Top-bar clearance helpers (withTopBarClearance, withBarClearance, SliverTopBarClearance, BelowTopBar, TopBarNotices); shell, DetailPane and the runs/pipelines/templates/artifacts/stage definition/filter/usage pages drop their top SafeArea and pad their own lists, pinned headers pin at the inset. - Wide windows: the shell bar narrows to the list pane (ShellPaneSplit) and the open item's bar shares its row; item tabs float at the pane's top (PageTabsEdge) instead of stacking on the shell's tab bar; the floating tab pill no longer swells over leftover media padding. - Pipeline detail is a DetailPane on wide too; Run/Runs move from FABs into the bar's actions; name and identity live in the title pill. - Run detail title pill shows the real title with Run N, pipeline and version (the pill links to the pipeline); the body keeps only status, actions and notices; standalone detail draws the same segmented bar. - One Runs tab badge: attention outranks running. - Tests for content-behind-bar padding and the no-stacking wide layout; notes/app-chrome-fixes.md.
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||
import 'package:pipelines_app/shell/detail_page.dart';
|
||||
|
||||
import 'fixtures.dart';
|
||||
import 'test_helpers.dart';
|
||||
@@ -44,38 +45,34 @@ void main() {
|
||||
expect(find.text('no runs recorded'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('the detail header is one identity line; Summary keeps facts', (
|
||||
tester,
|
||||
) async {
|
||||
testWidgets('the pane bar names the pipeline and its identity; the body '
|
||||
'repeats neither', (tester) async {
|
||||
final fixture = PipelineFixture();
|
||||
await pumpWide(tester, gatewayFor(fixture));
|
||||
await tester.tap(find.byKey(const Key('pipeline-row-1')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final pane = find.byType(DetailPane);
|
||||
final detail = find.byKey(const Key('pipeline-detail'));
|
||||
final header = find.byKey(const Key('pipeline-detail-header'));
|
||||
expect(header, findsOneWidget);
|
||||
expect(
|
||||
find.descendant(of: header, matching: find.text('Alpha review')),
|
||||
findsOneWidget,
|
||||
// No headline in the body: the title pill holds the name over the
|
||||
// recorded identity.
|
||||
expect(find.byKey(const Key('pipeline-detail-header')), findsNothing);
|
||||
final title = find.descendant(
|
||||
of: pane,
|
||||
matching: find.text('Alpha review'),
|
||||
);
|
||||
final identity = find.text('id 1 · v2 · 2 stages');
|
||||
expect(title, findsOneWidget);
|
||||
expect(identity, findsOneWidget);
|
||||
expect(
|
||||
find.descendant(of: header, matching: find.text('id 1 · v2 · 2 stages')),
|
||||
find.descendant(of: detail, matching: find.text('Alpha review')),
|
||||
findsNothing,
|
||||
);
|
||||
// The recorded identity now sits at the top of the Summary tab.
|
||||
expect(find.text('id 1 · v2 · 2 stages'), findsOneWidget);
|
||||
expect(find.descendant(of: detail, matching: identity), findsNothing);
|
||||
// The identity is the pill's subtitle, under the name.
|
||||
expect(
|
||||
tester
|
||||
.getTopLeft(
|
||||
find.descendant(
|
||||
of: header,
|
||||
matching: find.text('Alpha review'),
|
||||
),
|
||||
)
|
||||
.dx -
|
||||
tester.getTopLeft(detail).dx,
|
||||
12,
|
||||
tester.getTopLeft(identity).dy,
|
||||
greaterThan(tester.getTopLeft(title).dy),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -106,14 +106,15 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.bySemanticsLabel('View runs of Alpha review'), findsOneWidget);
|
||||
// Run and Runs share one action row, as the web's pipeline actions.
|
||||
// Run and Runs float at the bottom right, Runs above the primary Run.
|
||||
// Run and Runs share the detail pane's actions pill at the top right,
|
||||
// Runs before the primary Run; nothing floats over the content.
|
||||
final runs = tester.getRect(find.byKey(const Key('pipeline-view-runs')));
|
||||
final run = tester.getRect(find.byKey(runPipelineActionKey));
|
||||
final screen = tester.view.physicalSize / tester.view.devicePixelRatio;
|
||||
expect(runs.bottom, lessThanOrEqualTo(run.top));
|
||||
expect(runs.right, lessThanOrEqualTo(run.left));
|
||||
expect((runs.center.dy - run.center.dy).abs(), lessThan(1));
|
||||
expect(run.right, greaterThan(screen.width - 40));
|
||||
expect(run.bottom, greaterThan(screen.height - 120));
|
||||
expect(run.bottom, lessThan(screen.height / 4));
|
||||
await tester.tap(find.byKey(const Key('pipeline-view-runs')));
|
||||
expect(opened, [1]);
|
||||
});
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
|
||||
import 'package:pipelines_app/shell/detail_page.dart';
|
||||
|
||||
/// Wide screens deliberately repeat the selected title in the visible list.
|
||||
Finder runDetailText(String text) =>
|
||||
find.descendant(of: find.byType(RunDetailView), matching: find.text(text));
|
||||
/// The run's title is in its top bar: the detail pane's (or page's) when the
|
||||
/// detail sits in one, else the run detail's own.
|
||||
Finder runDetailText(String text) => find.descendant(
|
||||
of: find.byWidgetPredicate(
|
||||
(widget) => widget is RunDetailView || widget is DetailPane,
|
||||
),
|
||||
matching: find.text(text),
|
||||
);
|
||||
|
||||
/// Stage identity and visit coordinates are separate rendered fields now.
|
||||
void expectVisitHeading(WidgetTester tester, String stage, num sequence) {
|
||||
|
||||
@@ -89,7 +89,11 @@ void main() {
|
||||
await tester.tap(find.byKey(runPipelineLinkKey));
|
||||
await tester.pump();
|
||||
expect(opened, [(10, 3)]);
|
||||
expect(find.bySemanticsLabel('Open pipeline nightly'), findsOneWidget);
|
||||
// The run's title pill is the link, announced as opening the pipeline.
|
||||
expect(
|
||||
find.bySemanticsLabel(RegExp('Open pipeline nightly')),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('$host: a succeeded run offers no Retry', (tester) async {
|
||||
|
||||
@@ -147,11 +147,12 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(find.text('Nightly build'), findsOneWidget);
|
||||
expect(find.textContaining('Original prompt'), findsNothing);
|
||||
// Both hosts lead with the web's status kicker above the title.
|
||||
// The title is the top bar's; the status kicker leads the body below
|
||||
// it, and the body does not repeat the title.
|
||||
expect(find.byKey(const Key('run-status-kicker')), findsOneWidget);
|
||||
expect(
|
||||
tester.getTopLeft(find.byKey(const Key('run-status-kicker'))).dy,
|
||||
lessThan(tester.getTopLeft(find.text('Nightly build')).dy),
|
||||
greaterThan(tester.getBottomLeft(find.text('Nightly build')).dy),
|
||||
);
|
||||
// Input and Output are sticky collapsibles on both hosts.
|
||||
expect(
|
||||
|
||||
@@ -119,6 +119,7 @@ void main() {
|
||||
'input': {'prompt': 'initial prompt'},
|
||||
});
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
|
||||
expect(runDetailText('Alpha run'), findsOneWidget);
|
||||
expect(find.text('Input'), findsOneWidget);
|
||||
@@ -159,6 +160,7 @@ void main() {
|
||||
expect(gateway.detailRequests[2], hasLength(1));
|
||||
gateway.replyDetail(2, 0, {'id': 2, 'title': 'Beta run'});
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(runDetailText('Beta run'), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('run-row-1')), findsOneWidget);
|
||||
});
|
||||
@@ -251,6 +253,7 @@ void main() {
|
||||
expect(gateway.detailRequests[2], hasLength(1));
|
||||
gateway.replyDetail(2, 0, {'id': 2, 'title': 'Beta run'});
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(runDetailText('Beta run'), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(_materialScreen(gateway, initialRunId: 1));
|
||||
@@ -258,6 +261,7 @@ void main() {
|
||||
expect(gateway.detailRequests[1], hasLength(1));
|
||||
gateway.replyDetail(1, 0, {'id': 1, 'title': 'Alpha run'});
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(runDetailText('Alpha run'), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(_materialScreen(gateway));
|
||||
@@ -274,6 +278,7 @@ void main() {
|
||||
await _mountList(tester, gateway);
|
||||
gateway.replyDetail(2, 0, {'id': 2, 'title': 'Beta run'});
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(runDetailText('Beta run'), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(
|
||||
@@ -291,6 +296,7 @@ void main() {
|
||||
'status': 'succeeded',
|
||||
});
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(runDetailText('Beta run'), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('run-row-1')), findsOneWidget);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user