feat(share): copy-link on discovery feeds and best-of archive (PR 16)#6364
Draft
tsahimatsliah wants to merge 2 commits into
Draft
feat(share): copy-link on discovery feeds and best-of archive (PR 16)#6364tsahimatsliah wants to merge 2 commits into
tsahimatsliah wants to merge 2 commits into
Conversation
Adds the sharing-visibility affordance to the discovery surfaces behind a new share_discovery flag (default false, AND-gated with the sharing_visibility master kill-switch via useSharingVisibility): - ExploreFeedShareButton: self-gated ShareActions wrapper that shares the canonical webapp URL of the active Explore sort and logs the generic ShareLog event (Origin.ExploreFeed, target_id = feed path) - FeedExploreHeader (non-v2, laptop + mobile sticky): control joins the right-side period-dropdown span; span only becomes a flex cluster when the flag is on so flag-off DOM is unchanged - MainFeedLayout v2 explore strip: control renders before the sort dropdown, only on isAnyExplore pages - ArchiveIndexPage / ArchiveFeedPage: control next to the h1, sharing the canonical archive URL, logging Origin.BestOfArchive - Jest: flag-off DOM parity, AND-gating, copy -> clipboard + toast, native share on mobile, exactly one control, and a webapp guard that non-explore feed pages never compose the control Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
All three discovery surfaces now pass a referral cid like comparable surfaces, and the archive controls get explicit Share-family labels instead of the primitive's Copy link default. Co-Authored-By: Claude Opus 4.8 <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.
Part of the sharing-visibility initiative (builds on PR 1 / #6343, based on
claude/website-sharing-visibility-be6b32).What
Adds the copy-link/share affordance to the discovery surfaces (plan item #25):
FeedExploreHeader(non-v2; laptop breadcrumb header and mobile sticky tab bar): aShareActionsicon control joins the existing right-side period-dropdown span (Float/Large to match the dropdown). The span only becomes aflex ... gap-2cluster when the flag is on, so flag-off DOM is unchanged.MainFeedLayoutv2 explore strip: the control renders betweenExploreSectionTabsandExploreSortDropdown, spaced by the page header's owngap-2, and only whenisAnyExplore— the strip's/discussedinstance does not get it (it is the Discussions feed, not an Explore sort; keeps v2/non-v2 surface parity).ExploreFeedShareButton, which resolves the canonical webapp URL of the active sort (URL-derived on webapp,tab-state fallback for the extension) so links copied from the extension resolve. Distinct accessible name "Copy link to feed" (feed cards already own per-post "Copy link" buttons)./posts/best-of*,/tags/[tag]/best-of*,/sources/[source]/best-of*)ArchiveIndexPageandArchiveFeedPage: control next to theh1, sharing the canonical archive URL (getArchiveIndexUrl/getArchiveUrl). Flag-off renders the exact original heading markup.Logging
One event per entity, per the initiative convention: generic
LogEvent.ShareLogwithtarget_id= the page path andextra.origin= newOrigin.ExploreFeed/Origin.BestOfArchive(appended at the end of the enum),extra.provider= share provider. No post-shaped events minted.Flag
share_discovery, defaultfalse, appended at the end offeatureManagement.ts. Gated via the newuseShareDiscoveryhook:useSharingVisibility()(master kill-switch) AND the per-topic flag throughuseConditionalFeature, with the per-topic flag only evaluated once the master gate passes. Flag-off is DOM-identical to the base branch (asserted in Jest via exact class-list checks).Surfaces that did NOT get the control (and why)
/discussed(v2 explore strip instance): Discussions feed, not a discovery sort — kept parity with non-v2 where the header doesn't render there./tags,/sources,/usersviaExploreHubHeader): out of this PR's scope (refactor: add guide to reputation #25 covers the discovery feeds + best-of archive only)./,/my-feed,/popular, custom feeds…): guarded by a webapp Jest test that forces the gate on and asserts the control never composes there.Verification
node ./scripts/typecheck-strict-changed.js— passpnpm --filter shared lint/pnpm --filter webapp lint— passNODE_ENV=test pnpm --filter shared test— 297 suites / 1995 tests passedNODE_ENV=test pnpm --filter webapp test— 45 suites / 298 tests passednavigator.share; AND-gating (each flag alone = off); exactly one control; flag-off class-list parity; non-explore composition guard.Notes
packages/webapp/components/archive/*paths don't exist — the archive pages live inpackages/shared/src/components/archive/(verified real paths).@growthbook/growthbook(not-react), so a genuine flag-gated story can't be expressed; Jest is the flag guarantee per the initiative convention. TheShareActionsprimitive already has stories from PR 1.cidon these links (no matchingReferralCampaignKeyfor feed/archive pages); plain canonical URLs.🤖 Generated with Claude Code
Preview domain
https://claude-share-discovery.preview.app.daily.dev