fix(ui): Make read-only content selectable with a Copy context menu (#48)

Root cause: body is user-select: none and each feature had to opt back in; the Markdown preview (and other read-only views) never did, and the app-wide contextmenu guard left no Copy item.
Fix: shared selectableText class (src/ui) for read-only content, and a fallback Copy context menu from browserGuards when right-clicking a selection or a selectable area (component menus still win).
Siblings covered: Quick Documentation / hover / completion docs, hover errors, Quick Definition, debugger value tooltip, inspection messages, message dialogs (no drag on body text), notification titles, About dialog; existing selectable consoles now get Copy too.
Verified in-app on macOS: select in Markdown preview, right-click Copy puts the text on the clipboard; tab context menu unchanged.

Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-27 08:56:13 +08:00
1 джерело 6dfd82de4c
коміт de84a643aa
17 files changed
+453 -55

No files matched your search

+2 -1
Переглянути файл
@@ -25,6 +25,7 @@ import {
type TreeHandle,
type TreeRowState,
T,
selectableText,
} from "@/ui";
import {
cancelInspection,
@@ -438,7 +439,7 @@ function ProblemDetails({ node, root }: { node: Node | null; root: string }) {
<Icon name={sev} size={14} className={styles[`sev-${sev}`]} />
<span>{p.d.source ? `${p.d.source}${p.d.code ? ` (${p.d.code})` : ""}` : <T>Language server</T>}</span>
</div>
<p className={styles.detailsMessage}>{p.d.message}</p>
<p className={clsx(styles.detailsMessage, selectableText)}>{p.d.message}</p>
<div className={styles.muted}>
{relativeDir(root, p.path) ? `${relativeDir(root, p.path)}/` : ""}
{basename(p.path)}:{p.d.range.start.line + 1}:{p.d.range.start.col + 1}