Skip to content

feat(share): flat share band after an upvote, for everyone - #6378

Merged
tsahimatsliah merged 5 commits into
claude/share-split-copy-buttonfrom
storybook-preview/upvote-share-hero-dropdown
Jul 28, 2026
Merged

feat(share): flat share band after an upvote, for everyone#6378
tsahimatsliah merged 5 commits into
claude/share-split-copy-buttonfrom
storybook-preview/upvote-share-hero-dropdown

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 27, 2026

Copy link
Copy Markdown
Member

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

Prop Values Default
promptVariant band / hero / card / control band
surface flat / card flat
  • band — one line, networks behind the chevron
  • hero — upvote badge, headline, description, dismiss, same split control
  • card — the block with all eight networks inline
  • control — today's widget, kept as a treatment so it stays comparable

flat spends 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, not post.userState.vote. Only useCardActions — 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. useRecordUpvoteInteraction now covers all four post-page bars.

Not folded into useVotePost, which would have covered everything 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.

PostFocusCard never rendered the prompt. That layout does not go through PostEngagements. Anything added there is invisible on the redesigned post page.

Reuse

ShareBand is extracted from EndOfConversationShare and used by both surfaces, so the two cannot drift. Callers keep only what differs: copy, link, and the surface classes.

Where to see it

  • App: open a post, upvote it.
  • Storybook: Components/Share/PostContentShare Playground — treatments, surfaces, themes, mobile at a real 390px, and placement on a mock post page.

Notable behaviour

Below 1020px ShareActions drops 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

  • The strict-type fixes in PostEngagements are collateral — the repo's changed-file guard fails the file otherwise.
  • Stories pin a 1280px viewport because useViewSize measures the story iframe, which is often under 1020px once the addons panel is docked.

Verification

  • pnpm --filter shared test — 297 suites / 2000 tests
  • pnpm --filter webapp test — 44 suites / 297 tests
  • node ./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

@vercel

vercel Bot commented Jul 27, 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 28, 2026 11:23am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jul 28, 2026 11:23am

Request Review

tsahimatsliah and others added 4 commits July 28, 2026 10:19
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
tsahimatsliah force-pushed the storybook-preview/upvote-share-hero-dropdown branch from 36009a2 to 42784c7 Compare July 28, 2026 07:28
@tsahimatsliah tsahimatsliah changed the title feat(share): post-upvote prompt — flat band, hero and card treatments feat(share): flat share band after an upvote, for everyone Jul 28, 2026
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>
@tsahimatsliah
tsahimatsliah marked this pull request as ready for review July 28, 2026 12:35
@tsahimatsliah
tsahimatsliah merged commit 6dff95a into claude/share-split-copy-button Jul 28, 2026
14 checks passed
@tsahimatsliah
tsahimatsliah deleted the storybook-preview/upvote-share-hero-dropdown branch July 28, 2026 12:35
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.

2 participants