feat(share): post page & modal sharing treatments behind share_post_page#6350
Draft
tsahimatsliah wants to merge 1 commit into
Draft
feat(share): post page & modal sharing treatments behind share_post_page#6350tsahimatsliah wants to merge 1 commit into
tsahimatsliah wants to merge 1 commit into
Conversation
Covers sharing-visibility wish-list items #1, #6, #8 and #10 on the post page and post modal, on both the classic and redesign (PostFocusCard) paths, so every post type is covered. - #1 "Copy summary": a quiet tertiary action at the end of the TL;DR block that copies the summary plus a short link back to the post. Freeform posts have no summary, so it is absent there by construction. - #6 "Share this with your team": a quiet band in the engagements region (PostEngagements / below FocusCardActionBar). Slack publishes no web share-intent URL, so "Send to Slack" copies the link — Slack unfurls a pasted daily.dev link from its OG tags. - #10: the desktop ShareBar and mobile ShareMobile widgets get a shared encouraging heading and a promoted copy-link primary. All of it is gated on the new `share_post_page` flag stacked on top of the `sharing_visibility` master kill-switch; flag-off renders the exact DOM as before. 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 (#6343,
claude/website-sharing-visibility-be6b32) — review that first.Covers sharing-visibility wish-list items #1 (TL;DR copy), #6 (team strip), #8 (all post types) and #10 (redesign the share widget).
What changed
Both the classic path (
PostContent→BasePostContent→PostEngagements) and the redesign path (PostFocusCard, swapped in byusePostRedesignon both the post page and the post modal) get the treatment, so post page + modal + every post type are covered by construction.#1 — "Copy summary" (
post/share/CopySummaryButton.tsx)A quiet tertiary button at the end of the TL;DR block that copies the summary plus a short link back to the post, so a paste keeps its attribution. Deliberately secondary — "Read post" stays the only filled CTA. Wired into the classic
tldr-containerblock inPostContent.tsxand into the summary block (text and video variants) inPostFocusCard.tsx. Freeform/welcome posts carry no summary, so the button is absent there by construction — asserted in a test.#6 — "Share this with your team" (
post/share/ShareWithTeamStrip.tsx)A quiet band (not a modal) in a fixed slot in the engagements region: after
PostContentShareinPostEngagements.tsx, and directly belowFocusCardActionBarinPostFocusCard.tsx. Left side is the invitation; right side is "Send to Slack" plus the PR-1ShareActionspopover for everything else.#10 — redesigned recommend module (
post/share/ShareModuleHeader.tsx)ShareBar.tsx(desktop) andShareMobile.tsx(mobile) share one heading — "Know someone who should read this?" with a supporting line — replacing the old yes/no "Would you recommend this post?". Copy link is promoted to the primary action in both. PR 1'sshare_copy_iconbehaviour inShareMobileis preserved in both branches.Flag
share_post_page(featureSharePostPage, defaultfalse, appended at the end offeatureManagement.ts).Gated through
useSharePostPage(), which stacks the topic flag on top of thesharing_visibilitymaster kill-switch and usesuseConditionalFeaturewithshouldEvaluate, so the topic flag is only evaluated once the initiative is on (and, for the TL;DR button, only when the post actually has a summary).Flag-off is DOM-identical to the PR 1 branch — every new element is behind the gate, and the wrapper
divadded around the redesign summary only renders when the flag is on.ShareMobileuses an early return so the control branch is byte-identical.ShareProvider/getShareLinkinpackages/shared/src/lib/share.tshave no Slack target, and Slack publishes no public web share-intent URL (unlike X / WhatsApp / LinkedIn / Telegram / Reddit / Facebook). The repo's only Slack integration isSlackIntegrationModal/UserIntegrationType.Slack, which connects a squad to a channel — it cannot post an arbitrary post on the user's behalf.Decision: "Send to Slack" copies the post link and toasts
✅ Link copied — paste it in any Slack channel. Slack unfurls a pasted daily.dev link into a rich card from the post's OG tags, so the outcome is the intended one with no fake URL invented.Backend dependency: a first-class Slack app posting via
chat.postMessage/chat.unfurl(real channel picker, one-click send) needs a daily-api Slack OAuth scope + endpoint. Not something the client can do alone — worth a follow-up ticket if we want the real thing.Logging
LogEvent.SharePost+ShareProvider+ a per-surfaceOrigin. Reused the existing enum where it fit; appended two genuinely-missing values at the end:Origin.PostSummaryandOrigin.PostTeamShare. The redesigned recommend module keeps the existingOrigin.ShareBar.Verification
node ./scripts/typecheck-strict-changed.jsPostEngagements.tsx(linesisSourcePublicSquad(post.source), theTimeSortIconclassName,ref={commentRef},onSignUp) — all untouched by this PR, confirmed present on the base branch.pnpm --filter @dailydotdev/shared lintNODE_ENV=test pnpm --filter shared testpnpm --filter webapp testtsc --noEmitNew tests in
packages/shared/src/components/post/share/PostPageShare.spec.tsx:Origin.PostSummarynavigator.shareThe existing
ShareBar.spec.tsxpasses unchanged (it renders flag-off).Storybook
packages/storybook/stories/components/share/PostPageShare.stories.tsx—CopySummary(next to a real "Read post" primary, to show the hierarchy),CopySummaryOnFreeform(renders nothing),TeamStrip,TeamStripNarrow(stacked below tablet),RecommendModuleHeader.Deliberately left out
post/focus/DiscussionShareRow.tsx— it already ships the compact share row for the discussion panel and needed nothing for these items.ShareBarsquads grid (option counts, "Show more options" collapse) — out of scope for a copy/emphasis redesign and it would have churnedShareBar.spec.tsx.🤖 Generated with Claude Code
Preview domain
https://claude-share-post-page-core.preview.app.daily.dev