merge(app): land bell in bar

This commit is contained in:
2026-10-23 18:38:07 +01:00
2 changed files with 28 additions and 25 deletions
+17 -16
View File
@@ -51,9 +51,22 @@ class RunsList extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final actions = RunsBarActions( final actions = [
controller, // The Needs-you bell sits with the other actions, freeing the row.
).build(context, onStats: () => openRunsStats(context, controller)); 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. // Outside the app shell (the list on its own) the actions head the list.
if (!ShellBar.available(context)) { if (!ShellBar.available(context)) {
return Column( return Column(
@@ -88,19 +101,7 @@ class RunsList extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
if (controller.error != null) _inlineError(context), if (controller.error != null) _inlineError(context),
RunsFilters( RunsFilters(controller: controller),
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,
),
),
Expanded( Expanded(
child: controller.visibleRuns.isEmpty child: controller.visibleRuns.isEmpty
? const Center(child: Text('No runs found.')) ? const Center(child: Text('No runs found.'))
@@ -177,20 +177,22 @@ void main() {
); );
for (final cupertino in [false, true]) { 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 { '(${cupertino ? 'Cupertino' : 'Material'})', (tester) async {
await mount(tester, cupertino: cupertino); await mount(tester, cupertino: cupertino);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final bell = find.descendant( final bell = find.byType(NeedsYouRunsHeading);
of: find.byType(RunsFilters),
matching: find.byType(NeedsYouRunsHeading),
);
expect(bell, findsOneWidget); 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( expect(
tester.getTopLeft(bell).dy, (tester.getCenter(bell).dy - tester.getCenter(filter).dy).abs(),
greaterThanOrEqualTo( lessThan(2),
tester.getBottomLeft(find.byKey(const ValueKey('runs.filter'))).dy, );
), expect(tester.getCenter(bell).dx, lessThan(tester.getCenter(filter).dx));
expect(
find.descendant(of: find.byType(RunsFilters), matching: bell),
findsNothing,
); );
expect(tester.takeException(), isNull); expect(tester.takeException(), isNull);
}); });