feat(share): briefing copy actions + personalized digest share parity#6353
Draft
tsahimatsliah wants to merge 3 commits into
Draft
feat(share): briefing copy actions + personalized digest share parity#6353tsahimatsliah wants to merge 3 commits into
tsahimatsliah wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
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.
PR 7 of the sharing-visibility initiative. Stacks on PR 1 (#6343) — base is
claude/website-sharing-visibility-be6b32, notmain.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+ newBriefCopyMenu.tsx)Each row in
/briefinggains a copy menu with three actions:useSharePost().copyLinkpath (tracked short URL, toast, logging).summary, for pasting into Slack. Hidden when the brief has no summary.Grouped in a
DropdownMenuso a dense list row only grows by one control. The menu is rendered after the full-bleedCardLinkoverlay with an explicitz-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
ShareActionsprimitive — full social popover on desktop, single tap straight to the native share sheet on mobile — and it is lifted out of thehidden laptop:blockwrapper, since sharing a briefing matters at least as much on mobile.On the copy icon: PR 1 already wired
useShareCopyIcon(theshare_copy_icongate) into this file, soLinkIcon→CopyIconis already handled by that gate. This PR respects it rather than hard-swapping the glyph — the legacy button keeps the gated icon, andShareActionsalready shipsCopyIcon.BriefCopyMenuhonours the same gate for its trigger.3. Digest parity fix (
DigestPostContent.tsx)Confirmed against the code:
BriefPostContentrenders<BriefPostHeaderActions … showShareButton />whileDigestPostContentrenders the identical component with the prop omitted (it defaults tofalse), so the digest post has no share affordance today. The prop name and wiring in the brief were correct.DigestPostContentnow passesshowShareButton={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
BriefPostContentexactly: aDigestPostContentRawPropstype with a non-optionalpost,undefinedinstead ofnullfornavigationProps, and acollectionSourcesfallback. No behaviour change (PostContentContainertreatsnull/undefinedidentically).Flag
share_briefing_digest, appended at the end offeatureManagement.ts, defaultfalse. Resolved by the newuseShareBriefingDigesthook, which requires the masteruseSharingVisibility()gate as well and usesuseConditionalFeaturewithshouldEvaluate.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.SharePostwithShareProviderand the surface's existingOrigin(Origin.BriefPageon the list, the post's own origin on the header). No newOriginvalues 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.tsaliases 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 explicitshowCopyActionsprop 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 markedid="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— passedpnpm --filter shared lint— cleanNODE_ENV=test pnpm --filter shared test— 296 suites / 1998 tests passedNODE_ENV=test pnpm --filter webapp test— 44 suites / 297 tests passedNew 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