Skip to content

Conversation

@ldsgroups225
Copy link
Owner

@ldsgroups225 ldsgroups225 commented Jan 13, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Achievement unlock notifications now display on the lesson summary page instead of the session page, improving timing and placement.
    • Notifications appear with a brief delay for better visual experience.
    • Achievements are tracked to prevent duplicate notifications from appearing elsewhere in the app.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

A fix is implemented to move achievement notifications from the session page to the summary page with a delayed display. The session page now suppresses achievement triggers during summary navigation, while the summary page receives achievement data via query parameters, displays notifications after a brief delay, and tracks seen achievements in localStorage to prevent duplicates.

Changes

Cohort / File(s) Summary
Session Navigation Guard
apps/user-application/src/routes/_auth/app/lesson-session.$lessonId.tsx
Introduces isNavigatingToSummary state to suppress reward/XP events (level_up, achievement_unlocked) during summary navigation. Passes unlocked achievements to summary via query parameter payload.
Summary Achievement Display
apps/user-application/src/routes/_auth/app/lesson-summary.$lessonId.tsx
Extends SearchParams to accept achievements query field. Implements client-side logic to read achievements from params, compare against localStorage seen-list, filter new ones, and display AchievementUnlockToast after ~800ms delay. Updates localStorage when achievements are queued to prevent reappearance.
Documentation
tasks/prd-achievement-flash-fix.md, tasks/tasks-achievement-flash-fix.md
PRD and task checklist documenting the achievement flash fix feature: suppression on session page, delayed display on summary page, localStorage tracking, and verification steps.

Sequence Diagram

sequenceDiagram
    participant User
    participant SessionPage as Session Page
    participant Navigation as Navigation System
    participant SummaryPage as Summary Page
    participant LocalStorage

    User->>SessionPage: Complete lesson
    SessionPage->>SessionPage: Set isNavigatingToSummary = true
    Note over SessionPage: Reward triggers return early
    SessionPage->>SessionPage: Extract achievementsUnlocked
    SessionPage->>Navigation: navigateToSummary(achievements=[...])
    Navigation->>SummaryPage: Load with ?achievements=id1,id2
    SummaryPage->>SummaryPage: Read achievements from query params
    SummaryPage->>LocalStorage: Check seen-achievements
    SummaryPage->>SummaryPage: Filter newly unlocked
    Note over SummaryPage: Wait ~800ms
    SummaryPage->>SummaryPage: Display AchievementUnlockToast
    User->>SummaryPage: Dismiss toast
    SummaryPage->>LocalStorage: Mark as seen
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 ✨

Achievements hop now with perfect timing,
No flash upon session's chiming,
On summary they wait and gleam,
A delayed, delightful dream,
With localStorage's caring sight! 🌟

✨ 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 fed78b8 and e42bcdd.

📒 Files selected for processing (4)
  • apps/user-application/src/routes/_auth/app/lesson-session.$lessonId.tsx
  • apps/user-application/src/routes/_auth/app/lesson-summary.$lessonId.tsx
  • tasks/prd-achievement-flash-fix.md
  • tasks/tasks-achievement-flash-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 ad8fca9 into main Jan 13, 2026
0 of 3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 13, 2026
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