feat(app): pipeline rows show the last run's status glyph, as the web
This commit is contained in:
@@ -9,6 +9,7 @@ import '../../graph/layout/layout_models.dart';
|
||||
import '../../graph/routing/graph_edge_routing.dart';
|
||||
import '../../graph/routing/route_models.dart';
|
||||
import '../../graph/widgets/graph_canvas_style.dart';
|
||||
import '../../../ui/status/run_status_icon.dart';
|
||||
import '../pipeline_format.dart';
|
||||
import '../pipeline_models.dart';
|
||||
import '../pipeline_query.dart';
|
||||
@@ -243,8 +244,8 @@ class PipelineListPanel extends StatelessWidget {
|
||||
///
|
||||
/// Everything printed comes from recorded values: the identity, the stage
|
||||
/// count, the configured schedules and the parseable updated time. The run
|
||||
/// line keeps the web's state word and `row-meta` fragments
|
||||
/// (`Succeeded · 2h ago · 1m 5s · run 42`).
|
||||
/// line is the web's status glyph plus its `row-meta` fragments
|
||||
/// (`2h ago · 1m 5s · run 42`).
|
||||
Widget _rowMetadata(
|
||||
BuildContext context,
|
||||
PipelineSummary pipeline,
|
||||
@@ -261,11 +262,6 @@ class PipelineListPanel extends StatelessWidget {
|
||||
? controller.latestRuns[pipeline.id]
|
||||
: null;
|
||||
final badge = run == null ? null : runBadge(run, now);
|
||||
final runLine = controller.runsLoaded
|
||||
? badge == null
|
||||
? 'no runs recorded'
|
||||
: '${runStateLabel(badge.state)} · ${badge.metaLine}'
|
||||
: null;
|
||||
final shape = pipeline.shape;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -281,7 +277,29 @@ class PipelineListPanel extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(facts, style: style),
|
||||
if (runLine != null && runLine.isNotEmpty) Text(runLine, style: style),
|
||||
// As the web's `row-run`: the coloured status glyph (its tooltip and
|
||||
// accessible name are the state word), then `2d ago · 4m 12s · run 488`.
|
||||
if (controller.runsLoaded && badge == null)
|
||||
Text('no runs recorded', style: style),
|
||||
if (badge != null)
|
||||
Row(
|
||||
children: [
|
||||
RunStatusIcon(
|
||||
state: badge.state,
|
||||
label: runStateLabel(badge.state),
|
||||
size: 14,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Expanded(
|
||||
child: Text(
|
||||
badge.metaLine,
|
||||
style: style,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/ui/status/run_status_icon.dart';
|
||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||
import 'package:pipelines_app/features/pipelines/widgets/pipeline_list_panel.dart';
|
||||
|
||||
@@ -38,14 +39,17 @@ void main() {
|
||||
);
|
||||
|
||||
// The version trails the title line; the recorded facts are one line and
|
||||
// the run line keeps the web's state word and fragments.
|
||||
// the run line is the web's status glyph plus its fragments.
|
||||
expect(find.text('v2'), findsOneWidget);
|
||||
expect(
|
||||
find.text('id 1 · 2 stages · 1 schedule · updated 17 Oct 21:26'),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.textContaining('Succeeded · '), findsOneWidget);
|
||||
expect(find.textContaining('Failed · '), findsOneWidget);
|
||||
final glyphs = tester
|
||||
.widgetList<RunStatusIcon>(find.byType(RunStatusIcon))
|
||||
.map((icon) => icon.label);
|
||||
expect(glyphs, unorderedEquals(['Succeeded', 'Failed']));
|
||||
expect(find.textContaining('Succeeded'), findsNothing);
|
||||
expect(find.text('no runs recorded'), findsOneWidget);
|
||||
});
|
||||
|
||||
@@ -131,7 +135,12 @@ void main() {
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('v2'), findsOneWidget);
|
||||
expect(find.textContaining('Succeeded · '), findsOneWidget);
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
(widget) => widget is RunStatusIcon && widget.label == 'Succeeded',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
} finally {
|
||||
debugDefaultTargetPlatformOverride = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user