From 7f1a47d3d9a9a978012e0bbda16a33b279f9ebe5 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Mon, 29 Jun 2026 14:34:09 +0100 Subject: [PATCH] Keep huddle actions pending for bot hints --- .../src/features/channels/ui/ChannelPane.tsx | 4 +- .../features/messages/ui/SystemMessageRow.tsx | 60 ++++++++++++++++--- desktop/tests/e2e/mentions.spec.ts | 46 ++++++++++++++ 3 files changed, 100 insertions(+), 10 deletions(-) diff --git a/desktop/src/features/channels/ui/ChannelPane.tsx b/desktop/src/features/channels/ui/ChannelPane.tsx index 8e32d5c7da..5296707ac2 100644 --- a/desktop/src/features/channels/ui/ChannelPane.tsx +++ b/desktop/src/features/channels/ui/ChannelPane.tsx @@ -285,9 +285,7 @@ export const ChannelPane = React.memo(function ChannelPane({ [activeChannel, agentPubkeys, currentPubkey], ); const huddleMemberPubkeysPending = - agentPubkeysPending && - huddleMemberPubkeys.length === 0 && - hasOtherDmParticipant(activeChannel, currentPubkey); + agentPubkeysPending && hasOtherDmParticipant(activeChannel, currentPubkey); const isActiveWelcomeChannel = activeChannel !== null && isWelcomeChannel(activeChannel); useComposerHeightPadding( diff --git a/desktop/src/features/messages/ui/SystemMessageRow.tsx b/desktop/src/features/messages/ui/SystemMessageRow.tsx index 4be6dd1e8d..df4dafe451 100644 --- a/desktop/src/features/messages/ui/SystemMessageRow.tsx +++ b/desktop/src/features/messages/ui/SystemMessageRow.tsx @@ -67,6 +67,24 @@ function resolveDisplayLabel( return resolveLabel(pubkey, currentPubkey, profiles); } +function isKnownAgentPubkey( + pubkey: string | undefined, + profiles: UserProfileLookup | undefined, + personaLookup?: Map, + agentPubkeys?: ReadonlySet, +) { + if (!pubkey) { + return false; + } + + const normalizedPubkey = normalizePubkey(pubkey); + return ( + agentPubkeys?.has(normalizedPubkey) === true || + profiles?.[normalizedPubkey]?.isAgent === true || + personaLookup?.has(normalizedPubkey) === true + ); +} + function ProfileName({ children, highlight = false, @@ -118,12 +136,16 @@ function ProfileName({ function SystemMessageAvatar({ actorPubkey, + agentPubkeys, currentPubkey, + personaLookup, profiles, targetPubkey, }: { actorPubkey: string | undefined; + agentPubkeys?: ReadonlySet; currentPubkey: string | undefined; + personaLookup?: Map; profiles: UserProfileLookup | undefined; targetPubkey: string | undefined; }) { @@ -141,6 +163,12 @@ function SystemMessageAvatar({ const singlePubkey = actorPubkey ?? targetPubkey; if (!hasActorAndTarget) { + const isSingleAgent = isKnownAgentPubkey( + singlePubkey, + profiles, + personaLookup, + agentPubkeys, + ); const avatar = ( +