Fix inline email images showing twice (once in the body, once as a chip)

An inline image referenced via cid: is already rendered inside message.bodyHtml
(added in the previous commit) but was also still stored as a regular
attachment row, so it showed up a second time as an AttachmentChip thumbnail
underneath the message — the images at top were correct, the small chips
below were a duplicate of the same image.

AttachmentDTO now carries isInline (true when the attachment's contentId is
set), and the message thread — both the admin ticket view and the customer
portal — filters those out of the separate attachment-chip list. Verified
against a live inbound message with a cid-referenced image: previously
rendered as both an <img> and an <a>-wrapped chip, now only the <img>.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GteWhnWKTmnXcsd5jx6H7u
This commit is contained in:
ogrechkoandClaude Sonnet 5 committed 2026-08-19 08:28:06 +00:00
1 parent b11ec711c5
commit cabcc0b1d4
4 files changed
+21 -10

No files matched your search

+10 -6
View File
@@ -333,9 +333,11 @@ function MessageBubble({ message }: { message: MessageDTO }) {
) : (
<p className="mb-1 whitespace-pre-wrap text-sm">{message.body}</p>
)}
{message.attachments.map((a) => (
<AttachmentChip key={a.id} attachment={a} />
))}
{message.attachments
.filter((a) => !a.isInline)
.map((a) => (
<AttachmentChip key={a.id} attachment={a} />
))}
<p className="text-[11px] text-warning-soft-text/80">
{message.authorName} · {formatRelativeTime(message.createdAt)}
</p>
@@ -357,9 +359,11 @@ function MessageBubble({ message }: { message: MessageDTO }) {
) : (
<p className="mb-1 whitespace-pre-wrap">{message.body}</p>
)}
{message.attachments.map((a) => (
<AttachmentChip key={a.id} attachment={a} />
))}
{message.attachments
.filter((a) => !a.isInline)
.map((a) => (
<AttachmentChip key={a.id} attachment={a} />
))}
<p className={`text-[11px] ${isAgent ? "text-white/70" : "text-text-faint"}`}>
{message.authorName} · {formatRelativeTime(message.createdAt)}
</p>