From a9064b04c264d2169faed9264e357e5d2623ec2a Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 18:37:01 +0100 Subject: [PATCH] feat(app): the Needs-you bell joins the Runs app-bar actions --- app/lib/features/runs/ui/runs_list.dart | 33 ++++++++++--------- .../runs/ui/runs_list_widget_test.dart | 20 ++++++----- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/app/lib/features/runs/ui/runs_list.dart b/app/lib/features/runs/ui/runs_list.dart index 811039ea..d0e46c9a 100644 --- a/app/lib/features/runs/ui/runs_list.dart +++ b/app/lib/features/runs/ui/runs_list.dart @@ -51,9 +51,22 @@ class RunsList extends StatelessWidget { @override Widget build(BuildContext context) { - final actions = RunsBarActions( - controller, - ).build(context, onStats: () => openRunsStats(context, controller)); + final actions = [ + // The Needs-you bell sits with the other actions, freeing the row. + NeedsYouRunsHeading( + rows: controller.runs, + frames: controller.repository.gateway.frames, + onOpen: (entry) => onSelected(entry.runId), + syncToken: syncToken, + store: attentionStore, + now: attentionNow, + notifications: notifications, + attention: attention, + ), + ...RunsBarActions( + controller, + ).build(context, onStats: () => openRunsStats(context, controller)), + ]; // Outside the app shell (the list on its own) the actions head the list. if (!ShellBar.available(context)) { return Column( @@ -88,19 +101,7 @@ class RunsList extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ if (controller.error != null) _inlineError(context), - RunsFilters( - controller: controller, - action: NeedsYouRunsHeading( - rows: controller.runs, - frames: controller.repository.gateway.frames, - onOpen: (entry) => onSelected(entry.runId), - syncToken: syncToken, - store: attentionStore, - now: attentionNow, - notifications: notifications, - attention: attention, - ), - ), + RunsFilters(controller: controller), Expanded( child: controller.visibleRuns.isEmpty ? const Center(child: Text('No runs found.')) diff --git a/app/test/features/runs/ui/runs_list_widget_test.dart b/app/test/features/runs/ui/runs_list_widget_test.dart index 8b73b944..e44ad309 100644 --- a/app/test/features/runs/ui/runs_list_widget_test.dart +++ b/app/test/features/runs/ui/runs_list_widget_test.dart @@ -177,20 +177,22 @@ void main() { ); for (final cupertino in [false, true]) { - testWidgets('the attention action heads the list under the actions ' + testWidgets('the attention bell is one of the actions ' '(${cupertino ? 'Cupertino' : 'Material'})', (tester) async { await mount(tester, cupertino: cupertino); await tester.pumpAndSettle(); - final bell = find.descendant( - of: find.byType(RunsFilters), - matching: find.byType(NeedsYouRunsHeading), - ); + final bell = find.byType(NeedsYouRunsHeading); expect(bell, findsOneWidget); + // Not in a row of its own: it shares the actions' line, before filter. + final filter = find.byKey(const ValueKey('runs.filter')); expect( - tester.getTopLeft(bell).dy, - greaterThanOrEqualTo( - tester.getBottomLeft(find.byKey(const ValueKey('runs.filter'))).dy, - ), + (tester.getCenter(bell).dy - tester.getCenter(filter).dy).abs(), + lessThan(2), + ); + expect(tester.getCenter(bell).dx, lessThan(tester.getCenter(filter).dx)); + expect( + find.descendant(of: find.byType(RunsFilters), matching: bell), + findsNothing, ); expect(tester.takeException(), isNull); });