feat(app): a timeline visit shows its own changes as a Changes section
This commit is contained in:
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import '../../../core/api_gateway.dart';
|
import '../../../core/api_gateway.dart';
|
||||||
import '../../../ui/adaptive/host.dart';
|
import '../../../ui/adaptive/host.dart';
|
||||||
import 'run_changes_action.dart';
|
|
||||||
import 'run_detail_content.dart';
|
import 'run_detail_content.dart';
|
||||||
import 'run_detail_visit_facts.dart';
|
import 'run_detail_visit_facts.dart';
|
||||||
import 'run_detail_visit_sections.dart';
|
import 'run_detail_visit_sections.dart';
|
||||||
@@ -156,14 +155,7 @@ class _RunVisitPaneState extends State<RunVisitPane> {
|
|||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 4,
|
runSpacing: 4,
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
children: [
|
children: [close],
|
||||||
close,
|
|
||||||
RunVisitChangesButton(
|
|
||||||
stage: widget.visit.stage,
|
|
||||||
sequence: widget.visit.sequence,
|
|
||||||
step: widget.step,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import '../../../core/api_gateway.dart';
|
import '../../../core/api_gateway.dart';
|
||||||
import '../../../ui/adaptive/host.dart';
|
import '../../../ui/adaptive/host.dart';
|
||||||
|
import '../../changes/changes.dart';
|
||||||
import 'run_detail_tab_bodies.dart';
|
import 'run_detail_tab_bodies.dart';
|
||||||
import 'run_detail_tab_strip.dart';
|
import 'run_detail_tab_strip.dart';
|
||||||
import 'run_detail_visit_artifacts.dart';
|
import 'run_detail_visit_artifacts.dart';
|
||||||
@@ -11,12 +12,13 @@ import 'run_detail_visit_facts.dart';
|
|||||||
import 'run_detail_visit_session.dart';
|
import 'run_detail_visit_session.dart';
|
||||||
|
|
||||||
/// The visit pane's recorded sections, in the Android audit order the web
|
/// 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
|
/// client follows: the turn's Input and Output, its Artifacts, the files this
|
||||||
/// the authored Definition.
|
/// visit changed, its Session and the authored Definition.
|
||||||
enum RunVisitSection {
|
enum RunVisitSection {
|
||||||
input('Input'),
|
input('Input'),
|
||||||
output('Output'),
|
output('Output'),
|
||||||
artifacts('Artifacts'),
|
artifacts('Artifacts'),
|
||||||
|
changes('Changes'),
|
||||||
session('Session'),
|
session('Session'),
|
||||||
definition('Definition');
|
definition('Definition');
|
||||||
|
|
||||||
@@ -118,6 +120,20 @@ Widget runVisitSectionBody({
|
|||||||
runSteps: runSteps,
|
runSteps: runSteps,
|
||||||
configuredEndpoint: configuredEndpoint,
|
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:
|
case RunVisitSection.session:
|
||||||
return RunVisitSession(
|
return RunVisitSession(
|
||||||
run: run,
|
run: run,
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
import 'package:pipelines_app/features/changes/changes.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_changes_action.dart';
|
||||||
|
import 'package:pipelines_app/features/runs/ui/run_detail_visit_sections.dart';
|
||||||
|
|
||||||
import '../../changes/fixtures.dart';
|
import '../../changes/fixtures.dart';
|
||||||
import 'run_detail_graph_support.dart';
|
import 'run_detail_graph_support.dart';
|
||||||
@@ -26,10 +27,9 @@ JsonMap _capture(String path) => captureFixture(
|
|||||||
files: <JsonMap>[fileChangeFixture(path: path, patch: multiHunkPatch)],
|
files: <JsonMap>[fileChangeFixture(path: path, patch: multiHunkPatch)],
|
||||||
);
|
);
|
||||||
|
|
||||||
Future<void> _openVisitChanges(WidgetTester tester) async {
|
/// A visit's own changes are a section of its pane, not a separate page.
|
||||||
await tester.tap(find.byKey(runVisitChangesButtonKey));
|
Future<void> _openVisitChanges(WidgetTester tester) =>
|
||||||
await tester.pumpAndSettle();
|
openVisitTab(tester, RunVisitSection.changes);
|
||||||
}
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('visitChangesTitle', () {
|
group('visitChangesTitle', () {
|
||||||
@@ -64,7 +64,7 @@ void main() {
|
|||||||
|
|
||||||
await _openVisitChanges(tester);
|
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.
|
// The body keeps the landed viewer's own identity for that visit.
|
||||||
expect(find.text('plan'), findsOneWidget);
|
expect(find.text('plan'), findsOneWidget);
|
||||||
expect(find.text('Visit 1 · completed'), findsOneWidget);
|
expect(find.text('Visit 1 · completed'), findsOneWidget);
|
||||||
@@ -83,7 +83,7 @@ void main() {
|
|||||||
|
|
||||||
await _openVisitChanges(tester);
|
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);
|
expect(find.text(missingCaptureDetail), findsOneWidget);
|
||||||
// A missing capture is evidence, never an observed no-change.
|
// A missing capture is evidence, never an observed no-change.
|
||||||
expect(find.text('No changes observed'), findsNothing);
|
expect(find.text('No changes observed'), findsNothing);
|
||||||
@@ -91,38 +91,4 @@ void main() {
|
|||||||
expect(find.text('lib/build.dart'), findsNothing);
|
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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user