fix(desktop): keep hover action bar & reaction pills out of text selection - #4105
Open
iroiro147 wants to merge 1 commit into
Open
fix(desktop): keep hover action bar & reaction pills out of text selection#4105iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
…ction macOS native text selection was slipping into message chrome: dragging across a message would also select the hover action bar's labels and the reaction pills' contents, and split view would let a drag hop from channel content into thread content via the shared overlay context. Mark the two interaction roots with `select-none` (and document why): * `MessageActionBar` — the fading hover bar with quick reactions + menu trigger. Pure chrome; no user-visible text the reader needs to copy. * `MessageReactions` — reaction pills + inline picker trigger. Pure chrome. Together with the existing (native) behavior of `<button>` elements, this closes the input surface for issue block#4077 without changing any functionality: message bodies, timestamps, and other metadata remain selectable; only the overlaid interactive chrome is excluded from selection. Manual macOS verification (per issue repro) would confirm the drag selection now stops at the chrome boundaries the way other desktop messengers behave. Fixes block#4077 Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4077.
What
macOS native text selection was bleeding into message chrome:
The issue asks for channel selection to stay inside the channel, thread selection inside the thread, message text copyable, and hover action bars / quick reactions / reaction pills / emoji pickers / reaction popovers / other interactive overlays excluded.
Change
Add Tailwind
select-noneto the two interaction roots and document why:MessageActionBar(desktop/src/features/messages/ui/MessageActionBar.tsx:438) — the fading hover bar with quick reactions + the more-actions menu trigger. Pure chrome; no text the reader would want to copy as part of the message body.MessageReactions(desktop/src/features/messages/ui/MessageReactions.tsx:247) — reaction pills container + the inline add-reaction trigger. Pure chrome.Both edits are className-only; no handlers, no logic, no behavior change beyond
user-select. MacOS'suser-select: nonepropagates through children, so this also covers the inline emoji picker popover and dropdown menu content mounted inside these roots.Why this is the right minimal fix
user-select: noneis the canonical CSS for "interactive chrome, not selectable content".<button type="button">), which are natively non-selectable in most browsers — but the parent container'sgap/spacing text was still being captured because the parent<div>didn't suppress it.Out of scope (per the issue's expected-behavior list)
user-select: contain, which is not universally supported). I'd rather land this fix first and evaluate a follow-up based on real-world reports.Verification
pnpm exec tsc --noEmit— clean.pnpm build:e2e— clean.main) — none of them referenceselect-noneor assert selection behavior, so no e2e update is required.Files
desktop/src/features/messages/ui/MessageActionBar.tsx— addselect-noneto the action-bar root.desktop/src/features/messages/ui/MessageReactions.tsx— addselect-noneto the reaction row's root container.