Keep comment thread open when drag-selecting its text#8
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4ea2d56. Configure here.
Clicking a comment card toggles the thread open/closed, but a click that ended a drag-to-highlight (selecting the comment body to copy) also fired the toggle and closed the thread. Distinguish a real click from a drag: skip the toggle when the pointer moved past a small threshold or text ended up selected within the card. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4ea2d56 to
2535b4a
Compare
rgarcia
approved these changes
Jul 9, 2026
rgarcia
left a comment
Contributor
There was a problem hiding this comment.
reviewed — clean, well-scoped fix. distinguishing a click from a drag-release via pointer movement is the right approach, comments explain the why, and no new deps. lgtm.
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.

Problem
Opening a comment thread and then click-dragging to highlight the comment text (to copy it) closes the thread on mouse release. Selecting text to copy shouldn't be a close gesture — the thread should stay open until explicitly closed.
Cause
The comment card's
onClicktoggles its pinned/open state for any click outside adata-no-pinregion. A click-drag-release over the comment body still emits aclick, so selecting text fired the toggle and closed the pinned thread. (The comment body isn't markeddata-no-pin, unlike the actions row/composer/reactions.)Fix
Distinguish a real click from a drag before toggling, in the card handler:
onMouseDown;onClick, skip the toggle if the pointer moved more than ~4px (a drag), or if text ended up selected within the card.A plain click still opens/closes the thread; a drag-to-highlight now leaves it open, so Cmd+C works. Explicit close paths (✕, clicking the highlight, switching cards) are unchanged.
Testing
npm test— 108 passing, no regressions.tsc --noEmitclean.Comment-card interactions aren't unit-tested in this repo (client-only DOM behavior), so the interaction check above is manual.
Note
Low Risk
Small client-only interaction tweak in the comment card click handler; no API or auth changes.
Overview
Comment rail cards no longer treat a drag-to-select over the comment body as a pin/unpin click. The card records pointer position on
mousedownand, onclick, skipsonPin()when the pointer moved more than ~4px—so copy-by-highlighting leaves the thread open while a normal click still toggles it.data-no-pinregions (actions, composer, reactions) are unchanged; only the card-level click handler gains this drag guard.Reviewed by Cursor Bugbot for commit 2535b4a. Bugbot is set up for automated code reviews on this repo. Configure here.