Skip to content

fix(snapshot): copy the quote with the link, and clear Android's selection menu - #6638

Open
tomeredlich wants to merge 4 commits into
mainfrom
claude/marked-text-copy-link-119e04
Open

fix(snapshot): copy the quote with the link, and clear Android's selection menu#6638
tomeredlich wants to merge 4 commits into
mainfrom
claude/marked-text-copy-link-119e04

Conversation

@tomeredlich

@tomeredlich tomeredlich commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

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:

"the passage the reader highlighted"

https://app.daily.dev/posts/...

useCopyLink gained an optional format(link), applied to both clipboard writes — the immediate one and the shortened-URL ClipboardItem — 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/shared snapshot 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.
  • eslint + strict typecheck guard on the changed files: clean.

⚠️ The Android placement needs a real-device check on the preview before merge — it was verified in jsdom, and the 32px handle clearance is fixed while Android's handle size scales with display density.

🤖 Generated with Claude Code

Preview domain

https://claude-marked-text-copy-link-119.preview.app.daily.dev

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-webapp Ready Ready Preview Sep 10, 2026 3:30pm UTC

Request Review

tomeredlich and others added 3 commits September 10, 2026 18:19
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
tomeredlich force-pushed the claude/marked-text-copy-link-119e04 branch from f454d94 to 4b1ace7 Compare September 10, 2026 15:20
@tomeredlich tomeredlich changed the title fix(snapshot): copy the quote with the link from the selection bar fix(snapshot): copy the quote with the link, and clear Android's selection menu Sep 10, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants