Skip to content

feat(achievements): lead the completion popup with a snapshot - #6680

Open
tomeredlich wants to merge 2 commits into
mainfrom
feat/achievement-completion-snapshot
Open

tomeredlich wants to merge 2 commits into
mainfrom
feat/achievement-completion-snapshot

Conversation

@tomeredlich

@tomeredlich tomeredlich commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What

The Achievement Unlocked popup now offers the achievement as a shareable card, as its primary call to action. "Choose next goal" steps down to secondary.

Pressing Snapshot copies the PNG to the clipboard (falling back to a download only if the clipboard write is refused) — that behaviour already lives in SnapshotButton, so this placement inherits it.

Why

The unlock is when someone most wants to show the achievement off. Until now the only way to share one was the hover affordance on the profile's achievement list, which they have to go looking for after the moment has passed. The card rendered is the same AchievementSnapshotCard that list already shares, so nothing new to maintain visually.

Changes

  • AchievementCompletionModal.tsx — labelled ProfileSnapshotButton as the primary CTA; Choose next goal becomes ButtonVariant.Secondary.
  • ProfileSnapshotButton.tsx — gained showLabel and className pass-throughs. Every existing placement is a bare icon affordance on hover; this one is a full-width call to action.
  • log.ts — new Origin.AchievementCompletion, so this placement's shares are distinguishable from the profile card's within the ShareProfile event.

Notes for review

The snapshot is gated on user && unlockedAt, since the card credits a person and a completion date. In practice the popup only opens on a fresh unlock so the gate should never close, but if it does, Choose next goal stays primary rather than the popup showing a headless primary CTA. The !unlockedAchievement fallback branch is untouched for the same reason.

Testing

  • New AchievementCompletionModal.spec.tsx: asserts the press reaches the clipboard and logs result: 'clipboard' against the new origin, and that the snapshot is left out when there is no date to credit.
  • Shared achievement + snapshot suites (108 tests) and the full webapp suite (719 tests) pass. Strict typecheck clean on changed files.
  • Not verified in a live browser: the app shell will not boot locally in my environment (every client request returns ERR_BLOCKED_BY_CLIENT), and the modal is a boot popup behind a real unlock. Worth a look on the preview deploy. The rendered DOM confirms the order and variants — Snapshot :: btn-primary then Choose next goal :: btn-secondary.

The 16 tsc errors in packages/webapp/__tests__ are pre-existing; they reproduce identically on a clean tree.

🤖 Generated with Claude Code

Preview domain

https://feat-achievement-completion-snap.preview.app.daily.dev

The unlock moment is when someone most wants to show the achievement off,
but the only way to share one was the hover affordance on the profile's
achievement list, which they have to go looking for afterwards. The popup
now offers the same card as its primary call to action, so the share is
available while the moment is still on screen, and "Choose next goal"
steps down to secondary.

The card credits a person and a date, so it is gated on both. The popup
only opens on a fresh unlock, so the gate should never close, but a card
crediting neither is worse than no card.

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

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-webapp Ready Ready Preview Sep 17, 2026 1:36pm UTC

Request Review

Added while wiring the completion popup's button, never passed by any
caller.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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