fix: move achievement notification to summary page to prevent transit…#3
fix: move achievement notification to summary page to prevent transit…#3ldsgroups225 merged 1 commit intomainfrom
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughA 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
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. Comment |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.