Show running and failed run counts independently
Give the Runs tab separate activity and failure indicators so neither suppresses the other. Reuse known summaries and pushed updates, keep failed states separate from decisions and dismissal counts, and update across tabs even when total attention is unchanged.
This commit is contained in:
@@ -23,6 +23,8 @@ class AdaptiveShell extends StatefulWidget {
|
||||
this.onClosePage,
|
||||
this.onSearch,
|
||||
this.attentionCount = 0,
|
||||
this.runningRunCount,
|
||||
this.failedRunCount,
|
||||
this.listPaneWidthStore = const SharedPreferencesListPaneWidthStore(),
|
||||
this.barActions = const [],
|
||||
});
|
||||
@@ -46,10 +48,13 @@ class AdaptiveShell extends StatefulWidget {
|
||||
/// shell tests and compositions without routing keep their tab set only.
|
||||
final VoidCallback? onSearch;
|
||||
|
||||
/// Runs needing the operator today, mirrored on the Runs tab in every mount
|
||||
/// so it stays visible from any destination. Zero shows no badge.
|
||||
/// Runs needing the operator today, retained in the tab's accessible label.
|
||||
final int attentionCount;
|
||||
|
||||
/// App-wide counts when available; standalone screens publish their own.
|
||||
final int? runningRunCount;
|
||||
final int? failedRunCount;
|
||||
|
||||
@override
|
||||
State<AdaptiveShell> createState() => _AdaptiveShellState();
|
||||
}
|
||||
@@ -109,7 +114,7 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
});
|
||||
}
|
||||
|
||||
/// The destination's icon; only Runs carries the attention count.
|
||||
/// Runs has independent status counts; Chat has its unread count.
|
||||
Widget _icon(AppDestination destination, IconData data) {
|
||||
Widget icon = Icon(data);
|
||||
if (destination == AppDestination.chat) {
|
||||
@@ -121,17 +126,15 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
);
|
||||
}
|
||||
if (destination != AppDestination.runs) return icon;
|
||||
// One indicator: runs that need you outrank runs in progress, so the
|
||||
// tab never wears two counts at once.
|
||||
final attention = widget.attentionCount > 0;
|
||||
return AttentionDestinationIcon(
|
||||
count: widget.attentionCount,
|
||||
child: ActivityBadge(
|
||||
key: const ValueKey('shell.badge.runs.running'),
|
||||
count: attention ? 0 : _bar.badge(destination, ShellBadgeKind.running),
|
||||
label: 'runs in progress',
|
||||
child: icon,
|
||||
),
|
||||
return RunsDestinationIcon(
|
||||
running:
|
||||
widget.runningRunCount ??
|
||||
_bar.badge(destination, ShellBadgeKind.running),
|
||||
failed:
|
||||
widget.failedRunCount ??
|
||||
_bar.badge(destination, ShellBadgeKind.failed),
|
||||
attention: widget.attentionCount,
|
||||
child: icon,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user