Skip to content

feat(share): briefing copy actions + personalized digest share parity#6353

Draft
tsahimatsliah wants to merge 3 commits into
claude/website-sharing-visibility-be6b32from
claude/share-briefing-digest
Draft

feat(share): briefing copy actions + personalized digest share parity#6353
tsahimatsliah wants to merge 3 commits into
claude/website-sharing-visibility-be6b32from
claude/share-briefing-digest

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 22, 2026

Copy link
Copy Markdown
Member

PR 7 of the sharing-visibility initiative. Stacks on PR 1 (#6343) — base is claude/website-sharing-visibility-be6b32, not main.

Today a presidential briefing is one of the most shareable things daily.dev produces, and there is almost nowhere to share it from: the briefing list has no copy affordance at all, the briefing header has a single desktop-only copy-link button, and the personalized digest post — which renders the same header component — has no share affordance whatsoever.

What changed

1. Per-item copy actions on the briefing list (BriefListItem.tsx + new BriefCopyMenu.tsx)

Each row in /briefing gains a copy menu with three actions:

  • Copy link — delegates to the existing useSharePost().copyLink path (tracked short URL, toast, logging).
  • Copy summary — copies the brief's generated summary, for pasting into Slack. Hidden when the brief has no summary.
  • Copy title and link — a ready-to-paste snippet.

Grouped in a DropdownMenu so a dense list row only grows by one control. The menu is rendered after the full-bleed CardLink overlay with an explicit z-1, so it stays clickable instead of being swallowed by the card link.

2. Whole-briefing share on the post header (BriefPostHeaderActions.tsx)

With the flag on, the desktop-only copy-link button is replaced by PR 1's ShareActions primitive — full social popover on desktop, single tap straight to the native share sheet on mobile — and it is lifted out of the hidden laptop:block wrapper, since sharing a briefing matters at least as much on mobile.

On the copy icon: PR 1 already wired useShareCopyIcon (the share_copy_icon gate) into this file, so LinkIconCopyIcon is already handled by that gate. This PR respects it rather than hard-swapping the glyph — the legacy button keeps the gated icon, and ShareActions already ships CopyIcon. BriefCopyMenu honours the same gate for its trigger.

3. Digest parity fix (DigestPostContent.tsx)

Confirmed against the code: BriefPostContent renders <BriefPostHeaderActions … showShareButton /> while DigestPostContent renders the identical component with the prop omitted (it defaults to false), so the digest post has no share affordance today. The prop name and wiring in the brief were correct. DigestPostContent now passes showShareButton={isShareEnabled} — gated, so flag-off keeps the digest button off exactly as it is today.

While making that file a "changed file", the strict-typecheck guard surfaced its pre-existing strict-null backlog. Fixed by mirroring the sibling BriefPostContent exactly: a DigestPostContentRawProps type with a non-optional post, undefined instead of null for navigationProps, and a collectionSources fallback. No behaviour change (PostContentContainer treats null/undefined identically).

Flag

share_briefing_digest, appended at the end of featureManagement.ts, default false. Resolved by the new useShareBriefingDigest hook, which requires the master useSharingVisibility() gate as well and uses useConditionalFeature with shouldEvaluate.

Flag-off is pixel-identical to PR 1, asserted in Jest: the briefing row renders no interactive controls at all, the brief header keeps its legacy copy-link button, and the digest post exposes nothing.

Logging

LogEvent.SharePost with ShareProvider and the surface's existing Origin (Origin.BriefPage on the list, the post's own origin on the header). No new Origin values were needed — the existing enum already covers these surfaces.

Storybook

stories/components/BriefSharing.stories.tsx — the copy menu standalone, the no-summary variant, and the list row in enabled / control / read states.

Note for reviewers: packages/storybook/.storybook/main.ts aliases GrowthBook to a mock that returns the string 'control' for every flag, which is truthy — so any flag-gated story reads as ON there. The stories therefore pin state through an explicit showCopyActions prop rather than the flag, and flag-off behaviour is asserted in Jest, which is unaffected by that mock.

OG image — deferred, deliberately

Not shipped. The repo has no OG image library; packages/webapp/pages/image-generator/ pages (devcards/[userId].tsx, badges/[badgeId].tsx) are plain Next.js pages marked id="screenshot_wrapper" that a backend screenshot service renders and captures. Adding a briefing/digest OG image therefore needs that service taught a new route plus an ISR data path for brief posts — a backend dependency that cannot land from this repo alone, and it would roughly double the surface area of this PR. Flagging it rather than half-building it: happy to do it as a follow-up once the backend route exists.

Verification

  • node ./scripts/typecheck-strict-changed.js — passed
  • pnpm --filter shared lint — clean
  • NODE_ENV=test pnpm --filter shared test — 296 suites / 1998 tests passed
  • NODE_ENV=test pnpm --filter webapp test — 44 suites / 297 tests passed

New tests cover: clipboard write + toast on copy, the mobile path calling navigator.share, the digest post exposing a share button while the brief still does, and flag-off preserving the current UI.

🤖 Generated with Claude Code

Preview domain

https://claude-share-briefing-digest.preview.app.daily.dev

tsahimatsliah and others added 2 commits July 22, 2026 16:55
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 7:10pm
storybook Building Building Preview Jul 22, 2026 7:10pm

Request Review

Copy summary and Copy title-and-link now log ShareProvider.CopyText with a
content discriminator, so the three menu actions are no longer analytically
identical. CopyText matches the sibling text-selection branch byte-for-byte.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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