feat: add streak freeze enhancement with visual dashboard integration#2949
feat: add streak freeze enhancement with visual dashboard integration#2949sudeekshaballanda-hub wants to merge 3 commits into
Conversation
- Add freeze_tokens_remaining, last_freeze_date, freeze_history to profiles table - Create GET /api/streak/freeze/status endpoint - Create POST /api/streak/freeze/apply endpoint - Add FreezeStatusWidget component - Integrate widget into dashboard with Streak Protection section - Implement token refresh logic on first of month - Closes Priyanshu-byte-coder#2935
|
@sudeekshaballanda-hub is attempting to deploy a commit to the legitox's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
Hi — new features and visual UI additions are currently on hold while we focus on code quality (see discussion #2651). Please hold this PR until the quality sprint wraps up. PRs for tests, refactoring, bug fixes, and docs are welcome in the meantime. |
- Add tests for freeze widget display - Add tests for freeze button functionality - Add tests for freeze history display - Note: Test environment has pre-existing issues with next-auth
|
@Priyanshu-byte-coder @Legit-Ox I've updated this PR with:
Please let me know if there's anything else I can do to help. I'm also available to work on the test environment issues if that would be helpful for the quality sprint. Thanks for your time! 🙏 |
|
New UI/feature PRs are on hold during the code quality sprint — see discussion #2651. PRs for tests, refactoring, bug fixes, docs, and performance are welcome. |
|
New feature/UI PRs are on hold during the code-quality sprint — see discussion #2651. We'll revisit this after the sprint; meanwhile tests, refactors, and bug-fix PRs are very welcome. |
Summary
This PR implements a comprehensive streak freeze enhancement with visual dashboard integration, allowing users to manage and track their freeze tokens directly from the dashboard. It adds database fields, API endpoints, and a UI widget for complete streak freeze functionality.
Closes #2935
Type of Change
What Changed
freeze_tokens_remaining,last_freeze_date, andfreeze_historycolumns to theprofilestable with appropriate constraints and indexesGET /api/streak/freeze/status- Returns current freeze status, token count, eligibility, and historyPOST /api/streak/freeze/apply- Applies a freeze token to the current day with validationFreezeStatusWidgetcomponent that displays:How to Test
/dashboard)Expected result: The streak freeze is applied successfully, token count decrements, and the widget updates in real-time.
Screenshots / Recordings
Widget Before Freeze
![Before Freeze]

Widget After Freeze
![After Freeze]

Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
This feature was built as part of the GirlScript Summer of Code (GSSoC) program. The implementation includes:
Follow-up improvements planned:
🧪 Test Status
I've written E2E tests for the streak freeze feature (
e2e/freeze.spec.ts).Note on Test Environment:
The current test environment has a pre-existing issue with
next-authand ES modules. This affects all existing E2E tests (e2e/streak.spec.ts,e2e/dashboard.spec.ts, etc.) and is not specific to this PR.The freeze feature itself has been tested manually and works correctly. I'm happy to help resolve the test environment issue as part of the quality sprint.
📝 Documentation Opportunity
I noticed the test environment is currently broken. I can help:
next-authES module conflict