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.
This commit is contained in:
@@ -71,7 +71,7 @@ bool shouldReconnectOnForeground(ConnectionKind kind) =>
|
||||
///
|
||||
/// Tests may inject the client and route-information provider; the session
|
||||
/// owns the socket either way, so there is never a second app-level connection.
|
||||
typedef _RunIndicators = ({int attention, int running, int failed});
|
||||
typedef _RunIndicators = ({int attention, int running});
|
||||
|
||||
class PipelinesApp extends StatefulWidget {
|
||||
const PipelinesApp({
|
||||
@@ -209,7 +209,6 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
final _attentionCount = ValueNotifier<_RunIndicators>((
|
||||
attention: 0,
|
||||
running: 0,
|
||||
failed: 0,
|
||||
));
|
||||
|
||||
/// Android background delivery (no service elsewhere).
|
||||
@@ -565,11 +564,9 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
/// frame arrives outside any build and applies at once.
|
||||
void _attentionChanged() {
|
||||
if (!mounted) return;
|
||||
final statuses = runTabCounts(_attention.rows);
|
||||
final count = (
|
||||
attention: _attention.entries.length,
|
||||
running: statuses.running,
|
||||
failed: statuses.failed,
|
||||
running: runningRunCount(_attention.rows),
|
||||
);
|
||||
if (count == _attentionCount.value) return;
|
||||
if (SchedulerBinding.instance.schedulerPhase ==
|
||||
@@ -826,7 +823,6 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
],
|
||||
attentionCount: counts.attention,
|
||||
runningRunCount: counts.running,
|
||||
failedRunCount: counts.failed,
|
||||
destination: _destinationOf(route.kind),
|
||||
onDestinationSelected: _selectDestination,
|
||||
onClosePage: () => _delegate.goTo(
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import '../../../core/api_gateway.dart';
|
||||
|
||||
typedef RunTabCounts = ({int running, int failed});
|
||||
|
||||
/// Independent status counts from known, unfiltered server summaries.
|
||||
/// Dismissing a notification does not change a run's failed status.
|
||||
RunTabCounts runTabCounts(Iterable<JsonMap> runs) {
|
||||
/// Counts executing work without treating failed or completed runs as active.
|
||||
int runningRunCount(Iterable<JsonMap> runs) {
|
||||
var running = 0;
|
||||
var failed = 0;
|
||||
for (final run in runs) {
|
||||
if (run['status'] == 'failed') failed++;
|
||||
if (const {
|
||||
'succeeded',
|
||||
'failed',
|
||||
@@ -23,5 +18,5 @@ RunTabCounts runTabCounts(Iterable<JsonMap> runs) {
|
||||
running++;
|
||||
}
|
||||
}
|
||||
return (running: running, failed: failed);
|
||||
return running;
|
||||
}
|
||||
|
||||
@@ -103,19 +103,14 @@ class RunsList extends StatelessWidget {
|
||||
if (!ShellBar.available(context)) {
|
||||
return _ownBar(context, [const Spacer(), ...actions]);
|
||||
}
|
||||
final counts = runTabCounts(controller.runs);
|
||||
return ShellBar(
|
||||
active: active,
|
||||
actions: actions,
|
||||
// The Runs tab counts runs still executing.
|
||||
child: ShellBadge(
|
||||
kind: ShellBadgeKind.running,
|
||||
count: counts.running,
|
||||
child: ShellBadge(
|
||||
kind: ShellBadgeKind.failed,
|
||||
count: counts.failed,
|
||||
child: _shortcutList(context),
|
||||
),
|
||||
count: runningRunCount(controller.runs),
|
||||
child: _shortcutList(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ class AdaptiveShell extends StatefulWidget {
|
||||
this.onSearch,
|
||||
this.attentionCount = 0,
|
||||
this.runningRunCount,
|
||||
this.failedRunCount,
|
||||
this.listPaneWidthStore = const SharedPreferencesListPaneWidthStore(),
|
||||
this.barActions = const [],
|
||||
});
|
||||
@@ -53,7 +52,6 @@ class AdaptiveShell extends StatefulWidget {
|
||||
|
||||
/// App-wide counts when available; standalone screens publish their own.
|
||||
final int? runningRunCount;
|
||||
final int? failedRunCount;
|
||||
|
||||
@override
|
||||
State<AdaptiveShell> createState() => _AdaptiveShellState();
|
||||
@@ -130,9 +128,6 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
running:
|
||||
widget.runningRunCount ??
|
||||
_bar.badge(destination, ShellBadgeKind.running),
|
||||
failed:
|
||||
widget.failedRunCount ??
|
||||
_bar.badge(destination, ShellBadgeKind.failed),
|
||||
attention: widget.attentionCount,
|
||||
child: icon,
|
||||
);
|
||||
|
||||
@@ -44,49 +44,34 @@ class AttentionDestinationIcon extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Both status counts remain visible: failures never hide executing work.
|
||||
/// The Runs tab shows executing work only; its error counter is removed.
|
||||
class RunsDestinationIcon extends StatelessWidget {
|
||||
const RunsDestinationIcon({
|
||||
super.key,
|
||||
required this.running,
|
||||
required this.failed,
|
||||
required this.child,
|
||||
this.attention = 0,
|
||||
});
|
||||
|
||||
final int running;
|
||||
final int failed;
|
||||
final int attention;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final labels = [
|
||||
if (running > 0) '$running runs in progress',
|
||||
if (failed > 0) '$failed failed runs',
|
||||
if (attention > 0) attentionBadgeLabel(attention),
|
||||
];
|
||||
final labels = [if (running > 0) '$running runs in progress'];
|
||||
return Semantics(
|
||||
label: labels.join(', '),
|
||||
child: ExcludeSemantics(
|
||||
child: Tooltip(
|
||||
message: labels.isEmpty ? 'Runs' : 'Runs: ${labels.join(', ')}',
|
||||
excludeFromSemantics: true,
|
||||
child: Badge.count(
|
||||
key: const ValueKey('shell.badge.runs.failed'),
|
||||
count: failed,
|
||||
maxCount: 99,
|
||||
isLabelVisible: failed > 0,
|
||||
backgroundColor: colors.error,
|
||||
textColor: colors.onError,
|
||||
child: ActivityBadge(
|
||||
key: const ValueKey('shell.badge.runs.running'),
|
||||
count: running,
|
||||
label: 'runs in progress',
|
||||
bottom: true,
|
||||
child: child,
|
||||
),
|
||||
child: ActivityBadge(
|
||||
key: const ValueKey('shell.badge.runs.running'),
|
||||
count: running,
|
||||
label: 'runs in progress',
|
||||
bottom: true,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -357,9 +357,6 @@ enum ShellBadgeKind {
|
||||
/// Runs still executing.
|
||||
running,
|
||||
|
||||
/// Runs whose server status is failed, independent of attention dismissal.
|
||||
failed,
|
||||
|
||||
/// Chats with messages not yet seen.
|
||||
unread,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user