fa95c2fcae
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.
23 lines
593 B
Dart
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;
|
|
}
|