feat(app): finish native run Changes wiring and scaled form menus
This commit is contained in:
@@ -17,7 +17,11 @@ import 'file_diff_viewer.dart';
|
||||
/// Scaffold body, tab body or Expanded child). It never opens its own socket or
|
||||
/// requests data; the caller passes the run detail's `steps`.
|
||||
class ChangesViewer extends StatefulWidget {
|
||||
const ChangesViewer({super.key, required this.steps});
|
||||
const ChangesViewer({
|
||||
super.key,
|
||||
required this.steps,
|
||||
this.showSummary = true,
|
||||
});
|
||||
|
||||
/// The run detail's steps exactly as the server returned them. Each step's
|
||||
/// `file_changes` may be null (no capture), a complete/partial/unavailable
|
||||
@@ -27,6 +31,11 @@ class ChangesViewer extends StatefulWidget {
|
||||
/// captures and the summary are derived from it rather than on every rebuild.
|
||||
final List<JsonMap> steps;
|
||||
|
||||
/// Whether the run-wide final-state header and filter are shown. The web
|
||||
/// client gates its aggregate on [showRunChangesSummary]; the per-stage
|
||||
/// sections stay the evidence for a run without a settled final state.
|
||||
final bool showSummary;
|
||||
|
||||
@override
|
||||
State<ChangesViewer> createState() => _ChangesViewerState();
|
||||
}
|
||||
@@ -67,49 +76,51 @@ class _ChangesViewerState extends State<ChangesViewer> {
|
||||
Widget build(BuildContext context) {
|
||||
final run = _run;
|
||||
final captures = _captures;
|
||||
final showSummary = widget.showSummary;
|
||||
final hasFiles = captures.any(
|
||||
(visit) => visit.capture?.files.isNotEmpty ?? false,
|
||||
);
|
||||
final note = runChangesNote(run);
|
||||
final note = showSummary ? runChangesNote(run) : '';
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
runChangesHeader(run),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
if (note.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
note,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
if (showSummary)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
runChangesHeader(run),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
if (hasFiles)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
'The summary counts each path once, as the last recorded '
|
||||
'visit left it. Each stage/visit below lists what its own '
|
||||
'capture recorded.',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
if (note.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
note,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (hasFiles)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
'The summary counts each path once, as the last recorded '
|
||||
'visit left it. Each stage/visit below lists what its own '
|
||||
'capture recorded.',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (hasFiles)
|
||||
if (showSummary && hasFiles)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
|
||||
child: _filterField(context, run),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
if (showSummary) const Divider(height: 1),
|
||||
Expanded(
|
||||
child: captures.isEmpty
|
||||
? SingleChildScrollView(
|
||||
|
||||
Reference in New Issue
Block a user