Skip to content

feat(share): end-of-conversation share band#6349

Draft
tsahimatsliah wants to merge 1 commit into
claude/website-sharing-visibility-be6b32from
claude/share-end-of-conversation
Draft

feat(share): end-of-conversation share band#6349
tsahimatsliah wants to merge 1 commit into
claude/website-sharing-visibility-be6b32from
claude/share-end-of-conversation

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 22, 2026

Copy link
Copy Markdown
Member

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

What changed

Adds the end-of-conversation share band: an encouraging prompt rendered below the comment list once a post has a real discussion.

  • New packages/shared/src/components/post/EndOfConversationShare.tsx
    • EndOfConversationShareBand — the band itself + the activity threshold, no feature gates (so Storybook can render both sides of the threshold without a GrowthBook instance).
    • EndOfConversationShare — the gated wrapper actually used by the app.
    • Reuses the Phase-0 ShareActions primitive: mobile taps straight into the native share sheet (copy fallback), desktop opens the share popover. No bespoke share control.
    • Copy: "Enjoyed this discussion?" / "Send it to someone who'd have opinions."
  • Classic pathPostComments.tsx renders the band as the last child of the comment list. A new hideEndOfConversationShare prop lets a parent place the band itself.
  • Redesign pathPostDiscussionPanel.tsx (used by PostFocusCard on both the post page and the post modal) sets hideEndOfConversationShare and renders the band at the true end of the panel, after the meta bar. This avoids a double band, since the panel composes PostComments.

Threshold

More than 3 comments (activeDiscussionCommentThreshold = 3, checked with >).

Read from Post.numComments — verified against the typed GraphQL model in packages/shared/src/graphql/posts.ts (numComments?: number, total comments incl. replies), not from prose. At exactly 3, or with 0, nothing renders — we never show an empty or low-activity share prompt.

Flag

share_end_of_conversationfeatureShareEndOfConversation, appended at the end of featureManagement.ts, default false.

Gated on that flag and the master useSharingVisibility() kill-switch. Both use useConditionalFeature with shouldEvaluate tied to the comment threshold, so GrowthBook is only evaluated when the band could actually render.

Flag-off is pixel-identical to PR 1 — the component returns null, adding no DOM. Asserted by a test.

Logging

LogEvent.SharePost with { provider, origin } via postLogEvent. New Origin.EndOfConversation = 'end of conversation' appended to the existing enum (no existing value covered this surface).

Storybook

packages/storybook/stories/components/EndOfConversationShare.stories.tsxActiveDiscussion, AtThreshold (hidden), JustAboveThreshold, NoComments (hidden), Mobile. Same QueryClient + LogContext + mocked ['shortUrl'] decorator as ShareActions.stories.tsx. Verified visually in light and dark themes.

Verification

Check Result
node ./scripts/typecheck-strict-changed.js pass
pnpm --filter shared lint pass (0 errors)
NODE_ENV=test pnpm --filter shared test 296 suites / 1996 tests pass
NODE_ENV=test pnpm --filter webapp test 44 suites / 297 tests pass
Storybook render (light + dark) pass

New tests (11):

  • EndOfConversationShare.spec.tsx — hidden at exactly 3 and at 0; shown at 4; hidden with the master switch off; hidden with its own flag off; hidden at both defaults; desktop copy writes to the clipboard, toasts ✅ Copied link to clipboard and logs SharePost/copy link/end of conversation; mobile single tap calls navigator.share and logs the native provider.
  • PostComments.spec.tsx — band appended after the last comment on an active discussion; flag-off leaves the comment list DOM untouched (last child is still the last comment, no complementary landmark); hidden on a quiet discussion even with the flags on.

pnpm --filter storybook lint was not run — that script's eslint binary is missing in this repo state (pre-existing, unrelated to this PR).

Deliberately left out

  • Did not touch EngagementRail (reader modal) — out of scope; it consumes PostComments, so it inherits the band when the flags are on.
  • No text label on the share trigger: ShareActions is icon-only by design, so the band uses the icon variant with an aria-label + tooltip ("Share this discussion") rather than forking the primitive.

🤖 Generated with Claude Code

Preview domain

https://claude-share-end-of-conversation.preview.app.daily.dev

Adds an encouraging share band below the comment list of posts with an
active discussion (more than 3 comments, read from `Post.numComments`).
It reuses the Phase-0 `ShareActions` primitive, so mobile taps straight
into the native share sheet and desktop opens the share popover.

- add EndOfConversationShare (threshold + flag gates) with Storybook
  stories covering below/at/above threshold and the mobile layout
- render it below the comment list in PostComments (classic path) and at
  the end of PostDiscussionPanel (post-redesign path)
- add the share_end_of_conversation flag (default false) on top of the
  sharing_visibility kill-switch, plus an EndOfConversation Origin
- log LogEvent.SharePost with the provider and the new origin

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:09pm
storybook Building Building Preview Jul 22, 2026 2:09pm

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