Load displayed identities' profiles for collection labels

A displayed collection such as search results has no member loader, so
agents whose profiles were not cached lacked their owner hint and showed
as "murderbot (agent)" instead of "baxen's murderbot". Load uncached
candidates along with their owners.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-09-25 11:08:41 -04:00
committed by Larry
parent f06e1208d4
commit 20349308f7
2 changed files with 11 additions and 1 deletions

View File

@@ -47,7 +47,14 @@ IdentityNames watchIdentityNames(
agentPubkeys: agentPubkeys,
fallbackNames: fallbackNames,
);
final missing = sources.missingOwnerProfiles(names.candidates);
// A displayed identity's profile carries its owner hint, so load uncached
// candidates as well as their owners; channels load member profiles
// elsewhere, but a displayed collection has no other loader.
final missing = {
for (final key in names.candidates)
if (!sources.profiles.containsKey(key)) key,
...sources.missingOwnerProfiles(names.candidates),
};
if (missing.isNotEmpty) {
Future.microtask(() {
if (ref.context.mounted) {

View File

@@ -17,6 +17,9 @@ class _FakeUserCacheNotifier extends UserCacheNotifier {
@override
UserProfile? get(String pubkey) => _users[pubkey.toLowerCase()];
@override
Future<bool> preload(List<String> pubkeys) async => true;
}
void main() {