feat(achievements): lead the completion popup with a snapshot - #6680
Open
tomeredlich wants to merge 2 commits into
Open
tomeredlich wants to merge 2 commits into
tomeredlich wants to merge 2 commits into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Added while wiring the completion popup's button, never passed by any caller. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
idoshamun
approved these changes
Sep 17, 2026
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.
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
AchievementSnapshotCardthat list already shares, so nothing new to maintain visually.Changes
AchievementCompletionModal.tsx— labelledProfileSnapshotButtonas the primary CTA;Choose next goalbecomesButtonVariant.Secondary.ProfileSnapshotButton.tsx— gainedshowLabelandclassNamepass-throughs. Every existing placement is a bare icon affordance on hover; this one is a full-width call to action.log.ts— newOrigin.AchievementCompletion, so this placement's shares are distinguishable from the profile card's within theShareProfileevent.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 goalstays primary rather than the popup showing a headless primary CTA. The!unlockedAchievementfallback branch is untouched for the same reason.Testing
AchievementCompletionModal.spec.tsx: asserts the press reaches the clipboard and logsresult: 'clipboard'against the new origin, and that the snapshot is left out when there is no date to credit.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-primarythenChoose next goal :: btn-secondary.The 16
tscerrors inpackages/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