feat(share): flat share band after an upvote, for everyone - #6378
Merged
tsahimatsliah merged 5 commits intoJul 28, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The post-upvote prompt needs the same one-line band: encouraging copy beside a split copy-link control. Pulling it into `ShareBand` keeps the two surfaces from drifting rather than growing a second copy of the markup. Callers keep what actually differs — copy, link, and the surface classes, since one sits below the comment list and the other in the post body. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…bars Surfaces that fire off the back of an upvote read `usePostActions().interaction`, not `post.userState.vote`. Only `useCardActions` — the feed cards — ever recorded it, so upvoting anywhere on the post page left it empty and those surfaces never appeared. On mobile, where the upvote lives in `MobilePostFloatingBar`, that covered every path. Adds `useRecordUpvoteInteraction` and wires the four post-page bars through it, so a fifth surface has one obvious thing to call. Deliberately not folded into `useVotePost`, which would cover every surface at once: `useCardCover` turns `interaction === 'upvote'` into a share overlay on the feed card, so an upvote from the post page would leave an overlay waiting back in the feed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replaces the "Should anyone else see this post?" copy-link widget with a prompt that reads as part of the page: one flat line of encouraging copy beside a split copy-link control, the social networks behind its chevron. Two independent axes, so the treatment can be chosen without touching layout code: - `promptVariant` — band (default), hero, card, or control - `surface` — flat (default) or card Ships to everyone rather than behind a flag, matching the end-of-conversation band; today's widget survives as the `control` treatment. Also mounts the prompt in `PostFocusCard`. That layout does not go through `PostEngagements`, so it never rendered the prompt at all — anything added there is invisible on the redesigned post page. The strict-type fixes in `PostEngagements` are collateral: the repo's changed-file guard fails the file otherwise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Every state of the prompt: four treatments, both surfaces, both themes, mobile at a real 390px, the two states where it renders nothing, and its placement on a mock post page. The playground drives treatment, surface and copy from one screen so the wording can be picked against the real control. Stories pin a 1280px viewport: `ShareActions` drops its chevron below 1020px measured against the story iframe — the window minus the sidebar and addons panel — so the split control otherwise showed as a lone copy button depending on the reviewer's panel layout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tsahimatsliah
force-pushed
the
storybook-preview/upvote-share-hero-dropdown
branch
from
July 28, 2026 07:28
36009a2 to
42784c7
Compare
Locks the analytics contract: SharePost with
extra={provider, origin: 'post content'}, the same shape every other share
surface emits, and exactly one event per copy — `useShareOrCopyLink` logs its
own when handed a `logObject`, and `ShareActions` deliberately does not pass
one.
Covers the social path too, which fires the provider the reader picked.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
rebelchris
approved these changes
Jul 28, 2026
tsahimatsliah
marked this pull request as ready for review
July 28, 2026 12:35
tsahimatsliah
merged commit Jul 28, 2026
6dff95a
into
claude/share-split-copy-button
14 checks passed
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 #6369 (
claude/share-split-copy-button). Base is that branch, so this diff is only the prompt.What changes for users
Upvote a post and the "Should anyone else see this post?" widget is replaced by a prompt that reads as part of the page: one flat line of encouraging copy beside a split copy-link control, with the social networks behind its chevron.
It ships to everyone — no feature flag — matching the end-of-conversation band in #6369.
Two independent axes
promptVariantband/hero/card/controlbandsurfaceflat/cardflatflatspends no chrome at all: no fill, no border, no rule, with matched margins so the prompt sits centred between the action bar and the comment box.Two bugs this also fixes
The prompt could never appear from the post page. It gates on
usePostActions().interaction, notpost.userState.vote. OnlyuseCardActions— the feed cards — ever recorded that interaction, so upvoting on the post page, in the post modal, or from the mobile floating bar left it empty.useRecordUpvoteInteractionnow covers all four post-page bars.Not folded into
useVotePost, which would have covered everything at once:useCardCoverturnsinteraction === 'upvote'into a share overlay on the feed card, so an upvote from the post page would leave an overlay waiting back in the feed.PostFocusCardnever rendered the prompt. That layout does not go throughPostEngagements. Anything added there is invisible on the redesigned post page.Reuse
ShareBandis extracted fromEndOfConversationShareand used by both surfaces, so the two cannot drift. Callers keep only what differs: copy, link, and the surface classes.Where to see it
Components/Share/PostContentShare Playground— treatments, surfaces, themes, mobile at a real 390px, and placement on a mock post page.Notable behaviour
Below 1020px
ShareActionsdrops the chevron for every non-inline variant, so band and hero become a single button opening the OS share sheet. That is #6369's mobile path; the card keeps its tiles at every width.Notes for review
PostEngagementsare collateral — the repo's changed-file guard fails the file otherwise.useViewSizemeasures the story iframe, which is often under 1020px once the addons panel is docked.Verification
pnpm --filter shared test— 297 suites / 2000 testspnpm --filter webapp test— 44 suites / 297 testsnode ./scripts/typecheck-strict-changed.js,pnpm --filter shared lint,pnpm --filter storybook build— all pass🤖 Generated with Claude Code
Preview domain
https://storybook-preview-upvote-share-h.preview.app.daily.dev