From 7d9b3da936e1bd2e88f496714c8c32b42a6597db Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 17:27:46 +0100 Subject: [PATCH] feat(app): a timeline visit shows its own changes as a Changes section --- .../features/runs/ui/run_detail_visit.dart | 10 +--- .../runs/ui/run_detail_visit_sections.dart | 20 +++++++- .../ui/run_visit_changes_action_test.dart | 48 +++---------------- 3 files changed, 26 insertions(+), 52 deletions(-) diff --git a/app/lib/features/runs/ui/run_detail_visit.dart b/app/lib/features/runs/ui/run_detail_visit.dart index ec77e561..447fdfee 100644 --- a/app/lib/features/runs/ui/run_detail_visit.dart +++ b/app/lib/features/runs/ui/run_detail_visit.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; import '../../../ui/adaptive/host.dart'; -import 'run_changes_action.dart'; import 'run_detail_content.dart'; import 'run_detail_visit_facts.dart'; import 'run_detail_visit_sections.dart'; @@ -156,14 +155,7 @@ class _RunVisitPaneState extends State { spacing: 8, runSpacing: 4, crossAxisAlignment: WrapCrossAlignment.center, - children: [ - close, - RunVisitChangesButton( - stage: widget.visit.stage, - sequence: widget.visit.sequence, - step: widget.step, - ), - ], + children: [close], ), Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/app/lib/features/runs/ui/run_detail_visit_sections.dart b/app/lib/features/runs/ui/run_detail_visit_sections.dart index 810c9d99..59d77994 100644 --- a/app/lib/features/runs/ui/run_detail_visit_sections.dart +++ b/app/lib/features/runs/ui/run_detail_visit_sections.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; import '../../../ui/adaptive/host.dart'; +import '../../changes/changes.dart'; import 'run_detail_tab_bodies.dart'; import 'run_detail_tab_strip.dart'; import 'run_detail_visit_artifacts.dart'; @@ -11,12 +12,13 @@ import 'run_detail_visit_facts.dart'; import 'run_detail_visit_session.dart'; /// The visit pane's recorded sections, in the Android audit order the web -/// client follows: the turn's Input and Output, its Artifacts, its Session and -/// the authored Definition. +/// client follows: the turn's Input and Output, its Artifacts, the files this +/// visit changed, its Session and the authored Definition. enum RunVisitSection { input('Input'), output('Output'), artifacts('Artifacts'), + changes('Changes'), session('Session'), definition('Definition'); @@ -118,6 +120,20 @@ Widget runVisitSectionBody({ runSteps: runSteps, configuredEndpoint: configuredEndpoint, ); + case RunVisitSection.changes: + // Only this visit's own capture; the run's final state is the run's + // Changes tab. + final viewer = ChangesViewer( + key: ValueKey('run-visit-changes-$visitIndex'), + steps: [step], + showSummary: false, + ); + return cupertino + ? Builder( + builder: (context) => + Theme(data: hostTextTheme(context), child: viewer), + ) + : viewer; case RunVisitSection.session: return RunVisitSession( run: run, diff --git a/app/test/features/runs/ui/run_visit_changes_action_test.dart b/app/test/features/runs/ui/run_visit_changes_action_test.dart index b6f331dd..452671ee 100644 --- a/app/test/features/runs/ui/run_visit_changes_action_test.dart +++ b/app/test/features/runs/ui/run_visit_changes_action_test.dart @@ -1,8 +1,9 @@ -import 'package:flutter/cupertino.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/features/changes/changes.dart'; import 'package:pipelines_app/features/runs/ui/run_changes_action.dart'; +import 'package:pipelines_app/features/runs/ui/run_detail_visit_sections.dart'; import '../../changes/fixtures.dart'; import 'run_detail_graph_support.dart'; @@ -26,10 +27,9 @@ JsonMap _capture(String path) => captureFixture( files: [fileChangeFixture(path: path, patch: multiHunkPatch)], ); -Future _openVisitChanges(WidgetTester tester) async { - await tester.tap(find.byKey(runVisitChangesButtonKey)); - await tester.pumpAndSettle(); -} +/// A visit's own changes are a section of its pane, not a separate page. +Future _openVisitChanges(WidgetTester tester) => + openVisitTab(tester, RunVisitSection.changes); void main() { group('visitChangesTitle', () { @@ -64,7 +64,7 @@ void main() { await _openVisitChanges(tester); - expect(find.text('Changes · plan · visit 1'), findsOneWidget); + expect(find.byKey(const Key('run-visit-pane')), findsOneWidget); // The body keeps the landed viewer's own identity for that visit. expect(find.text('plan'), findsOneWidget); expect(find.text('Visit 1 · completed'), findsOneWidget); @@ -83,7 +83,7 @@ void main() { await _openVisitChanges(tester); - expect(find.text('Changes · plan · visit 1'), findsOneWidget); + expect(find.byKey(const Key('run-visit-pane')), findsOneWidget); expect(find.text(missingCaptureDetail), findsOneWidget); // A missing capture is evidence, never an observed no-change. expect(find.text('No changes observed'), findsNothing); @@ -91,38 +91,4 @@ void main() { expect(find.text('lib/build.dart'), findsNothing); }); } - - testWidgets('material: visit Changes returns to the opened pane', ( - tester, - ) async { - await openVisit( - tester, - RunDetailTestPlatform.material, - run: _run(planChanges: _capture('lib/plan.dart')), - ); - - await _openVisitChanges(tester); - await tester.tap(find.byTooltip('Back')); - await tester.pumpAndSettle(); - - expect(find.byKey(const Key('run-visit-pane')), findsOneWidget); - expect(find.byKey(runVisitChangesButtonKey), findsOneWidget); - }); - - testWidgets('cupertino: visit Changes returns to the opened pane', ( - tester, - ) async { - await openVisit( - tester, - RunDetailTestPlatform.cupertino, - run: _run(planChanges: _capture('lib/plan.dart')), - ); - - await _openVisitChanges(tester); - await tester.tap(find.byType(CupertinoNavigationBarBackButton)); - await tester.pumpAndSettle(); - - expect(find.byKey(const Key('run-visit-pane')), findsOneWidget); - expect(find.byKey(runVisitChangesButtonKey), findsOneWidget); - }); }