- {/* Header */}
+ // Detect operational noise
+ const noiseLabel = useMemo(
+ () => detectOperationalNoise(teammateMessage.content, teammateMessage.teammateId),
+ [teammateMessage.content, teammateMessage.teammateId]
+ );
+
+ // Detect resent/duplicate messages
+ const isResend = useMemo(() => isResendMessage(teammateMessage), [teammateMessage]);
+
+ const plainSummary = useMemo(
+ () => extractMarkdownPlainText(teammateMessage.summary),
+ [teammateMessage.summary]
+ );
+ const plainReplyToSummary = useMemo(
+ () =>
+ teammateMessage.replyToSummary
+ ? extractMarkdownPlainText(teammateMessage.replyToSummary)
+ : undefined,
+ [teammateMessage.replyToSummary]
+ );
+
+ const displayContent = useMemo(() => {
+ const stripped = stripAgentBlocks(teammateMessage.content);
+ return linkifyAllMentionsInMarkdown(stripped, memberColorMap, teamNames);
+ }, [teammateMessage.content, memberColorMap, teamNames]);
+
+ // Noise: minimal inline row (no card, no expand)
+ if (noiseLabel) {
+ return (
+
+
+
+ {teammateMessage.teammateId}
+
+
+ {noiseLabel}
+
+
+ );
+ }
+
+ const truncatedSummary =
+ plainSummary.length > 80 ? plainSummary.slice(0, 80) + '...' : plainSummary;
+
+ return (
{
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault();
- onClick();
- }
- }}
- className="flex cursor-pointer items-center gap-2 px-3 py-2 transition-colors"
+ className={`overflow-hidden rounded-md transition-[background-color,box-shadow] duration-300 ${highlightClasses}`}
style={{
- backgroundColor: isExpanded ? CARD_HEADER_BG : 'transparent',
- borderBottom: isExpanded ? CARD_BORDER_STYLE : 'none',
+ backgroundColor: CARD_BG,
+ border: CARD_BORDER_STYLE,
+ borderLeft: `3px solid ${colors.border}`,
+ opacity: isResend ? 0.6 : undefined,
+ ...highlightStyle,
}}
>
-
-
- {/* Message icon — distinguishes from SubagentItem's Bot/dot icon */}
-
-
- {/* Teammate name badge */}
- {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ onClick();
+ }
+ }}
+ className="flex cursor-pointer items-center gap-2 px-3 py-2 transition-colors"
style={{
- backgroundColor: getThemedBadge(colors, isLight),
- color: colors.text,
- border: `1px solid ${colors.border}40`,
+ backgroundColor: isExpanded ? CARD_HEADER_BG : 'transparent',
+ borderBottom: isExpanded ? CARD_BORDER_STYLE : 'none',
}}
>
- {teammateMessage.teammateId}
-
-
- {/* "Message" type label — parallels SubagentItem's model info */}
-
- Message
-
-
- {/* Reply indicator — shows which SendMessage triggered this response */}
- {plainReplyToSummary && (
- onReplyHover?.(teammateMessage.replyToToolId ?? null)}
- onMouseLeave={() => onReplyHover?.(null)}
+ />
+
+ {/* Message icon — distinguishes from SubagentItem's Bot/dot icon */}
+
+
+ {/* Teammate name badge */}
+
-
-
- {plainReplyToSummary}
+ {teammateMessage.teammateId}
+
+
+ {/* "Message" type label — parallels SubagentItem's model info */}
+
+ Message
+
+
+ {/* Reply indicator — shows which SendMessage triggered this response */}
+ {plainReplyToSummary && (
+ onReplyHover?.(teammateMessage.replyToToolId ?? null)}
+ onMouseLeave={() => onReplyHover?.(null)}
+ >
+
+
+ {plainReplyToSummary}
+
+ )}
+
+ {/* Resend badge — marks duplicate/resent messages */}
+ {isResend && (
+
+
+ Resent
+
+ )}
+
+ {/* Summary */}
+
+ {truncatedSummary || 'Teammate message'}
- )}
- {/* Resend badge — marks duplicate/resent messages */}
- {isResend && (
-
-
- Resent
-
- )}
+ {/* Context impact — tokens injected into main session */}
+ {teammateMessage.tokenCount != null && teammateMessage.tokenCount > 0 && (
+
+ ~{formatTokensCompact(teammateMessage.tokenCount)} tokens
+
+ )}
- {/* Summary */}
-
- {truncatedSummary || 'Teammate message'}
-
-
- {/* Context impact — tokens injected into main session */}
- {teammateMessage.tokenCount != null && teammateMessage.tokenCount > 0 && (
+ {/* Timestamp — rightmost info element */}
- ~{formatTokensCompact(teammateMessage.tokenCount)} tokens
+ {format(teammateMessage.timestamp, 'HH:mm:ss')}
- )}
-
- {/* Timestamp — rightmost info element */}
-
- {format(teammateMessage.timestamp, 'HH:mm:ss')}
-
-
-
- {/* Expanded content */}
- {isExpanded && (
-
-
- )}
-
- );
-};
+
+ {/* Expanded content */}
+ {isExpanded && (
+