feat(app): pipeline rows place name, version, stages, miniature, last run and update time in their corners
This commit is contained in:
@@ -196,7 +196,7 @@ class PipelineListPanel extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// The row's title line: its name and its version at the trailing edge.
|
||||
/// The row's title line: its name, and its version and id in the corner.
|
||||
Widget _rowTitle(BuildContext context, PipelineSummary pipeline) {
|
||||
final muted = _mutedStyle(context);
|
||||
return Row(
|
||||
@@ -211,54 +211,41 @@ class PipelineListPanel extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(pipelineVersionLabel(pipeline), style: muted),
|
||||
Flexible(
|
||||
child: Text(
|
||||
'${pipelineVersionLabel(pipeline)} · #${pipeline.id}',
|
||||
style: muted,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// The row's one muted metadata line plus its last-run line.
|
||||
///
|
||||
/// Everything printed comes from recorded values: the identity, the stage
|
||||
/// count, the configured schedules and the parseable updated time. The run
|
||||
/// line is the web's status glyph plus its `row-meta` fragments
|
||||
/// (`2h ago · 1m 5s · run 42`).
|
||||
/// The row below the title, its facts in the corners: what the pipeline is
|
||||
/// (stages, schedule) beside its miniature, then how it last ran beside when
|
||||
/// it was updated. Everything comes from recorded values.
|
||||
Widget _rowMetadata(
|
||||
BuildContext context,
|
||||
PipelineSummary pipeline,
|
||||
DateTime now,
|
||||
) {
|
||||
final style = _mutedStyle(context);
|
||||
final facts = <String>[
|
||||
'id ${pipeline.id}',
|
||||
final what = [
|
||||
pipelineStageSummary(pipeline),
|
||||
if (pipeline.scheduleLabel.isNotEmpty) pipeline.scheduleLabel,
|
||||
?pipelineUpdatedLine(pipeline),
|
||||
].join(' · ');
|
||||
final updated = pipelineUpdatedLine(pipeline);
|
||||
final run = controller.runsLoaded
|
||||
? controller.latestRuns[pipeline.id]
|
||||
: null;
|
||||
final badge = run == null ? null : runBadge(run, now);
|
||||
final shape = pipeline.shape;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// The web prints the miniature as its own right-aligned block below the
|
||||
// title rather than inside the title line.
|
||||
if (shape != null)
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: PipelineMiniGraph(
|
||||
key: Key('pipeline-mini-${pipeline.id}'),
|
||||
shape: shape,
|
||||
),
|
||||
),
|
||||
Text(facts, 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(
|
||||
// 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`.
|
||||
final lastRun = badge != null
|
||||
? Row(
|
||||
children: [
|
||||
RunStatusIcon(
|
||||
state: badge.state,
|
||||
@@ -275,7 +262,50 @@ class PipelineListPanel extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: controller.runsLoaded
|
||||
? Text('no runs recorded', style: style)
|
||||
: const SizedBox.shrink();
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: Text(what, style: style)),
|
||||
if (shape != null) ...[
|
||||
const SizedBox(width: 8),
|
||||
// The miniature keeps to its corner and scales down when narrow.
|
||||
Flexible(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: PipelineMiniGraph(
|
||||
key: Key('pipeline-mini-${pipeline.id}'),
|
||||
shape: shape,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: lastRun),
|
||||
if (updated != null) ...[
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(
|
||||
updated,
|
||||
style: style,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user