diff --git a/PragatiVeer_v2_Production_QA_Report.pdf b/PragatiVeer_v2_Production_QA_Report.pdf new file mode 100644 index 0000000..d7d2ebf Binary files /dev/null and b/PragatiVeer_v2_Production_QA_Report.pdf differ diff --git a/backend/main.py b/backend/main.py index 8de6646..39c70c8 100644 --- a/backend/main.py +++ b/backend/main.py @@ -8,6 +8,7 @@ from uuid import UUID from datetime import datetime, timedelta, date from pydantic import BaseModel import os +import re from database import init_db, get_session import models @@ -838,14 +839,14 @@ def get_leaderboard( # Calculate real user's stats user_score = 0 user_accuracy = "0%" - user_streak = 1 + user_streak = 0 # BUG-04 fix: real zero for new users (no artificial min floor) if requesting_user: if str(requesting_user.id) in DEMO_USER_UUIDS: user_score = 9250 user_accuracy = "88.5%" user_streak = requesting_user.streak_count or 25 else: - user_streak = max(1, requesting_user.streak_count) + user_streak = requesting_user.streak_count or 0 # BUG-04 fix: 0 is valid user_attempts = session.exec( select(models.Attempt).where( models.Attempt.user_id == requesting_user.id, @@ -871,10 +872,11 @@ def get_leaderboard( "isCurrentUser": False, }) - # Add the requesting real user + # Add the requesting real user — strip role annotations from display name if requesting_user: + clean_name = re.sub(r'\s*\([^)]*\)\s*$', '', requesting_user.name).strip() entries.append({ - "name": requesting_user.name, + "name": clean_name, "score": user_score, "accuracy": user_accuracy, "streak": user_streak, diff --git a/src/app/dashboard/ai-coach/cbt-dpp/page.tsx b/src/app/dashboard/ai-coach/cbt-dpp/page.tsx index 032bdea..6d56dea 100644 --- a/src/app/dashboard/ai-coach/cbt-dpp/page.tsx +++ b/src/app/dashboard/ai-coach/cbt-dpp/page.tsx @@ -185,10 +185,12 @@ export default function AIDailyPracticePage() {
{user.name}
+{cleanDisplayName(user.name)}
{user.email || user.phone}
{/* Trial info in dropdown */} {trialInfo.isTrialActive && ( @@ -295,7 +299,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) { {userInitials}{user ? user.name.split(" ")[0] : "Loading..."}
+{user ? cleanDisplayName(user.name).split(" ")[0] : "Loading..."}
- {student.isCurrentUser ? (isAnonymous ? "Anonymous User" : `${student.name} (You)`) : student.name} + {student.isCurrentUser ? (isAnonymous ? "Anonymous User" : `${cleanDisplayName(student.name)} (You)`) : cleanDisplayName(student.name)}