Runs: running run and stage durations tick live

One shared ElapsedClock (single timer, only while a visible running item
is watched and the app is visible; cadence follows formatDuration
precision) and a LiveElapsedBuilder that repaints only its own text.
Running list rows, the Summary Duration and running timeline visits
tick. A stage start re-reads the open detail, since step deltas carry
no started_at. Fixture ?running=1 for captures.
This commit is contained in:
2026-11-04 17:43:29 +00:00
parent fa6c0864db
commit e7d00b85ff
15 changed files with 733 additions and 42 deletions
@@ -123,6 +123,10 @@ JsonMap _probeChanges(List<String> paths) => {
int _fillerRunCount = 0;
int _fillerStepCount = 0;
/// `?running=1`: run 8 executes, started 3m 50s before the page loaded, so a
/// capture shows its duration ticking. Absent by default.
DateTime? _runningSince;
List<JsonMap> _fillerSteps() => [
for (var i = 0; i < _fillerStepCount; i++)
{
@@ -151,6 +155,19 @@ List<JsonMap> _fillerRuns() => [
];
List<JsonMap> probeRuns() => [
if (_runningSince != null)
{
'id': 8,
'title': 'Live deploy run',
'name': 'release-train',
'status': 'running',
'executing': true,
'current_stage': 'deploy',
'completed_steps': 2,
'created_at': _runningSince!.toUtc().toIso8601String(),
'finished_at': '',
'pipeline_id': 24,
},
{
'id': 7,
'title': 'Release train run',
@@ -583,6 +600,7 @@ class _FixtureSink implements WebSocketSink {
/// `?route=/runs/7/stage/build%3Fvisit%3D1` opens that app location;
/// `?runs=200` / `?steps=60` append filler runs / run-7 steps for scroll
/// performance captures;
/// `?running=1` adds an executing run 8 whose duration ticks;
/// `?q=release` types that query into Search once its field is shown;
/// `?platform=cupertino` renders the Cupertino host (`material`, the
/// default, renders Material as browsers do);
@@ -606,6 +624,11 @@ void main() {
configurePerfFixture(params);
_fillerRunCount = int.tryParse(params['runs'] ?? '') ?? 0;
_fillerStepCount = int.tryParse(params['steps'] ?? '') ?? 0;
if (params['running'] == '1') {
_runningSince = DateTime.now().subtract(
const Duration(minutes: 3, seconds: 50),
);
}
final cupertino = params['platform'] == 'cupertino';
final route = params['route'];
final opensRoute = route != null && route.startsWith('/');