polish compact pipeline and run lists
This commit is contained in:
@@ -364,7 +364,7 @@ class RunListRow extends StatelessWidget {
|
||||
},
|
||||
);
|
||||
final scheduled = run['scheduled'] == true;
|
||||
Widget body(bool withMenu) => Row(
|
||||
Widget body(bool withMenu, bool compact) => Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
@@ -377,24 +377,50 @@ class RunListRow extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
line(title, id == null ? null : '#$id', titleStyle),
|
||||
const SizedBox(height: 2),
|
||||
line(
|
||||
[?pipelineLabel, if (scheduled) 'Scheduled'].join(' · '),
|
||||
facts.duration,
|
||||
small,
|
||||
),
|
||||
line(facts.when, facts.progress, small),
|
||||
// The run's path, each stage in its own result colour.
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: RunPathMini(run: run),
|
||||
),
|
||||
),
|
||||
],
|
||||
children: compact
|
||||
? [
|
||||
Text(
|
||||
title,
|
||||
style: titleStyle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
// The stored pipeline name is a fallback when the API
|
||||
// has no human-readable pipeline title. Avoid repeating
|
||||
// it if it already supplies the row title.
|
||||
[
|
||||
?pipelineLabel,
|
||||
if (scheduled) 'Scheduled',
|
||||
if (run['executing'] == true && facts.progress != null)
|
||||
facts.progress!,
|
||||
if (pipelineLabel == null && facts.duration != null)
|
||||
facts.duration!,
|
||||
].join(' · '),
|
||||
style: small,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
]
|
||||
: [
|
||||
line(title, id == null ? null : '#$id', titleStyle),
|
||||
const SizedBox(height: 2),
|
||||
line(
|
||||
[?pipelineLabel, if (scheduled) 'Scheduled'].join(' · '),
|
||||
facts.duration,
|
||||
small,
|
||||
),
|
||||
line(facts.when, facts.progress, small),
|
||||
// The run's path, each stage in its own result colour.
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: RunPathMini(run: run),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (withMenu &&
|
||||
@@ -417,8 +443,10 @@ class RunListRow extends StatelessWidget {
|
||||
final padded = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) =>
|
||||
body(constraints.maxWidth >= _menuMinRowWidth),
|
||||
builder: (context, constraints) {
|
||||
final compact = constraints.maxWidth < _menuMinRowWidth;
|
||||
return body(!compact, compact);
|
||||
},
|
||||
),
|
||||
);
|
||||
return Semantics(
|
||||
|
||||
Reference in New Issue
Block a user