feat(share): copy-link control on squad directory cards#6363
Draft
tsahimatsliah wants to merge 2 commits into
Draft
feat(share): copy-link control on squad directory cards#6363tsahimatsliah wants to merge 2 commits into
tsahimatsliah wants to merge 2 commits into
Conversation
Adds a small copy-link/share button next to a slightly-narrowed Join Squad button on the three squad directory card variants (featured SquadGrid, UnfeaturedSquadGrid, mobile SquadList), built on the shared ShareActions primitive. - New `SquadDirectoryShareButton` wraps ShareActions with the squad permalink, the `share_source` referral cid, and `ShareSource` logging (squads are sources; the surface is distinguished by `origin: squad directory`). - New `useSquadDirectoryShareEnabled` gate: the `share_squad_directory` flag is only evaluated once the `sharing_visibility` master switch is on. - Per-variant layout: grid narrows the full-width Join to `flex-1` inside a gap-2 row; the list reserves extra room on the truncating text column; the unfeatured grid pairs the control with Join in the header row. Flag-off renders the exact original DOM (asserted byte-for-byte in the specs). - Storybook showcase for all three variants with flag on/off plus a copy-flow play test; Jest covers copy → clipboard + toast, native share on mobile, logging, flag gating, and that joining still works with the flag on. Also clears the pre-existing strict-tsc looseness in SquadGrid.tsx so the changed-file strict guard passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The desktop trigger opens a share popover rather than copying, so the Share verb family is accurate; Copy link stays for direct-copy buttons. 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.
Part of the sharing-visibility initiative (PR 15 / #18): a small copy-link/share button next to a slightly-narrowed Join Squad button on the squad directory cards.
Changes
SquadDirectoryShareButton(new,packages/shared/src/components/cards/squad/): wraps the Phase-0ShareActionsprimitive with the squadpermalink(verified on the typedSourcemodel), theshare_sourcereferral cid, and share logging. Desktop opens the share popover; mobile is a single tap to native share / copy.useSquadDirectoryShareEnabled(new hook): per-topicshare_squad_directoryflag evaluated only once thesharing_visibilitymaster switch is on (useConditionalFeature+shouldEvaluate), so control users are never bucketed.SquadGrid: full-width Join becomesflex-1inside agap-2row with the icon control.SquadList: control appended to the row (inherits the existinggap-4on both sides); the truncating text column reserves the extra3.5remonly when the flag is on.UnfeaturedSquadGrid: Join + control paired in the header row.SquadDirectoryShare.stories.tsxshowcases all three variants, flag on/off (flag-off simulated by holdingFeaturesReadyContextnot-ready since the repo-wide gb mock coerces flags truthy), plus a copy-flow play test.SquadGrid.tsx(nullable id/campaign/members handling) with no behavior change.Flag
share_squad_directory, defaultfalse, appended at the end offeatureManagement.ts; additionally gated by thesharing_visibilitymaster kill-switch viauseSharingVisibility.Log event
Reuses
LogEvent.ShareSourcewithtarget_type: source,target_id: <squad id>, andextra: { origin: "squad directory", provider }. Squads are sources in the data model andShareSourceis the existing source-share event (SourceActions, source menu); the surface is distinguished byOrigin.SquadDirectoryper the initiative's one-event-per-entity convention — no new event name minted,SharePostavoided (post-shaped).Verification
node ./scripts/typecheck-strict-changed.js— passes.pnpm --filter shared lint— passes (afterlint:fixformatting).NODE_ENV=test pnpm --filter shared test— 296 suites / 1998 tests passed.NODE_ENV=test pnpm --filter webapp test— 44 suites / 297 tests passed.navigator.share(and copy fallback); flag-off DOM byte-identical (exact class strings + no wrapper); Join Squad mutation still fires with the flag on; master-gate short-circuit (per-topic flag never evaluated when the kill-switch is off).🤖 Generated with Claude Code
Preview domain
https://claude-share-squad-directory.preview.app.daily.dev