fix: only hand the link to the OS share sheet on a touch device - #14
Merged
Merged
Conversation
Desktop Chromium exposes navigator.share, so Brave and Chrome on macOS relabelled the button Share and opened the macOS sheet. That sheet offers Mail, Messages, Notes and Reminders and no clipboard entry, which left no way to get the link out of a button that used to say Copy Link. Safari on macOS took the same wrong branch. Gate the sheet on (pointer: coarse) rather than on the API existing. A phone still gets the sheet; every desktop browser goes back to copying the link and showing the toast. Also let a failed share fall through to the clipboard. The old catch swallowed every error, so anything but a cancelled sheet left the button doing nothing at all; now only AbortError returns early. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
flield | 54910cb | Commit Preview URL Branch Preview URL |
Oct 02 2026, 07:23 PM |
The comment above the button still said the label swaps wherever the OS share sheet is available, which is the rule that caused the bug. AGENTS.md gains the trap itself: the API exists on desktop, the sheet it opens there has no clipboard entry, and the pane cannot verify the copy path because its document is never focused. 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.
What was wrong
Desktop Chromium exposes
navigator.share, so Brave and Chrome on macOS relabelled the button Share and opened the macOS share sheet. That sheet offers Mail, Messages, Notes and Reminders and no clipboard entry, which left no way to get the link out of a button that used to say Copy Link. Safari on macOS took the same branch.The fix
Gate the sheet on
(pointer: coarse)rather than on the API existing. A phone still gets the sheet, every desktop browser goes back to copying the link and showing the toast.A failed share now falls through to the clipboard too. The old
catchswallowed every error, so anything but a cancelled sheet left the button doing nothing at all; onlyAbortErrorreturns early now.The sitemap
lastmodfor/moves to today, whichchecks.pyrequires wheneverindex.htmlchanges.Verification
checks.py origin/mainpasses, including the link-format and cache-bust checks. No versioned file changed, so no?v=bump.(pointer: coarse)reads false at desktop size and true under touch emulation, so the gate separates the two cases.navigator.clipboard.writeTextthrowsNotAllowedErrorthere because the pane's document is never focused. Worth pressing the button in Brave, and on a phone to confirm the share sheet still appears, before merging.🤖 Generated with Claude Code