fix: exclude embed thumbnails from image context menu actions

Add data-embed-thumbnail marker to VideoEmbed, GenericEmbed, and
RichEmbed thumbnail containers. Update detection logic to skip
these alongside avatars. Also remove redundant filename derivation
in Save Image menu item.
This commit is contained in:
Jannis Braun
2026-03-25 03:23:23 +01:00
parent 4ea319646a
commit aeb4ea6e1d
5 changed files with 6 additions and 8 deletions
+2 -2
View File
@@ -173,9 +173,9 @@ export function Message({ message, isCompact, isFirstInGroup, previousMessageId
e.stopPropagation();
const selectedText = window.getSelection()?.toString() ?? '';
// Detect if the right-click target is a content image (not an avatar)
// Detect if the right-click target is a content image (not an avatar or embed thumbnail)
const imgEl = (e.target as HTMLElement).closest('img') as HTMLImageElement | null;
const isContentImage = imgEl && !imgEl.closest('[data-avatar]');
const isContentImage = imgEl && !imgEl.closest('[data-avatar]') && !imgEl.closest('[data-embed-thumbnail]');
const imageUrl = isContentImage ? imgEl.src : null;
const items = buildMessageMenuItems({