Skip to content

feat: add customizable category tags to Goal Tracker (#2647)#3194

Open
aaniya22 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
aaniya22:feature/goal-tracker-category-tags
Open

feat: add customizable category tags to Goal Tracker (#2647)#3194
aaniya22 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
aaniya22:feature/goal-tracker-category-tags

Conversation

@aaniya22

Copy link
Copy Markdown

Summary

Adds customizable category tags (Side Project, Work, DSA, Open Source) to the Goal Tracker widget so users can categorize goals and filter their view by a single tag, as requested in the issue.

Closes #2647


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/migrations/20260713010000_add_goal_category.sql — adds a nullable category column to goals (constrained to side-project, work, dsa, open-source) plus a supporting index; mirrored the same column/index in supabase/schema.sql for the canonical schema.
  • src/app/api/goals/route.ts — validates category on POST /api/goals (falls back to null for unrecognized values), persists it on insert, and includes it in the goal.created webhook payload.
  • src/lib/goal-tracker.ts — extended CreateGoalPayload with an optional category field and exported a GoalCategory type.
  • src/components/GoalTracker.tsx:
    • Added a "Category (Optional)" dropdown to the goal creation form.
    • Added a color-coded micro-badge next to the goal title on each card when a category is set.
    • Added a row of toggle filter pills (All + one per category) above the goal list, shown only when at least one goal has a category, to filter the view by a single tag.

How to Test

  1. Pull this branch and run the new migration (supabase/migrations/20260713010000_add_goal_category.sql) against your local/dev Supabase instance.
  2. Open the dashboard, expand the Goal Tracker widget, and create a new goal — select a category (e.g. "DSA") from the new dropdown.
  3. Confirm the goal renders with a color-coded "DSA" badge next to its title, and that a filter pill row appears above the list.
  4. Click the "DSA" pill and confirm only goals tagged DSA are shown; click it again (or click "All") to clear the filter.
  5. Create a goal with no category selected and confirm it renders without a badge and is hidden when a specific category filter is active.

Expected result: Goals can optionally be tagged with one of four categories at creation time, tags render as badges on the goal card, and the filter pills let a user isolate goals by a single tag.


Screenshots / Recordings

Before After
(flat, uncategorized goal list) (add screenshot showing category dropdown + badges + filter pills)

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

Accessibility (UI changes only)

  • Keyboard navigation works correctly (filter pills and select are native focusable elements)
  • Color contrast meets WCAG AA standard
  • ARIA labels / roles added where needed (role="group", aria-label, aria-pressed on filter pills)
  • Tested on mobile / responsive layout

Additional Context

Category is optional and additive — existing goals without a category continue to work unchanged, and the filter row only appears once at least one goal has a tag, so the UI stays uncluttered for users who don't use this feature. I haven't run npm run lint / type-check or added tests locally yet — please run those on your machine before merging, and let me know if you'd like me to add a unit test for the category validation logic in the API route.

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

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — 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

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add customizable category tags (e.g., Side Project, Work, DSA) to Goal Tracker metrics

1 participant