Skip to content

feat(share): sharing-visibility foundation (PR 1) - #6343

Draft
tsahimatsliah wants to merge 2 commits into
mainfrom
claude/website-sharing-visibility-be6b32
Draft

feat(share): sharing-visibility foundation (PR 1)#6343
tsahimatsliah wants to merge 2 commits into
mainfrom
claude/website-sharing-visibility-be6b32

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 21, 2026

Copy link
Copy Markdown
Member

Foundation for the sharing-visibility initiative — a reusable share affordance + flags. Behind flags; share_copy_icon default off means no user-visible change vs main.

Part of the multi-PR sharing-visibility initiative (Storybook-first, one PR per surface). Full plan tracked separately.

Highlights

  • ShareActions primitive (icon/inline; desktop popover, mobile native share) + Storybook story
  • feature_sharing_visibility master kill-switch + useSharingVisibility gate
  • core copy-icon swap (LinkIcon→CopyIcon) gated behind share_copy_icon (default off) via useShareCopyIcon
  • new share-surface Origin values

🤖 Generated with Claude Code

Preview domain

https://claude-website-sharing-visibilit.preview.app.daily.dev

Reusable ShareActions primitive (icon/inline variants, desktop popover +
mobile native share) plus the initiative's flags and a flag-gated core
copy-icon swap.

- add ShareActions + Storybook story, useSharingVisibility gate
- add feature_sharing_visibility (master kill-switch) and share_copy_icon
- gate LinkIcon->CopyIcon swap behind share_copy_icon (default off == main)
  in ShareMobile, ActionButtons.v2, BriefPostHeaderActions
- add share-surface Origin values

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Jul 28, 2026 12:41pm
storybook Building Building Preview Jul 28, 2026 12:41pm

Request Review

@tsahimatsliah

Copy link
Copy Markdown
Member Author

🧭 Task context (auto-maintained by /fresh)

  • Goal: Increase sharing visibility across daily.dev — add copy-link/share affordances on ~26 surfaces + an onboarding invite→Plus step, delivered as one PR per topic.
  • Branch: claude/website-sharing-visibility-be6b32 → main
  • Updated: 2026-07-21

Current focus: PR 1 (Foundation) is complete. Next up is PR 2 (feed-card copy-icon + hover share-out), Storybook-first.

Decisions (and why):

  • Storybook-first for every PR — build/iterate the component + story, get look-and-feel sign-off, THEN wire into surfaces (saves credits, faster iteration).
  • Per-topic GrowthBook flags + master kill-switch feature_sharing_visibility (all default false).
  • Core copy-icon swap (LinkIcon→CopyIcon) gated behind its OWN flag share_copy_icon (default off) — changing a core high-traffic icon must ramp independently to protect metrics; flag-off == main.
  • Reuse existing infra: useShareOrCopyLink, SocialShareList, getShareLink/ShareProvider, useGetShortUrl, Radix Popover.
  • Research: OG meta is the feat: turn links in comments to anchor elements #1 lever (link networks ignore URL params); TikTok dropped (no web intent); Slack has no share-intent URL (needs unfurl/OG or Slack app).

Key files:

  • packages/shared/src/components/share/ShareActions.tsx — reusable primitive (icon/inline; desktop popover + mobile native share; onShare(provider) callback)
  • packages/shared/src/hooks/useSharingVisibility.ts — master gate; useShareCopyIcon.ts — icon-swap gate
  • packages/shared/src/lib/featureManagement.tsfeature_sharing_visibility, share_copy_icon
  • packages/shared/src/lib/log.ts — new share Origins
  • packages/storybook/stories/components/ShareActions.stories.tsx — Icon/IconOpenOnHover/Inline stories
  • Gated icon swap: ShareMobile.tsx, cards/common/ActionButtons.v2.tsx, post/brief/BriefPostHeaderActions.tsx
  • Full plan (not in repo): ~/.claude/plans/okay-we-have-an-cheeky-pearl.md

Done:

  • PR 1 foundation: ShareActions + story, both flags + gates, gated copy-icon swap on 3 surfaces, new Origins.
  • Verified: strict typecheck, lint, tests (ShareActions 3/3 + card/brief 30/30), Storybook renders (localhost:6006).

Next:

  • PR 2 — feed-card: swap copy action to CopyIcon (flag) + hover-reveal share-out popover (Slack/WhatsApp/socials); mirror on comments (copy-permalink primary). Build story first.

Gotchas:

  • Two architectural splits to respect: engagement bar V1/V2 (useEngagementBarV2, .tsx.v2.tsx) and post redesign Focus Card (usePostRedesign).
  • No OG-image library — dynamic images = screenshot of Next pages under pages/image-generator/* (id="screenshot_wrapper").
  • Storybook story decorators need QueryClient + AuthContext + LogContext + mock ['shortUrl'] (useGetShortUrl reads AuthContext).
  • Node here is 24.17 vs repo 24.18 (harmless engine warning); deps needed pnpm install in this worktree.
  • ShareActions primitive itself uses CopyIcon unconditionally — fine, it's net-new UI wired only behind per-surface flags later. Only swaps on EXISTING surfaces are gated.

To continue this task in a fresh chat: check out claude/website-sharing-visibility-be6b32, then run /fresh https://github.com/dailydotdev/apps/pull/6343.

tsahimatsliah added a commit that referenced this pull request Jul 27, 2026
Clicking the profile control opened a network popover — a second decision
before anything useful happened. It now copies straight away and confirms
twice: the glyph flips to a green check for a second (VIcon in
text-status-success, the same check the product uses elsewhere) and a
toast names what landed on the clipboard.

- ProfileShareButton drops ShareActions and drives useShareOrCopyLink
  directly, so it keeps the dly.to shortening, the ShareProfile referral
  campaign and the ShareProfile log event with its provider.
- Mobile is unchanged: where the platform offers a native share sheet a
  tap still opens it, and the check/toast only fire on the copy path.
- Labels follow the behaviour: "Copy link to your profile" /
  "Copy link to @user's profile", replacing the old "Share …".
- useShareOrCopyLink takes an optional copyMessage so the toast can name
  the profile instead of the generic "Copied link to clipboard".

ShareActions itself is untouched and still owned by PR 1 (#6343) for the
other surfaces in the initiative.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tsahimatsliah added a commit that referenced this pull request Jul 28, 2026
Review pass: this PR was reaching into files PR 1 (#6343) owns, even
though none of them are needed for the profile control.

Restored to the base branch, unchanged by this PR:
- ShareActions.tsx — the profile control drives useShareOrCopyLink
  directly, so it has no reason to touch the primitive's glyph.
- ShareMobile / ActionButtons.v2 / BriefPostHeaderActions and
  useShareCopyIcon — the share_copy_icon experiment is PR 1's call about
  a different set of surfaces, not this PR's to unwind.
- useSharingVisibility and the sharing_visibility flag — this PR stops
  consuming the initiative-wide kill-switch, but deleting infrastructure
  later surfaces may still want belongs in PR 1.
- ShareActions.stories.tsx — reverted the decorator refactor.

The Storybook review page documents this PR's control instead of PR 1's
primitive: the variant/size grid now renders ProfileShareButton with the
two combinations actually used.

Net diff is 13 files, all profile-share.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <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.

1 participant