feat(share): end-of-conversation share band#6349
Draft
tsahimatsliah wants to merge 1 commit into
Draft
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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.
packages/shared/src/components/post/EndOfConversationShare.tsxEndOfConversationShareBand— 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.ShareActionsprimitive: mobile taps straight into the native share sheet (copy fallback), desktop opens the share popover. No bespoke share control.PostComments.tsxrenders the band as the last child of the comment list. A newhideEndOfConversationShareprop lets a parent place the band itself.PostDiscussionPanel.tsx(used byPostFocusCardon both the post page and the post modal) setshideEndOfConversationShareand renders the band at the true end of the panel, after the meta bar. This avoids a double band, since the panel composesPostComments.Threshold
More than 3 comments (
activeDiscussionCommentThreshold = 3, checked with>).Read from
Post.numComments— verified against the typed GraphQL model inpackages/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_conversation—featureShareEndOfConversation, appended at the end offeatureManagement.ts, defaultfalse.Gated on that flag and the master
useSharingVisibility()kill-switch. Both useuseConditionalFeaturewithshouldEvaluatetied 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.SharePostwith{ provider, origin }viapostLogEvent. NewOrigin.EndOfConversation = 'end of conversation'appended to the existing enum (no existing value covered this surface).Storybook
packages/storybook/stories/components/EndOfConversationShare.stories.tsx—ActiveDiscussion,AtThreshold(hidden),JustAboveThreshold,NoComments(hidden),Mobile. Same QueryClient + LogContext + mocked['shortUrl']decorator asShareActions.stories.tsx. Verified visually in light and dark themes.Verification
node ./scripts/typecheck-strict-changed.jspnpm --filter shared lintNODE_ENV=test pnpm --filter shared testNODE_ENV=test pnpm --filter webapp testNew 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 clipboardand logsSharePost/copy link/end of conversation; mobile single tap callsnavigator.shareand logs thenativeprovider.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, nocomplementarylandmark); hidden on a quiet discussion even with the flags on.pnpm --filter storybook lintwas not run — that script'seslintbinary is missing in this repo state (pre-existing, unrelated to this PR).Deliberately left out
EngagementRail(reader modal) — out of scope; it consumesPostComments, so it inherits the band when the flags are on.ShareActionsis icon-only by design, so the band uses the icon variant with anaria-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