Skip to content

Conversation

@ldsgroups225
Copy link
Owner

@ldsgroups225 ldsgroups225 commented Jan 13, 2026

This commit fixes a bug where the 'Achievement Unlocked' dialog would appear repeatedly on the progress page.

Changes:

  • Implements localStorage check to track seen achievements.
  • Filters newlyUnlocked achievements against the stored list.
  • Updates storage immediately upon identifying new achievements.
  • Prevents the dialog from showing for previously seen achievements.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the Achievement Unlocked dialog appearing repeatedly. The dialog now displays only once per new achievement and correctly persists across page refreshes and browser restarts.

✏️ Tip: You can customize this high-level summary in your review settings.

This commit fixes a bug where the 'Achievement Unlocked' dialog would
appear repeatedly on the progress page.

Changes:
- Implements `localStorage` check to track seen achievements.
- Filters `newlyUnlocked` achievements against the stored list.
- Updates storage immediately upon identifying new achievements.
- Prevents the dialog from showing for previously seen achievements.
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes implement a fix for a recurring achievement unlock dialog issue by adding per-user localStorage filtering to track seen achievements. The progress page now reads seen achievement IDs from localStorage, filters the API response to show only genuinely new achievements, and persists the display state. Two documentation files (PRD and task checklist) outline the requirements and implementation plan.

Changes

Cohort / File(s) Summary
Achievement Dialog Fix Implementation
apps/user-application/src/routes/_auth/app/progress.tsx
Implements localStorage-based filtering for newly unlocked achievements. Reads user-specific seen achievement IDs on component mount, filters data.newlyUnlocked against stored IDs, and updates localStorage after display. Includes fallback to show all achievements if storage access fails. Adds userId to useEffect dependencies. Minor rendering reformatting for weekly activity and achievement details without behavioral changes.
Fix Documentation
tasks/prd-achievement-unlocked-fix.md
tasks/tasks-achievement-unlocked-fix.md
PRD document specifying storage strategy, filtering logic, acceptance criteria, and open questions. Task checklist outlining implementation steps including feature branch creation, localStorage integration, and manual verification.

Sequence Diagram

sequenceDiagram
    participant Component as Progress Component
    participant Storage as localStorage
    participant API as API Data

    Component->>Component: Component mounts with userId
    Component->>API: Access data.newlyUnlocked
    Component->>Storage: Read seen_achievement_ids for user
    alt localStorage accessible
        Storage-->>Component: Return seen IDs array
    else storage unavailable
        Component->>Component: Use empty array (fallback)
    end
    Component->>Component: Filter newlyUnlocked against seen IDs
    Component->>Component: Display only truly new achievements
    Component->>Storage: Update seen_achievement_ids with displayed IDs
    Storage-->>Component: Write complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A dialog that wouldn't cease,
Now localStorage brings sweet peace!
User IDs tracked, achievements seen,
No more surprises on the screen.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd4fc14 and 3703261.

📒 Files selected for processing (3)
  • apps/user-application/src/routes/_auth/app/progress.tsx
  • tasks/prd-achievement-unlocked-fix.md
  • tasks/tasks-achievement-unlocked-fix.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ldsgroups225 ldsgroups225 merged commit fed78b8 into main Jan 13, 2026
0 of 3 checks passed
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