Skip to content

feat(giveback): gift entry point with live activity + invite prompt#6281

Merged
idoshamun merged 7 commits into
mainfrom
claude/goofy-ishizaka-979a95
Jul 5, 2026
Merged

feat(giveback): gift entry point with live activity + invite prompt#6281
idoshamun merged 7 commits into
mainfrom
claude/goofy-ishizaka-979a95

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jul 2, 2026

Copy link
Copy Markdown
Member

Changes

Adds the giveback header + new-layout rail gift entry point — an acquisition hook whose job is to pull people into /giveback. Ported from design mock-up #6278 into a clean, review-ready state (QA/debug scaffolding dropped).

  • GivebackGiftButton — a calm gift icon at rest (header + rail variants, press feedback). No progress meter, no notification badge. Header variant matches NotificationsBell (Float, w-10, centered).
  • GivebackGiftDock — composition point with an imperative API (pulseActivity, showPrompt, reset) the entry drives; renders the +$ dollar jumps and celebration glow.
  • Polymarket-style dollar jumps — bare green +$ figures pop beside the gift as community money lands (social proof), offset per-pop to stay legible.
  • GivebackInvitePrompt — a wide, mascot-fronted invite card (daily.dev Giveback charm) with rotating community-framed messaging, confetti on celebratory moments, and an auto-dismiss countdown ring on the close button (driven by useTimedAnimation, pauses on hover).
  • GivebackConfettiBurst + new motion classes in base.css — all bounce:0 (no overshoot) and reduced-motion safe.
  • GivebackGiftEntry — container gated on the existing featureGiveback flag + logged-in + desktop; wired into HeaderButtons (between quests and notifications) and the SidebarDesktopV2 rail gift (which falls back to the Invite friends shortcut when the flag is off). Navigates to /giveback.
  • StorybookFeatures/Giveback/Entry points/*: resting gift-button states, header states, and an interactive live playground.

Note

The money pulses and invite-prompt cadence are currently driven by a local timer as a clearly-marked placeholder. Before this graduates past the experiment, replace them with live backend community-activity signals and drop the hardcoded figures in givebackInvitePrompts.

Experiment

No new flag — reuses the existing giveback feature flag that already gates the page. When off (production default), HeaderButtons is unchanged and the rail gift keeps its Invite friends behavior.

Events

Type event_name extra
New click giveback gift entry
New view giveback prompt { prompt }

Notes for reviewers

Ported from mock-up #6278. Relative to that branch, the review-only QA scaffolding was intentionally removed for merge: the GivebackDevPanel, the givebackQa window event bus, the ?giveback_debug force-show overrides, and the global MainLayout mount.

Manual Testing

  • node ./scripts/typecheck-strict-changed.js passes
  • HeaderButtons / MainLayoutHeader specs pass (entry renders null when flag off — no regression)
  • Full giveback feature suite passes (63 tests)

🤖 Generated with Claude Code

Preview domain

https://claude-goofy-ishizaka-979a95.preview.app.daily.dev

Adds the giveback header + new-layout rail gift entry point — an
acquisition hook that pulls people into /giveback. Gated entirely behind
the existing `featureGiveback` flag (off in production until turned on
per cohort), so main behavior is unchanged when the flag is off.

- GivebackGiftButton: calm resting gift (header/rail variants), press feedback
- GivebackGiftDock: composition point + imperative API (pulseActivity,
  showPrompt, reset), bare "+$" community dollar jumps, glow bloom
- GivebackInvitePrompt: mascot-fronted invite card with a hover-pausing
  auto-dismiss countdown ring (driven by useTimedAnimation)
- GivebackConfettiBurst + motion classes in base.css (bounce:0, reduced-motion safe)
- GivebackGiftEntry: flag- + desktop-gated container, wired into HeaderButtons
  and the SidebarDesktopV2 rail gift (falls back to Invite friends when off)
- Storybook: resting states, header states, and an interactive live playground

The money pulses + invite-prompt cadence are driven by a local timer as a
clearly-marked PLACEHOLDER — to be replaced by live backend community-activity
signals (and the hardcoded figures dropped) before the experiment graduates.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 2, 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 5, 2026 11:40am
storybook Building Building Preview Jul 5, 2026 11:40am

Request Review

Two fixes from self-review of the entry point:

- The sidebar rail gift navigates via its anchor href, so it never went
  through the dock's open handler and ClickGivebackGiftEntry was never
  logged for rail clicks (header logged, rail didn't). Route the rail
  anchor's capture-phase click through handleOpen so the event fires; the
  entry only calls router.push for the built-in header button to avoid
  double-navigating the rail anchor.
- GivebackConfettiBurst had a private copy of a prefers-reduced-motion
  check that read the media query once and never reacted to changes. Reuse
  the existing (now exported) usePrefersReducedMotion from useGivebackMotion,
  which subscribes to changes — dropping the duplicated helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the placeholder local-timer cadence on the gift entry point with
real remote signals:

- dollar pops now fire from the contributionActionCompleted real-time
  subscription (throttled + coalesced so a burst shows one +$total)
- the popover is a single global-milestone variation, fired only when a
  new milestone is crossed (polled from contributionLastReachedMilestone,
  celebrated once per browser)
- clicking the gift only navigates; it no longer triggers pops/popover
- live activity is gated to accounts older than 7 days

Also fixes review findings: clean owner handoff across header/rail entries,
gift-dock timer leak + concurrent-pop cap + unmount cleanup, a dead
mascot-bob animation class, a redundant featureGiveback evaluation on the
rail, and em-dash usage in comments.
…usive

The header and sidebar-v2 rail are mutually exclusive UIs, so only one
GivebackGiftEntry is ever mounted. The cross-instance owner election was
guarding against a co-existence that can't happen; render the live-activity
listener directly whenever it's allowed to run.
- rewrite the milestone popover with four honest-trade variations picked
  deterministically from the milestone threshold, so a given milestone reads
  consistently while different ones stay fresh
- fix the framing: the money is daily.dev's ad/growth budget redirected by
  developers doing marketing actions, not everyday usage; varied CTAs
- drop the money-pop throttle window from 1500ms to 500ms
@idoshamun idoshamun merged commit 77f7fc7 into main Jul 5, 2026
12 checks passed
@idoshamun idoshamun deleted the claude/goofy-ishizaka-979a95 branch July 5, 2026 11:56
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