Skip to content

feat(share): post page & modal sharing treatments behind share_post_page#6350

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

feat(share): post page & modal sharing treatments behind share_post_page#6350
tsahimatsliah wants to merge 1 commit into
claude/website-sharing-visibility-be6b32from
claude/share-post-page-core

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 22, 2026

Copy link
Copy Markdown
Member

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 (PostContentBasePostContentPostEngagements) and the redesign path (PostFocusCard, swapped in by usePostRedesign on 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-container block in PostContent.tsx and into the summary block (text and video variants) in PostFocusCard.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 PostContentShare in PostEngagements.tsx, and directly below FocusCardActionBar in PostFocusCard.tsx. Left side is the invitation; right side is "Send to Slack" plus the PR-1 ShareActions popover for everything else.

#10 — redesigned recommend module (post/share/ShareModuleHeader.tsx)
ShareBar.tsx (desktop) and ShareMobile.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's share_copy_icon behaviour in ShareMobile is preserved in both branches.

Flag

share_post_page (featureSharePostPage, default false, appended at the end of featureManagement.ts).

Gated through useSharePostPage(), which stacks the topic flag on top of the sharing_visibility master kill-switch and uses useConditionalFeature with shouldEvaluate, 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 div added around the redesign summary only renders when the flag is on. ShareMobile uses an early return so the control branch is byte-identical.

⚠️ Open question — Slack (resolved, not guessed)

ShareProvider / getShareLink in packages/shared/src/lib/share.ts have 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 is SlackIntegrationModal / 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-surface Origin. Reused the existing enum where it fit; appended two genuinely-missing values at the end: Origin.PostSummary and Origin.PostTeamShare. The redesigned recommend module keeps the existing Origin.ShareBar.

Verification

Check Result
node ./scripts/typecheck-strict-changed.js ✅ no errors from this change. 4 pre-existing strict errors surface in PostEngagements.tsx (lines isSourcePublicSquad(post.source), the TimeSortIcon className, ref={commentRef}, onSignUp) — all untouched by this PR, confirmed present on the base branch.
pnpm --filter @dailydotdev/shared lint ✅ clean
NODE_ENV=test pnpm --filter shared test ✅ 295 suites / 1991 tests
pnpm --filter webapp test ✅ 44 suites / 297 tests
Storybook tsc --noEmit ✅ clean for the new story

New tests in packages/shared/src/components/post/share/PostPageShare.spec.tsx:

  • copy summary writes summary + link to the clipboard and shows a toast, and logs Origin.PostSummary
  • the TL;DR button renders nothing on a freeform post
  • "Send to Slack" copies the post link and toasts the paste hint
  • the mobile path calls navigator.share
  • flag-off preserves the existing widget exactly; flag-on adds the heading

The existing ShareBar.spec.tsx passes unchanged (it renders flag-off).

Storybook

packages/storybook/stories/components/share/PostPageShare.stories.tsxCopySummary (next to a real "Read post" primary, to show the hierarchy), CopySummaryOnFreeform (renders nothing), TeamStrip, TeamStripNarrow (stacked below tablet), RecommendModuleHeader.

Deliberately left out

  • No change to post/focus/DiscussionShareRow.tsx — it already ships the compact share row for the discussion panel and needed nothing for these items.
  • No restructuring of the ShareBar squads grid (option counts, "Show more options" collapse) — out of scope for a copy/emphasis redesign and it would have churned ShareBar.spec.tsx.
  • No native Slack integration (see above).

🤖 Generated with Claude Code

Preview domain

https://claude-share-post-page-core.preview.app.daily.dev

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

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