Replace map-view badge with daily goals + completion bonus - #752
Merged
Conversation
Replaces the truncation-prone `points_today` badge with three easy daily goals (logged in, completed an activity, 3+ minutes recorded) plus a one-off AP bonus for clearing all three in a day. - progression.daily_goals: live goal-state computation and idempotent bonus award, gated by a new DailyGoalAward(player, date) row - Wired into both activity-completion paths (ActivityTimer.complete and offline logging), not just the timer flow - GameSettings.daily_goals_completion_bonus_ap controls the bonus amount - MeViewSet.daily_goals replaces today_points with the full goal state - Removed the now-dead PlayerCharacterLink.player_time_today/points_today - Frontend: DailyGoalsBadge replaces TodayPointsBadge Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hFSsXRtBgoJX7HTqdmTEb
gaidheal1
marked this pull request as ready for review
August 11, 2026 13:39
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.
Closes #751.
Summary
Replaces the map view's
points_todaybadge (which showed 0 for any activity under 10 minutes due to integer floor division) with three intentionally easy daily goals plus a one-off AP completion bonus:Clearing all three once in a day awards a lump-sum AP top-up via the existing AP system (
Player.add_activity) — no new currency.Backend
progression/daily_goals.py—get_daily_goals_state()(live goal computation, no stored counters) andcheck_and_award_daily_goals()(idempotent bonus award).DailyGoalAward(player, date)(progression/models.py) — unique-constrained record that makes the bonus award idempotent under concurrent activity completions, following the same shape asOfflineActivityLedger.GameSettings.daily_goals_completion_bonus_ap(default 50) — admin-configurable bonus amount, alongside the existingtask_completion_xp-style lump-sum grants.ActivityTimer.complete()andprogression.services.log_offline_activity()— since goal 2 says "completed 1 activity," not "used the timer."MeViewSet.daily_goals(api/views.py) replacestoday_points, returning the full goal state (goals: nullwhen the player has no activePlayerCharacterLink, same hide-the-badge-entirely convention as before).PlayerCharacterLink.player_time_today/points_today, now dead now that the endpoint no longer reads them (removed their tests too).Frontend
DailyGoalsBadgereplacesTodayPointsBadge— shows the three goals plus a bonus message once cleared.useDailyGoals/fetchDailyGoalsreplaceuseTodayPoints/fetchTodayPoints; thetodayPointsBadgefeature flag is renameddailyGoalsBadge.Out of scope (per #751)
PlayerCharacterLink.link_pointsor its constituent terms.XpModifier/live productivity modifiers.Test plan
manage.py test— full suite (769 tests) green, including newprogression/tests/test_daily_goals.pyand updated timer/offline-logging tests.manage.py makemigrations --check— no drift.npm run test(540 tests),npm run lint,npx tsc --noEmit,npm run build:productionall clean.Generated by Claude Code