Files
pipelines/app/lib/features/runs/domain/run_tab_counts.dart
T
alan fa95c2fcae Remove the Runs error counter for now
Keep the running indicator and Needs you flow, but remove the failed-count badge and its tab count plumbing until unseen-state behavior is addressed. Preserve the unfinished seen-state work separately. Verify application, Runs, attention and shell regressions.
2026-11-11 23:18:30 +00:00

23 lines
593 B
Dart

import '../../../core/api_gateway.dart';
/// Counts executing work without treating failed or completed runs as active.
int runningRunCount(Iterable<JsonMap> runs) {
var running = 0;
for (final run in runs) {
if (const {
'succeeded',
'failed',
'canceled',
'interrupted',
}.contains(run['status'])) {
continue;
}
// Older summaries omit the execution flag but still name the live state.
if (run['executing'] == true ||
(!run.containsKey('executing') && run['status'] == 'running')) {
running++;
}
}
return running;
}