fix(desktop): preserve selected message copy#3942
Conversation
esengine
left a comment
There was a problem hiding this comment.
Reviewed. The pure decision function with the DOM glue kept thin is exactly how I want this factored — the six boundary cases (editable targets, collapsed/whitespace selections, non-message scope, no clipboardData) are all pinned in the repo's tsx test convention and wired into both test scripts. The user-select + --wails-draggable: no-drag on .msg also kills the drag-region interference that made selection flaky in the first place.
One accepted trade-off worth recording: claiming the copy event replaces the native payload with text/plain only, so pasting into rich editors loses the HTML flavor. For chat-bubble content that's almost always what the user wanted anyway, and it's what makes the WKWebView fragment-copy bug (#3861) unhittable.
Merging, thanks!
Fixes desktop message-fragment copying on macOS by adding an explicit copy-event fallback for selected chat text.
Changes
text/plainwhen a non-empty selection intersects rendered message content.Verification
git diff --checkgofmt -l .npm run test:allnpm run buildgo test ./...(cd desktop && go test ./...)Closes #3861