feat(app): page the run Changes surface one recorded visit at a time
The run-wide header, note, filter and matched-path counter still describe every visit; below them Previous/Next move through the recorded visits in run order without wrapping, and the shown visit keeps its own stage and Visit N heading. A single recorded visit renders no pager.
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/changes/changes.dart';
|
||||
import 'package:pipelines_app/features/changes/widgets/visit_pager.dart';
|
||||
|
||||
import 'fixtures.dart';
|
||||
import 'widget_hosts.dart';
|
||||
@@ -91,7 +92,7 @@ void main() {
|
||||
expect(find.text(emptyCaptureDetail), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('stage/visit sections keep partial status, counters and scope', (
|
||||
testWidgets('stage/visit pages keep partial status, counters and scope', (
|
||||
tester,
|
||||
) async {
|
||||
final diagnostic = 'Excluded protected files.';
|
||||
@@ -121,11 +122,10 @@ void main() {
|
||||
),
|
||||
),
|
||||
);
|
||||
// The run-wide aggregate still counts the file this visit recorded.
|
||||
expect(find.textContaining('1 file changed'), findsOneWidget);
|
||||
expect(find.text('implementer'), findsOneWidget);
|
||||
expect(find.text('Visit 1 · completed'), findsOneWidget);
|
||||
// The reviewer's first visit is Visit 1, not the run-wide step ordinal 2.
|
||||
expect(find.text('Visit 1 · failed'), findsOneWidget);
|
||||
expect(find.text('Visit 2 · failed'), findsNothing);
|
||||
expect(
|
||||
find.text(
|
||||
'partial (1 files), 1 skipped, 2 omitted · Excluded protected files.',
|
||||
@@ -136,18 +136,24 @@ void main() {
|
||||
find.text('Scope: Git tracked and nonignored files in the run directory'),
|
||||
findsOneWidget,
|
||||
);
|
||||
// The second visit is its own page, not a second section.
|
||||
expect(find.text('reviewer'), findsNothing);
|
||||
expect(find.text(missingCaptureDetail), findsNothing);
|
||||
|
||||
await tester.tap(find.byKey(ChangesVisitPager.nextKey));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('implementer'), findsNothing);
|
||||
expect(find.text('reviewer'), findsOneWidget);
|
||||
// The reviewer's first visit is Visit 1, not the run-wide step ordinal 2.
|
||||
expect(find.text('Visit 1 · failed'), findsOneWidget);
|
||||
expect(find.text('Visit 2 · failed'), findsNothing);
|
||||
expect(find.text(missingCaptureDetail), findsOneWidget);
|
||||
expect(find.textContaining('partial capture'), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'repeated stages number their own visits and honour control.visit',
|
||||
(tester) async {
|
||||
// Tall enough that the lazy list builds every section.
|
||||
tester.view.physicalSize = const Size(800, 1400);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
materialHost(
|
||||
ChangesViewer(
|
||||
@@ -177,11 +183,27 @@ void main() {
|
||||
),
|
||||
),
|
||||
);
|
||||
// Both stages' first recorded visits are Visit 1; the run-wide step
|
||||
// ordinals (1-4) must not leak into the label.
|
||||
expect(find.text('Visit 1 · completed'), findsNWidgets(2));
|
||||
// Pages are in run order; each stage numbers its own visits, so the
|
||||
// run-wide step ordinals (1-4) must not leak into the label.
|
||||
expect(find.text('Visit 1 · completed'), findsOneWidget);
|
||||
expect(find.text('Visit 2 · completed'), findsNothing);
|
||||
expect(find.text('Visit 6 · completed'), findsNothing);
|
||||
|
||||
await tester.tap(find.byKey(ChangesVisitPager.nextKey));
|
||||
await tester.pump();
|
||||
// The reviewer's first recorded visit is Visit 1 too.
|
||||
expect(find.text('reviewer'), findsOneWidget);
|
||||
expect(find.text('Visit 1 · completed'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(ChangesVisitPager.nextKey));
|
||||
await tester.pump();
|
||||
expect(find.text('implementer'), findsOneWidget);
|
||||
expect(find.text('Visit 2 · completed'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(ChangesVisitPager.nextKey));
|
||||
await tester.pump();
|
||||
// The resumed reviewer visit records control.visit 6.
|
||||
expect(find.text('reviewer'), findsOneWidget);
|
||||
expect(find.text('Visit 6 · completed'), findsOneWidget);
|
||||
expect(find.text('Visit 3 · completed'), findsNothing);
|
||||
expect(find.text('Visit 4 · completed'), findsNothing);
|
||||
|
||||
Reference in New Issue
Block a user