Merge branch 'worktree-agent-a75e04ded5a42e4fb' into integrate/detail-bodies

# Conflicts:
#	app/lib/features/runs/ui/run_detail_timeline.dart
This commit is contained in:
2026-10-31 12:42:39 +00:00
23 changed files with 867 additions and 386 deletions
@@ -0,0 +1,91 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_tab.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_visit_sections.dart';
import 'package:pipelines_app/features/runs/ui/runs_controller.dart';
import 'package:pipelines_app/ui/adaptive/floating_bar_layout.dart';
import 'package:pipelines_app/ui/layout/section_heading.dart';
import 'run_detail_graph_support.dart';
import 'run_detail_visit_support.dart';
/// The run and stage detail bodies are flat on the page on both hosts: no
/// Cupertino inset group (so none nested in another), pinned headings on the
/// page colour, and beside a list one row of tabs and header.
void main() {
for (final platform in RunDetailTestPlatform.values) {
testWidgets('${platform.name} Summary and Timeline draw no grouped '
'card', (tester) async {
await pumpRunDetail(tester, platform);
expect(find.byType(CupertinoListSection), findsNothing);
await openRunDetailTab(tester, RunDetailTab.timeline);
expect(find.byType(CupertinoListSection), findsNothing);
expect(tester.takeException(), isNull);
});
testWidgets('${platform.name} the stage Session nests no group in a '
'group', (tester) async {
await openVisit(tester, platform);
await openVisitTab(tester, RunVisitSection.session);
expect(find.text('Turn documents'), findsOneWidget);
expect(find.byType(CupertinoListSection), findsNothing);
});
testWidgets('${platform.name} beside a list the tabs and the header '
'share one row', (tester) async {
tester.view.physicalSize = const Size(720, 900);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final gateway = RunDetailFakeGateway(graphRunFixture());
final controller = RunsController(RunsRepository(gateway));
addTearDown(controller.dispose);
await controller.select(51);
final view = PageTabsEdge(
edge: FloatingBarEdge.top,
child: RunDetailView(
controller: controller,
gateway: gateway,
onBack: () {},
),
);
await tester.pumpWidget(
platform == RunDetailTestPlatform.material
? MaterialApp(home: Scaffold(body: view))
: CupertinoApp(home: CupertinoPageScaffold(child: view)),
);
await tester.pumpAndSettle();
final tabs = tester.getRect(find.byKey(const Key('run-detail-tabs')));
final header = tester.getRect(find.byKey(const Key('run-detail-header')));
// Side by side, not stacked: the header starts after the tabs and
// overlaps them vertically.
expect(header.left, greaterThanOrEqualTo(tabs.right - 12));
expect(header.top, lessThan(tabs.bottom));
expect(header.bottom, greaterThan(tabs.top));
expect(tester.takeException(), isNull);
});
}
testWidgets('Cupertino pinned headings take the page colour', (tester) async {
for (final brightness in Brightness.values) {
late SectionHeadingStyle style;
late Color page;
await tester.pumpWidget(
CupertinoApp(
theme: CupertinoThemeData(brightness: brightness),
home: Builder(
builder: (context) {
style = SectionHeadingStyle.of(context);
page = CupertinoTheme.of(context).scaffoldBackgroundColor;
return const SizedBox.shrink();
},
),
),
);
expect(style.background, page, reason: '$brightness');
}
});
}
@@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -132,10 +133,12 @@ void main() {
size: const Size(900, 1600),
);
for (final label in recordedLabels) {
// The bar's subtitle names the pipeline, so no Pipeline fact repeats it.
for (final label in recordedLabels.where((l) => l != 'Pipeline')) {
expect(find.text(label), findsOneWidget, reason: label);
}
expect(find.text('id 3 · v2'), findsOneWidget);
expect(find.text('Pipeline'), findsNothing);
expect(find.text('id 3 · v2'), findsNothing);
expect(find.text('review'), findsOneWidget);
expect(find.text('/srv/workspaces/run-51'), findsOneWidget);
expect(find.text('abc123def456'), findsOneWidget);
@@ -199,6 +202,28 @@ void main() {
expect(hash.width, greaterThan(300));
});
testWidgets('${platform.name} a single fact starts at the leading edge, '
'with no grouped card', (tester) async {
await pumpRunDetail(
tester,
platform,
run: absentRunFixture()..['current_stage'] = 'review',
size: const Size(900, 1600),
);
final grid = tester.getRect(
find.byKey(const Key('run-detail-summary-facts')),
);
final stage = tester.getRect(
find.byKey(const ValueKey('run-detail-summary-stage')),
);
// The grid spans the Summary, and its one fact is at the start of the
// line rather than a half-width block centred on the page.
expect(grid.width, moreOrLessEquals(900));
expect(stage.left, moreOrLessEquals(16));
expect(stage.center.dx, lessThan(450));
expect(find.byType(CupertinoListSection), findsNothing);
});
testWidgets('${platform.name} summary sections state their exact empty '
'wording', (tester) async {
await pumpRunDetail(
@@ -121,10 +121,23 @@ void main() {
tester,
) async {
await pumpRunDetail(tester, platform, run: graphRunFixture(graph: false));
await openRunDetailTab(tester, RunDetailTab.graph);
await openRunDetailTab(tester, RunDetailTab.summary);
// One muted line on the Summary: no framed, tappable empty preview.
expect(find.text(runGraphMissing), findsOneWidget);
expect(find.byKey(runGraphPreviewMissingKey), findsOneWidget);
expect(find.byKey(runGraphPreviewKey), findsNothing);
expect(find.byType(RunGraphView), findsNothing);
expect(find.byType(InteractiveViewer), findsNothing);
final line = tester.getSize(find.byKey(runGraphPreviewMissingKey));
expect(line.height, lessThan(60));
expect(
find.descendant(
of: find.byKey(runGraphPreviewMissingKey),
matching: find.byType(DecoratedBox),
),
findsNothing,
);
});
testWidgets('${platform.name} Graph stays bounded at 320 with 2x text', (
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_content.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_timeline.dart';
import 'package:pipelines_app/ui/layout/app_list_row.dart';
import 'package:pipelines_app/ui/status/run_status_icon.dart';
final _steps = [
@@ -52,8 +53,13 @@ void main() {
expect(find.text('success'), findsOneWidget);
expect(find.text('error'), findsOneWidget);
expect(find.text('→ build · 2m 5s'), findsOneWidget);
// The target is the line; the duration is the row's time.
expect(find.text('→ build'), findsOneWidget);
expect(find.text('2m 5s'), findsOneWidget);
expect(find.text('→ #failure'), findsOneWidget);
// The shared flat row, with no grouped card on either host.
expect(find.byType(AppListRow), findsNWidgets(3));
expect(find.byType(CupertinoListSection), findsNothing);
});
}