Skip to content

fix: reset weekly goal progress on new week boundary#2397

Open
aisshwaryaa8-collab wants to merge 3 commits into
Umbrella-io:mainfrom
aisshwaryaa8-collab:fix/goal-weekly-reset
Open

fix: reset weekly goal progress on new week boundary#2397
aisshwaryaa8-collab wants to merge 3 commits into
Umbrella-io:mainfrom
aisshwaryaa8-collab:fix/goal-weekly-reset

Conversation

@aisshwaryaa8-collab

@aisshwaryaa8-collab aisshwaryaa8-collab commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Weekly goals were not resetting their progress when a new week began.
This fix adds a week_start column to the goals table and updates the
API route to reset current to 0 when the stored week differs from the
current ISO week.

Closes #2390


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • supabase/schema.sql: added week_start DATE column to the goals table
  • src/app/api/goals/route.ts: added week_start to the update payload when a weekly reset occurs
  • src/components/GoalTracker.tsx: added week_start to the Goal interface and displays the active week range for weekly goals

How to Test

  1. Create a weekly goal (e.g. "20 commits this week")
  2. In Supabase SQL Editor, manually set week_start to a past date:
    UPDATE goals SET week_start = '2026-06-01', current = 5 WHERE id = '';
  3. Reload the dashboard and check the Goals widget

Expected result:

current resets to 0 and week_start updates to the
current week's Monday. The week range label (e.g. "Jun 9 – Jun 15")
appears below the goal title for weekly goals.

Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log, debug code, or commented-out blocks
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Added or updated tests where applicable
  • Updated documentation / comments if behavior changed

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) gssoc26 GSSoC 2026 contribution labels Jun 13, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@github-actions github-actions Bot added the type:testing GSSoC type bonus: tests (+10 pts) label Jun 13, 2026
@aisshwaryaa8-collab

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder Please approve and merge this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Goal progress not reset on new week — stale state persists across week boundaries

1 participant