Skip to content

Replace map-view badge with daily goals + completion bonus - #752

Merged
gaidheal1 merged 2 commits into
developmentfrom
feat/daily-goals-badge
Aug 11, 2026
Merged

Replace map-view badge with daily goals + completion bonus#752
gaidheal1 merged 2 commits into
developmentfrom
feat/daily-goals-badge

Conversation

@gaidheal1

Copy link
Copy Markdown
Member

Closes #751.

Summary

Replaces the map view's points_today badge (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:

  1. Logged in today — binary, satisfied by having a session today.
  2. Completed 1 activity today — not scaled to require multiple activities.
  3. 3+ minutes of activity time recorded today — cumulative across activities, not a per-activity minimum.

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.pyget_daily_goals_state() (live goal computation, no stored counters) and check_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 as OfflineActivityLedger.
  • GameSettings.daily_goals_completion_bonus_ap (default 50) — admin-configurable bonus amount, alongside the existing task_completion_xp-style lump-sum grants.
  • Wired into both activity-completion paths — ActivityTimer.complete() and progression.services.log_offline_activity() — since goal 2 says "completed 1 activity," not "used the timer."
  • MeViewSet.daily_goals (api/views.py) replaces today_points, returning the full goal state (goals: null when the player has no active PlayerCharacterLink, same hide-the-badge-entirely convention as before).
  • Removed PlayerCharacterLink.player_time_today/points_today, now dead now that the endpoint no longer reads them (removed their tests too).

Frontend

  • DailyGoalsBadge replaces TodayPointsBadge — shows the three goals plus a bonus message once cleared.
  • useDailyGoals/fetchDailyGoals replace useTodayPoints/fetchTodayPoints; the todayPointsBadge feature flag is renamed dailyGoalsBadge.

Out of scope (per #751)

  • No changes to PlayerCharacterLink.link_points or its constituent terms.
  • No connection to XpModifier/live productivity modifiers.
  • No continuation/streak layer beyond the three daily goals.

Test plan

  • manage.py test — full suite (769 tests) green, including new progression/tests/test_daily_goals.py and updated timer/offline-logging tests.
  • manage.py makemigrations --check — no drift.
  • Frontend npm run test (540 tests), npm run lint, npx tsc --noEmit, npm run build:production all clean.

Generated by Claude Code

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
gaidheal1 marked this pull request as ready for review August 11, 2026 13:39

@gaidheal1 gaidheal1 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gaidheal1
gaidheal1 merged commit 4e29ccf into development Aug 11, 2026
2 checks passed
@gaidheal1
gaidheal1 deleted the feat/daily-goals-badge branch August 11, 2026 13:46
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