fix(share): open the native share sheet from the press - #6564
Closed
tomeredlich wants to merge 1 commit into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tomeredlich
force-pushed
the
snapshot-post-share-placements
branch
from
September 2, 2026 14:56
0d3c20f to
aeff1f0
Compare
navigator.share needs the user activation the press carried. The hook awaited the link shortener first, and a campaign key makes that a real round trip, so by the time the sheet was asked for the activation was gone and the browser refused it. Every caller that shares natively — the profile widget, world share, the invite page, tool pages, the squad and feed menus, the interests agent — was reaching the sheet only when the shortener answered instantly. Native share now goes out inside the press, addressed with getTrackedUrl: the same campaign, no request. The payload is text and url rather than a link concatenated onto the text, matching what the profile widget already asserts. Copying is unaffected — it can afford the round trip, so it keeps the short link. Testing: shared 378 suites / 2759 tests, webapp 86 / 686, extension 6 / 52, package lint clean for shared and webapp. New spec covers both paths. Mockup-to-eng-pass: 1 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tomeredlich
force-pushed
the
snapshot-post-share-placements
branch
from
September 3, 2026 09:36
aeff1f0 to
702f1e7
Compare
tomeredlich
changed the base branch from
snapshot-post-page-variations
to
main
September 3, 2026 09:36
tomeredlich
marked this pull request as ready for review
September 6, 2026 06:13
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.
Standalone — base is
main, no dependency on #6556.What changes
navigator.shareneeds the user activation the press carried.useShareOrCopyLinkawaited the link shortener before calling it, and a campaign key makes that a real network round trip, so by the time the sheet was asked for the activation was gone and the browser refused it. Every caller that shares natively reached the sheet only when the shortener happened to answer instantly: the profile share widget, world share, the invite page, tool pages, the squad and custom-feed menus, and the interests agent.Native share now goes out inside the press, addressed with
getTrackedUrl— the same campaign parameters, no request. The payload is{ text, url }rather than a link concatenated onto the text, which is the shapeProfileWidgets/Sharealready asserts.Copying is untouched: it can afford the round trip, so it keeps the short link.
Not in this PR
shouldUseNativeShare()is'share' in navigator && isMobile(), so desktop browsers that support the API still copy rather than share. That is the existing product behaviour and changing it is a product decision, not a bug fix.Events
Unchanged.
ShareProvider.Nativestill logs on the native path,CopyLinkon the copy path.Experiment
None.
Testing
typecheck-strict-changedclean; package lint clean for shared and webapp.useShareOrCopyLink.spec.tsx: the native path shares{ text, url }without waiting on the shortener, and the copy path still copies the shortened link.🤖 Generated with Claude Code
Review links
The fix only shows on the native path, so it has to be judged on a phone: open the preview on mobile and press Share on any profile — the sheet should appear on the press instead of after a beat, or not at all.
Features/Snapshot/Surfaces/Post pageon feat(snapshot): share placements for the post page #6556's build: https://storybook-git-snapshot-post-page-variations-dailydotdev.vercel.app/?path=/story/features-snapshot-surfaces-post-page--variationsPreview domain
https://snapshot-post-share-placements.preview.app.daily.dev