Skip to content

feat: profile career path redesign, achievement claims and shared reward celebrations - #273

Merged
AQIB-NAWAB merged 8 commits into
mainfrom
feat/profile-career-adventure
Dec 3, 2026
Merged

AQIB-NAWAB merged 8 commits into
mainfrom
feat/profile-career-adventure

Conversation

@FaisalMisbah23

@FaisalMisbah23 FaisalMisbah23 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Redesigns the learner profile around the six-tier career ladder, replaces silent achievement payouts with an explicit Claim flow, and unifies reward and milestone celebrations across the entire learning experience (level-ups, weekly resets, personal records, quests, exercises, quizzes, capstones, and mascot reactions) with consistent top-layer confetti, party popper bursts, audio cues, and modals.

Changes

Profile (/profile and public /u/[slug])

  • Redesigned profile with a hero header (circular CosmeticDot avatar, stats, and public/private share handling), responsive six-tier career map (vertical stepper on mobile, 6-column path on desktop without horizontal scroll), personal records, and featured achievements.
  • GET /api/v1/learner/my-profile returns career (CareerProgress) so the owner view explains the exact remaining courses and quiz score needed for the next tier, while public /u/[slug] profiles never expose the quiz average or empty "Not yet" record tiles.
  • Uses a single <main> landmark on /profile (owner view lives inside the workspace shell's <main>), formats League Climber progress with tier names (Bronze → Silver), and replaces the share action on private profiles with a link to /settings/profile.

Achievement claiming & dashboard discovery

  • Opening /profile no longer grants achievement credits silently (pendingAchievementClaims replaces grantAchievementRewards).
  • Added POST /api/v1/learner/achievements/:achievementId/claim to pay all reached, unpaid tiers once per tier via the credit ledger (achievement:<id>:<tier>), returning 400 when nothing is claimable and 404 for unknown achievements.
  • Added "Claim +N" buttons on achievements and a summary banner on the owner profile.
  • Added unclaimedAchievements (count, totalCredits, and tier-aware ids formatted as <id>:<tiers>) to MenteeDashboardViewModel and a highlighted UnclaimedAchievementsBanner on /dashboard that links to /profile#achievements-heading and plays celebrate("small") once per newly unlocked achievement/tier set.

Career tier promotion & Level-up celebrations

  • Added career_tier_up engagement event with separate dedupe keys for the course-completion mascot toast (career_tier_up:<tier>) and the /profile celebration modal (career_tier_up:profile:<tier>), so completing a course does not suppress the /profile celebration.
  • Added the "New career tier!" mascot rule linking to /profile.
  • Extended EngagementEngine with an onEvents(fresh, rewards, shownRuleId) listener and MascotReaction.level, subscribed via subscribeToEngagementEvents in MascotPlayer:
    • Queues a "large" RewardCelebrationDialog ("You reached Level N", firePartyPopper() + completion chime + /profile CTA) on any fresh level_up event once quizzes and active modals close, even if a higher-priority event won the mascot bubble.
    • Queues celebration toasts + celebration chime for weekly_goal_met (including earned Streak Freeze) and daily_goal_met events when swallowed by higher-priority reactions.

Shared celebrations, top-layer confetti & learning moments

  • Added frontend/src/lib/celebrate.ts and RewardCelebrationDialog (with backdrop-click dismissal) shared across achievement claims, cosmetic purchases, career promotions, level-ups, 5/5 weekly quests, Monday league results, and auto-issued certificates (CertificateCard.tsx updated cleanly with main's polling flow).
  • Upgraded celebrate("large") to trigger the 200-particle firePartyPopper() burst (packages/learning-ui), and updated fireMiniConfetti to render in a popover="manual" top-layer overlay (with z-index: 9999 fallback) so confetti always appears above open <dialog>.showModal() modals.
  • Added confetti & audio cues across previously silent learning moments:
    • Code exercises, Predict-output exercises, and AI interview passes (fireMiniConfetti alongside success sound).
    • Capstone checks (celebrate("medium") when a polled check newly passes; celebrate("small") on submitting to mentor).
    • Quiz chapters (firePartyPopper() on a 100% perfect passed quiz; fireMiniConfetti on a normal pass).
    • Celebratory Dot mascot reactions (including message-approved and enrolled), anchored to Dot's bubble with celebration chime when no voice clip or modal is already playing.
  • Upgraded claiming the final 5/5 weekly quest in WeeklyQuests to close the quests dialog and open a "large" RewardCelebrationDialog linking to /rewards.
  • Updated isSoundEnabled() in packages/learning-ui so reduced motion disables animations/confetti without muting audio.
  • Updated achievement sharing to use /u/<slug> and cleaned up remaining "Buildment" copy to "Edorax".

Leaderboard, Monday reset & personal bests

  • Added WeeklyLeagueCelebration (wired into both /dashboard and /leaderboard), waiting for active modals to close before presenting once per week:
    • Large RewardCelebrationDialog on Monday league promotion (PROMOTED, PROMOTED_TARGET, PROMOTED_BOTH) or last week's top-3 podium finish.
    • Medium RewardCelebrationDialog on Monday League Shield or Recovery save (SHIELD_HELD, RECOVERY_HELD).
    • Medium confetti + "New personal best!" toast once per board per week when you.score > you.bestScore > 0.
  • Scoped useLeaderboardConfetti to live top-3 podium placements (skipping if a modal dialog is open) so Monday promotion celebrations never overlap with double confetti or audio.

Verification

  • pnpm --dir server sync-shared:check — shared types/engine in sync.
  • Server unit tests (load-mentee-dashboard, dashboard-model, engagement/engine, rules, safety, mascots, events), pnpm --dir server typecheck, and pnpm --dir server lint — all passing.
  • Frontend unit tests (celebrate, weekly-league-celebration, leaderboard-format, profile-view), pnpm --dir frontend typecheck, and targeted ESLint — all passing.

@FaisalMisbah23
FaisalMisbah23 marked this pull request as ready for review December 3, 2026 11:37
The header showed course counts and the current course, which the career
map below already shows. It now shows rank tiles: the all-time XP rank
among learners on the leaderboards (Top N% on a board of 20 or more), this
week's league rank, the best league finish and top-three finishes.

Ranks come only from the global boards, which list only learners who
joined the leaderboards, so a profile never shows a rank its owner did not
choose to share. A learner with no rank keeps the old stats, and the owner
gets a link to join the leaderboard.
The header was a tall card with a large avatar and a 2 by 2 grid of big
tiles. Now the avatar is smaller, the share button sits beside the name,
and the ranks are one strip of four cells (two by two on a phone).
The share button moves to the page header next to Edit in settings, so the
card only shows the learner. Each rank now reads as a sentence, number
first: "Top 8% of all learners", "#2 in Silver league". The league cell
says how close promotion is ("2 spots from Gold"), a league win shows as
"1st league win", and a learner in the bottom half sees their place
("#30"), never a large percent.
@AQIB-NAWAB
AQIB-NAWAB merged commit d7aa41b into main Dec 3, 2026
8 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