Skip to content

feat(share): make the post-upvote share prompt prominent#6351

Draft
tsahimatsliah wants to merge 1 commit into
claude/website-sharing-visibility-be6b32from
claude/share-post-upvote-prompt
Draft

feat(share): make the post-upvote share prompt prominent#6351
tsahimatsliah wants to merge 1 commit into
claude/website-sharing-visibility-be6b32from
claude/share-post-upvote-prompt

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 22, 2026

Copy link
Copy Markdown
Member

Stacks on PR 1 (claude/website-sharing-visibility-be6b32) — review that one first.

What changed

packages/shared/src/components/post/common/PostContentShare.tsx — the widget that fires on the post page right after a user upvotes — is redesigned from a plain copy-link row into a prominent, inviting card. This is a peak-end moment (the user just told us they liked the post), so it leans into that rather than whispering.

  • Reuses the Phase-0 ShareActions primitive (variant="inline") instead of the bespoke InviteLinkInput control. Copy link + X / WhatsApp / Facebook / Reddit / LinkedIn / Telegram / Email — and the native share sheet where it exists — are all one tap away.
  • Existing data path preserved. useGetShortUrl still resolves the tracked short URL (and still gates rendering while pending); the resolved short link is what gets copied/shared. No double-shortening — ShareActions is handed the already-short link with no cid.
  • Logging preserved and widened. Still postLogEvent(LogEvent.SharePost, post, { provider, origin: Origin.PostContent }) — now emitted for every provider, not just copy-link. Origin.PostContent already existed; no new enum value.
  • Stays mounted after a share so the user can hit more than one destination. Dismissal moved to an explicit CloseButton (the repo's dismissible-card pattern) instead of silently unmounting on copy.
  • Upvote glyph in a bg-brand-float / text-brand-default badge ties the card back to the action that triggered it. Semantic tokens only; verified in light and dark.

Flag

share_upvote_prompt — appended at the end of featureManagement.ts, default false. Gated on this flag AND the master useSharingVisibility() gate, both via useConditionalFeature with shouldEvaluate (the per-surface flag is only evaluated once the master gate passes, and neither is evaluated until the post is actually upvoted). Flag-off renders the current widget byte-for-byte.

Copy

Before

Should anyone else see this post?

After

Good call. Now pass it on.
Send it to the one person who'll actually read it. That's how millions of developers find the good stuff on daily.dev.

Storybook

packages/storybook/stories/components/PostContentShare.stories.tsxRedesigned, Control, RedesignedMobile, RedesignedCopying (play function; stubs the clipboard because the Storybook iframe can't write to the real one).

Note for anyone extending this: Storybook aliases @growthbook/growthbook to a mock whose getFeatureValue coerces every falsy default to the truthy string 'control', so a flag can never evaluate to false there. Flag-off is simulated by holding FeaturesReadyContext as not-ready, which is the exact path useConditionalFeature takes to fall back to the default value.

Verification

  • node ./scripts/typecheck-strict-changed.js — pass
  • pnpm --filter shared lint — pass (webapp untouched)
  • NODE_ENV=test pnpm --filter shared test — 295 suites / 1990 tests pass
  • NODE_ENV=test pnpm --filter webapp test — 44 suites / 297 tests pass
  • New PostContentShare.spec.tsx (5 tests): flag-off renders the current UI exactly; the short-URL GraphQL path still runs and its result is what's rendered/copied; copy writes the short link to the clipboard and raises the toast; the mobile path calls navigator.share with the short link and does not touch the clipboard; the close button dismisses.
  • Visually checked in Storybook: desktop light, desktop dark, 375px mobile.

🤖 Generated with Claude Code

Preview domain

https://claude-share-post-upvote-prompt.preview.app.daily.dev

Redesigns `PostContentShare` — the widget that appears right after a user
upvotes a post — from a plain "Should anyone else see this post?" copy-link
row into a prominent card that leans into the peak-intent moment.

- Reuses the Phase-0 `ShareActions` primitive (inline variant) instead of the
  bespoke `InviteLinkInput` control, so copy + every social destination are one
  tap away.
- Keeps the existing `useGetShortUrl` data path and `LogEvent.SharePost`
  logging (now for every provider, not just copy-link).
- Stays mounted after a share so the user can hit more than one destination;
  dismissal moves to an explicit close button.

Gated behind the new `share_upvote_prompt` flag AND the `sharing_visibility`
master gate. Flag-off renders the current widget unchanged.

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

vercel Bot commented Jul 22, 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 22, 2026 2:16pm
storybook Building Building Preview Jul 22, 2026 2:16pm

Request Review

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