feat(app): the Changes tab lists the run's final changes, without a filter field

This commit is contained in:
2026-10-23 17:25:25 +01:00
parent cd86792094
commit 0c1e399e17
7 changed files with 138 additions and 253 deletions
@@ -210,56 +210,6 @@ void main() {
},
);
testWidgets('filtering changed filenames keeps matching rows and says so', (
tester,
) async {
await tester.pumpWidget(
materialHost(
ChangesViewer(
steps: [
stepFixture(
fileChanges: captureFixture(
files: [
fileChangeFixture(path: 'assets/logo.bin', binary: true),
fileChangeFixture(
path: 'lib/feature.dart',
patch: multiHunkPatch,
),
fileChangeFixture(
path: 'docs/notes.md',
kind: 'added',
patch: '@@ -0,0 +1 @@\n+x',
),
],
),
),
],
),
),
);
expect(find.text('assets/logo.bin'), findsOneWidget);
expect(find.text('lib/feature.dart'), findsOneWidget);
await tester.enterText(find.byType(TextField), 'feature');
await tester.pump();
expect(find.text('lib/feature.dart'), findsOneWidget);
expect(find.text('assets/logo.bin'), findsNothing);
expect(find.text('docs/notes.md'), findsNothing);
expect(find.text('1 of 3 changed paths match'), findsOneWidget);
await tester.enterText(find.byType(TextField), 'nothing-here');
await tester.pump();
expect(
find.text('No changed filenames match "nothing-here".'),
findsOneWidget,
);
await tester.enterText(find.byType(TextField), '');
await tester.pump();
expect(find.text('assets/logo.bin'), findsOneWidget);
expect(find.textContaining('changed files match'), findsNothing);
});
testWidgets(
'opening a file shows the rendered patch and copies exact bytes',
(tester) async {
@@ -400,48 +350,48 @@ void main() {
);
});
testWidgets(
'Cupertino uses native list tiles, search field and segmented control',
(tester) async {
await tester.pumpWidget(
cupertinoHost(
ChangesViewer(
steps: [
stepFixture(
fileChanges: captureFixture(
files: [
fileChangeFixture(
path: 'lib/feature.dart',
patch: multiHunkPatch,
),
],
),
testWidgets('Cupertino uses native list tiles and segmented control', (
tester,
) async {
await tester.pumpWidget(
cupertinoHost(
ChangesViewer(
steps: [
stepFixture(
fileChanges: captureFixture(
files: [
fileChangeFixture(
path: 'lib/feature.dart',
patch: multiHunkPatch,
),
],
),
],
),
),
],
),
);
expect(find.byType(CupertinoListTile), findsOneWidget);
expect(find.byType(CupertinoSearchTextField), findsOneWidget);
expect(find.byType(TextField), findsNothing);
),
);
expect(find.byType(CupertinoListTile), findsOneWidget);
// No filter field: the changes list shows every recorded file.
expect(find.byType(CupertinoSearchTextField), findsNothing);
expect(find.byType(TextField), findsNothing);
await tester.tap(find.byKey(const ValueKey('change-1-lib/feature.dart')));
await tester.pumpAndSettle();
expect(
find.byType(CupertinoSlidingSegmentedControl<DiffForm>),
findsOneWidget,
);
expect(find.text('Rendered'), findsOneWidget);
expect(find.text('Raw patch'), findsOneWidget);
await tester.tap(find.byKey(const ValueKey('change-1-lib/feature.dart')));
await tester.pumpAndSettle();
expect(
find.byType(CupertinoSlidingSegmentedControl<DiffForm>),
findsOneWidget,
);
expect(find.text('Rendered'), findsOneWidget);
expect(find.text('Raw patch'), findsOneWidget);
await tester.tap(find.byIcon(CupertinoIcons.xmark));
await tester.pumpAndSettle();
expect(
find.byType(CupertinoSlidingSegmentedControl<DiffForm>),
findsNothing,
);
},
);
await tester.tap(find.byIcon(CupertinoIcons.xmark));
await tester.pumpAndSettle();
expect(
find.byType(CupertinoSlidingSegmentedControl<DiffForm>),
findsNothing,
);
});
testWidgets('narrow viewport and large text keep every control reachable', (
tester,
@@ -138,26 +138,6 @@ void main() {
expect(find.text('lib/only.dart'), findsOneWidget);
});
testWidgets('the filter and its aggregate counter survive paging', (
tester,
) async {
await tester.pumpWidget(materialHost(ChangesViewer(steps: twoVisitRun())));
await tester.enterText(find.byType(TextField), 'a.dart');
await tester.pump();
expect(find.text('1 of 3 changed paths match'), findsOneWidget);
expect(find.text('lib/a.dart'), findsOneWidget);
await tester.tap(find.byKey(ChangesVisitPager.nextKey));
await tester.pump();
// The filter still applies to the shown visit, and the counter still
// describes the whole run's changed paths.
expect(find.text('1 of 3 changed paths match'), findsOneWidget);
expect(find.text('No changed filenames match "a.dart".'), findsOneWidget);
expect(find.text('lib/c.dart'), findsNothing);
expect(find.text('reviewer'), findsOneWidget);
});
testWidgets('a shorter reply clamps the shown visit instead of overflowing', (
tester,
) async {