From 75940450bedc802e2252eeae16334b1112a94979 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Sat, 27 Jun 2026 11:21:33 +0100 Subject: [PATCH] Fix task link feature gate regressions --- desktop/src/features/channels/ui/ChannelScreen.tsx | 5 +++++ .../features/channels/ui/useAgentConversationRouteTarget.ts | 6 ++++++ desktop/src/features/messages/lib/composerPasteHandler.ts | 2 +- desktop/src/features/messages/lib/useRichTextEditor.ts | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/desktop/src/features/channels/ui/ChannelScreen.tsx b/desktop/src/features/channels/ui/ChannelScreen.tsx index cfb2f77c4..2668f3852 100644 --- a/desktop/src/features/channels/ui/ChannelScreen.tsx +++ b/desktop/src/features/channels/ui/ChannelScreen.tsx @@ -341,6 +341,10 @@ export function ChannelScreen({ const managedAgents = managedAgentsQuery.data ?? []; const relayAgentsQuery = useRelayAgentsQuery(); const relayAgents = relayAgentsQuery.data ?? []; + const agentLookupReady = + !channelMembersQuery.isLoading && + !managedAgentsQuery.isLoading && + !relayAgentsQuery.isLoading; const agentPubkeys = React.useMemo(() => { const pubkeys = new Set(); for (const member of channelMembers ?? []) { @@ -732,6 +736,7 @@ export function ChannelScreen({ useAgentConversationRouteTarget({ activeChannel, agentConversationMarkers, + agentLookupReady, agentPubkeys, enabled: isChannelTasksEnabled, goChannel, diff --git a/desktop/src/features/channels/ui/useAgentConversationRouteTarget.ts b/desktop/src/features/channels/ui/useAgentConversationRouteTarget.ts index 31e641539..6d4b57fa3 100644 --- a/desktop/src/features/channels/ui/useAgentConversationRouteTarget.ts +++ b/desktop/src/features/channels/ui/useAgentConversationRouteTarget.ts @@ -23,6 +23,7 @@ type UseAgentConversationRouteTargetInput = { activeChannel: Channel | null; agentConversationMarkers: readonly AgentConversationMarker[]; agentPubkeys: ReadonlySet; + agentLookupReady: boolean; enabled: boolean; goChannel: GoChannel; messageProfilesReady: boolean; @@ -37,6 +38,7 @@ type UseAgentConversationRouteTargetInput = { export function useAgentConversationRouteTarget({ activeChannel, agentConversationMarkers, + agentLookupReady, agentPubkeys, enabled, goChannel, @@ -77,6 +79,9 @@ export function useAgentConversationRouteTarget({ if (!sourceMessage) { return; } + if (!marker && !agentLookupReady) { + return; + } const sourceAuthorIsAgent = sourceMessage.pubkey ? agentPubkeys.has(normalizePubkey(sourceMessage.pubkey)) @@ -128,6 +133,7 @@ export function useAgentConversationRouteTarget({ }, [ activeChannel, agentConversationMarkers, + agentLookupReady, agentPubkeys, enabled, goChannel, diff --git a/desktop/src/features/messages/lib/composerPasteHandler.ts b/desktop/src/features/messages/lib/composerPasteHandler.ts index 3a648ea75..5b69688cd 100644 --- a/desktop/src/features/messages/lib/composerPasteHandler.ts +++ b/desktop/src/features/messages/lib/composerPasteHandler.ts @@ -21,7 +21,7 @@ type ComposerPasteHandlerOptions = { export function createMessageComposerPasteHandler({ agentConversationTitleForHref, - enableAgentConversationLinks = true, + enableAgentConversationLinks = false, editor, scrollComposerToBottom, uploadFile, diff --git a/desktop/src/features/messages/lib/useRichTextEditor.ts b/desktop/src/features/messages/lib/useRichTextEditor.ts index 07191e982..9e4831169 100644 --- a/desktop/src/features/messages/lib/useRichTextEditor.ts +++ b/desktop/src/features/messages/lib/useRichTextEditor.ts @@ -174,7 +174,7 @@ export function useRichTextEditor({ channelNames, customEmoji, agentConversationTitleForHref, - enableAgentConversationLinks = true, + enableAgentConversationLinks = false, onSubmit, onEditLastOwnMessage, isAutocompleteOpen,