From 1783bbca7012be5aa5ddfb68d26dbda035daa76f Mon Sep 17 00:00:00 2001 From: Tom Brow Date: Mon, 19 Oct 2026 16:25:40 -0700 Subject: [PATCH] Declare scoped presence dependency for agent mention picker Signed-off-by: Tom Brow --- .../mentions/mention_candidates_provider.dart | 2 +- .../mention_search_community_test.dart | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mobile/lib/features/channels/mentions/mention_candidates_provider.dart b/mobile/lib/features/channels/mentions/mention_candidates_provider.dart index a5589d08a4..798ea8917b 100644 --- a/mobile/lib/features/channels/mentions/mention_candidates_provider.dart +++ b/mobile/lib/features/channels/mentions/mention_candidates_provider.dart @@ -229,7 +229,7 @@ final mentionCandidatesProvider = Provider.family history: ref.watch(mentionHistoryProvider)[args.channelId] ?? const {}, presence: (key) => presence[key] ?? 'unknown', ); - }); + }, dependencies: [presentedPresenceProvider]); /// Picker labels compare every selectable choice, before query ranking /// filters them, so a row's label does not change as the query narrows. diff --git a/mobile/test/features/channels/mentions/mention_search_community_test.dart b/mobile/test/features/channels/mentions/mention_search_community_test.dart index 19f7e974be..c30c9a39e5 100644 --- a/mobile/test/features/channels/mentions/mention_search_community_test.dart +++ b/mobile/test/features/channels/mentions/mention_search_community_test.dart @@ -1,3 +1,4 @@ +import 'package:buzz/shared/agents/agents_surface.dart'; import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; @@ -129,6 +130,25 @@ void main() { await container.read(channelsProvider.future); }); + test('picker supports prototype-scoped remote availability', () async { + final scoped = ProviderContainer( + parent: container, + overrides: [ + availableRemoteAgentsProvider.overrideWithValue({_alice}), + ], + ); + addTearDown(scoped.dispose); + final provider = mentionCandidatesProvider(( + channelId: _channelId, + query: '', + opening: 2, + )); + final listener = scoped.listen(provider, (_, _) {}); + addTearDown(listener.close); + await scoped.pump(); + expect(() => scoped.read(provider), returnsNormally); + }); + Future passTypingPause() async { await Future.delayed(mentionSearchDebounce * 2); await container.pump();