Skip to content

Combined archive + optional refund flow#3501

Draft
Twixes wants to merge 3 commits into
mainfrom
posthog-code/cool-refund-button
Draft

Combined archive + optional refund flow#3501
Twixes wants to merge 3 commits into
mainfrom
posthog-code/cool-refund-button

Conversation

@Twixes

@Twixes Twixes commented Jul 16, 2026

Copy link
Copy Markdown
Member

Problem

Refunds are psychologically the opposite of every other action in the PR
review bar — they spend less money, not more — but a standalone Refund button
sitting next to Archive is confusing (the thread's original gripe: two buttons
that look like near-duplicates). The ask was to keep them from competing while
still making refunds feel good, not punitive.

Changes

Reworked into a single combined flowArchiveRefundDialog (UI component +
Storybook story):

  • One Archive button. Refund becomes an honest opt-in inside the archive
    modal ("Also refund…"), with a "What?"-style tooltip explaining the
    philosophy — so there's no second confusable top-bar button.
  • Tick the opt-in and a warm gold panel unfurls (with a subtle sheen sweep),
    the confirm button turns to gold and reads "Archive & refund $X".
  • Confirming celebrates: confetti fired from the button (reusing the
    existing confetti primitive) plus a "+amount" coins-fly-back flourish.
  • Refund stays deliberate (Alex's point), never dressed up as just a throwaway
    checkbox. Handles submitting/error states and respects
    prefers-reduced-motion throughout.

Still ships as a component + story with no live wiring, since there's no refund
backend in this repo yet — drop it into the review bar once the endpoint exists.
Explore it in Storybook under Components/Refund/ArchiveRefundDialog.

How did you test this?

Not run locally (no node_modules in this environment). Reviewed against
existing patterns (ArchiveRunningTaskDialog, the confetti primitive, quill
Button / Radix AlertDialog usage). Please eyeball the Storybook story before
merge.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog from a Slack thread

Introduce a self-contained, delightful Refund action as a UI component plus a
Storybook story.

A refund is psychologically the opposite of every other review-bar action — it
spends less money, not more — so it's styled apart from the primary CTAs
(warm gold, coin-return iconography) and made to feel good rather than
punitive. Hover shows a gold sheen sweep and a coin flip; confirm leans into
PostHog's "only pay for work that helped" philosophy, then celebrates with
confetti fired from the button and a "+amount" coin-return flourish. Respects
prefers-reduced-motion throughout.

Ships as a component + story (no live wiring) since there's no refund backend
in this repo yet; drop it into the review bar once the endpoint exists.

Generated-By: PostHog Code
Task-Id: 1d16eb2b-0862-4770-88c8-888603e42de0
@trunk-io

trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

React Doctor found 2 issues in 1 file · 2 warnings.

2 warnings

src/features/refund/ArchiveRefundDialog.tsx

Reviewed by React Doctor for commit b3b68b9.

@posthog

posthog Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

Replace the standalone RefundButton with ArchiveRefundDialog: one Archive
action with an honest "Also refund" opt-in, instead of two confusable top-bar
buttons.

Ticking the opt-in unfurls a warm gold panel with PostHog's "only pay for work
that helped" philosophy (and a "What?"-style tooltip on the checkbox), turns
the confirm button to gold, and — on confirm — celebrates with confetti fired
from the trigger plus a coins-fly-back flourish. Refund stays a deliberate
opt-in, never confused with the primary "use the product" CTAs. Respects
prefers-reduced-motion throughout.

Still a component + Storybook story, no live wiring, until a refund backend
exists in this repo.

Generated-By: PostHog Code
Task-Id: 1d16eb2b-0862-4770-88c8-888603e42de0
@Twixes Twixes changed the title Add a cool RefundButton for the review bar Combined archive + optional refund flow Jul 16, 2026
Associate the refund opt-in label with its checkbox via htmlFor/id
(noLabelWithoutControl) and sort the label's Tailwind classes
(useSortedClasses).

Generated-By: PostHog Code
Task-Id: 1d16eb2b-0862-4770-88c8-888603e42de0
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.

1 participant