From fc43365ffbe8d379e6d1c5ee1d672bc2588bf9d6 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Sun, 5 Jul 2026 07:17:08 +0100 Subject: [PATCH] Never render reaction events as chat bubbles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chat timeline filtered out only system messages, but the channel query also delivers reactions/edits/deletions — so an agent's 👀/💬 acknowledgment reactions (kind 7, from harnesses predating the chat gating) rendered as tiny emoji message bubbles. The timeline and the solo-layout participant count now admit only the true message kinds, suppressing the emoji regardless of which harness build the agent runs. Co-Authored-By: Claude Fable 5 --- desktop/src/features/chats/ui/ChatDetail.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/desktop/src/features/chats/ui/ChatDetail.tsx b/desktop/src/features/chats/ui/ChatDetail.tsx index d1c8c7589..b434049a9 100644 --- a/desktop/src/features/chats/ui/ChatDetail.tsx +++ b/desktop/src/features/chats/ui/ChatDetail.tsx @@ -52,7 +52,7 @@ import type { ManagedAgent, RelayEvent, } from "@/shared/api/types"; -import { KIND_SYSTEM_MESSAGE } from "@/shared/constants/kinds"; +import { CHANNEL_MESSAGE_EVENT_KINDS } from "@/shared/constants/kinds"; import { cn } from "@/shared/lib/cn"; import { normalizePubkey } from "@/shared/lib/pubkey"; import { @@ -281,7 +281,14 @@ export function ChatDetail({ const visibleMessages = React.useMemo( () => messages.filter((message) => { - if (message.kind === KIND_SYSTEM_MESSAGE) { + // Only true message kinds render: the channel query also delivers + // reactions/edits/deletions (kind 7 et al.), and a stray agent 👀 + // reaction otherwise renders as a tiny emoji bubble. + if ( + !CHANNEL_MESSAGE_EVENT_KINDS.includes( + message.kind as (typeof CHANNEL_MESSAGE_EVENT_KINDS)[number], + ) + ) { return false; } const isAgent = @@ -309,7 +316,13 @@ export function ChatDetail({ const showAgentIdentity = React.useMemo(() => { const others = new Set(); for (const message of messages) { - if (message.kind === KIND_SYSTEM_MESSAGE) { + // Same message-kind allowlist as the timeline: a reaction event alone + // (an old harness's 👀) must not flip the solo layout to multi-party. + if ( + !CHANNEL_MESSAGE_EVENT_KINDS.includes( + message.kind as (typeof CHANNEL_MESSAGE_EVENT_KINDS)[number], + ) + ) { continue; } const pubkey = normalizePubkey(message.pubkey);