feat(streaks): streak freezes — buy with Cores, auto-apply on miss#6340
Open
rebelchris wants to merge 13 commits into
Open
feat(streaks): streak freezes — buy with Cores, auto-apply on miss#6340rebelchris wants to merge 13 commits into
rebelchris wants to merge 13 commits into
Conversation
Introduces the pinned backend contract for automated streak freezes: featuresManagement flag, userStreak.freezesAvailable, streakFreezeProducts, userStreakFreezeDates and purchaseStreakFreeze operations, plus new LogEvent/Origin/TargetType/RequestKey entries. Existing UserStreak fixtures are updated for the new required field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Exposes freezesAvailable, streak-freeze products, consumed freeze dates, and a purchase mutation. Mirrors useStreakRecover's insufficient-funds handling: an unaffordable pack redirects to the Cores page with an origin + next param instead of calling the mutation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New LazyModal.StreakFreezePurchase presents the seeded packs (1/3/5) with
CoreIcon pricing, a selected-pack state, and a cap hint ("Max 5 freezes")
once freezesAvailable + pack quantity would exceed the cap. The purchase
button flips to "Buy Cores" when the balance can't cover the selected pack.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…opover
Adds a freeze-inventory row to the reading streak popover (count, CTA
copy that changes when the balance is zero, tap opens the purchase
modal), gated behind the feature flag + cores access. Past days that
consumed a freeze now render with the existing Freeze visual via a new
Streak.UsedFreeze state with a distinct tooltip ("A streak freeze was
used this day"), sourced from userStreakFreezeDates. Weekend auto-freeze
behavior is unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
optOutStreakFreeze follows the optOutReadingStreak pattern exactly (default false = auto-apply on) with its own toggle in SettingsContext. The streaks settings page gains a "Streak freezes" section: current count, a buy button that opens the purchase modal, and the "Automatically use streak freezes" switch, gated behind the feature flag + cores access. Also fills in optOutAchievements/isGamificationEnabled fields that were already missing from a few full SettingsContextData/RemoteSettings test fixtures, surfaced by strict typecheck once optOutStreakFreeze was added to the same object literals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a subtle secondary link below the restore CTA ("Get streak
freezes so this doesn't happen again") that opens the purchase modal.
Gated behind the feature flag + cores access so it never competes with
the primary restore action for ineligible users.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Registers streak_freeze_used and streak_freeze_depleted in the NotificationType enum, groups them into STREAK_KEYS and the Updates filter category, and adds their settings copy to STREAK_NOTIFICATIONS. Icon/copy are backend-driven and reuse the existing Streak icon type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extract StreakFreezeUpsell into a shared component, add it to the milestone modal, and open the freeze purchase modal after a successful restore when the user has no freezes left. Also drop the icon from the popover freeze row and fix pre-existing strict-mode errors in useStreakRecover. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… types condition) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The transaction label assumed every product-linked transaction was an award; freeze purchases now show the product name instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Adds streak freezes: users can buy freeze packs with Cores (cap 5) and they auto-apply when a day is missed, protecting the streak.
streak_freezefeature flag + GraphQL contract (freezesAvailable, freeze dates, products, purchase mutation)StreakFreezePurchaseModal(Cores purchase, cap-aware)optOutStreakFreeze)streak_freeze_used,streak_freeze_depleteduseStreakRecoverDepends on
dailydotdev/daily-api
feat/auto-streak-freeze(schema + auto-apply cron + notifications)Test
pnpm --filter shared teststreak suites green (27 tests)🤖 Generated with Claude Code
Preview domain
https://feat-auto-streak-freeze.preview.app.daily.dev