fix(snapshot): copy the quote with the link, and clear Android's selection menu - #6638
Open
tomeredlich wants to merge 4 commits into
Open
fix(snapshot): copy the quote with the link, and clear Android's selection menu#6638tomeredlich wants to merge 4 commits into
tomeredlich wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tomeredlich
force-pushed
the
claude/marked-text-copy-link-119e04
branch
from
September 10, 2026 14:16
d313d2f to
f454d94
Compare
idoshamun
approved these changes
Sep 10, 2026
Copying only the permalink lost the passage the reader had marked, so the paste needed the quote typed back in by hand. The format hook is applied to the shortened URL too, otherwise the second clipboard write would drop it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The platform draws its Copy/Share menu above a selection whenever there is room, which is the slot the bar was picking too. Preferring the other side on a coarse pointer anti-correlates the two: Android only moves below the quote when there is no room above, and that is the case where the bar goes above. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tomeredlich
force-pushed
the
claude/marked-text-copy-link-119e04
branch
from
September 10, 2026 15:20
f454d94 to
4b1ace7
Compare
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Two fixes to the text-selection bar on a post.
1. Copy the quote along with the link
The link button copied only the article permalink, losing the passage the reader had marked. It now copies both:
useCopyLinkgained an optionalformat(link), applied to both clipboard writes — the immediate one and the shortened-URLClipboardItem— so the Safari-safe two-step copy keeps working and the short link carries the quote too. Label, tooltip and toast now read "Copy text and link"; the separate "Copy text" button is unchanged.2. Keep the bar off Android's own menu
On Android, Chrome's native selection menu (Copy / Share / Select all) rendered over our bar — both were taking the space above the highlighted text.
That menu is browser chrome, not our DOM: there is no event to cancel and no CSS to suppress it, and the only thing that removes it is
user-select: none, which would also remove the selection the feature is built on. So this avoids the collision rather than hiding the menu. On a coarse pointer the bar prefers the space below the selection, clearing the drag handles Android hangs under it. The two anti-correlate: the platform menu only moves below the quote when there is no room above, and that is the case where our bar goes above. Mouse placement is unchanged.Verification
packages/sharedsnapshot suites: 7 suites / 45 tests pass, including new cases for the clipboard payload and the coarse-pointer placement.pnpm --filter webapp test: 86 suites / 685 tests pass.🤖 Generated with Claude Code
Preview domain
https://claude-marked-text-copy-link-119.preview.app.daily.dev