From 753f2f63cea7e4183d04522b3fecf46aab7a776e Mon Sep 17 00:00:00 2001 From: ciregenz Date: Sun, 19 Jul 2026 15:52:54 -0700 Subject: [PATCH] [eric] dashboard: highlighted text owns Cmd+C; card-name copy only fires with no live selection --- .../pages/Dashboard/hooks/interaction/useDashboardClipboard.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/app/pages/Dashboard/hooks/interaction/useDashboardClipboard.ts b/frontend/src/app/pages/Dashboard/hooks/interaction/useDashboardClipboard.ts index 6ab634b4..d3f7e0b8 100644 --- a/frontend/src/app/pages/Dashboard/hooks/interaction/useDashboardClipboard.ts +++ b/frontend/src/app/pages/Dashboard/hooks/interaction/useDashboardClipboard.ts @@ -51,6 +51,9 @@ export function useDashboardClipboard({ if (!(e.metaKey || e.ctrlKey) || e.key.toLowerCase() !== 'c') return; const tag = (e.target as HTMLElement)?.tagName; if (tag === 'INPUT' || tag === 'TEXTAREA' || (e.target as HTMLElement)?.isContentEditable) return; + // Highlighted text owns Cmd+C (OS semantics). Without this, clicking a chat selects the CARD, so copying a highlighted message overwrote the clipboard with the card's NAME (the "I copied text but pasted the chat title" bug). + const textSel = window.getSelection(); + if (textSel && !textSel.isCollapsed && textSel.toString().trim()) return; if (selection.selectedIds.size === 0) return; e.preventDefault();