feat(ui): 3-tab UI per spec — admin dashboard + date filter, personal dashboard, training w/ difficulty, settings profile

Tab 1 Admin overview (/): aggregate stats + DATE FILTER (?from&to), hardest personas,
admin quick actions (Users / + Add product).
Tab 2 My dashboard (/my/board): per-user win/lose/session summary (works for admin too).
Tab 3 Training (/training): product list w/ status + persona count; admins see all groups
(draft->analyze/edit), trainees see ready->personas; persona list shows DIFFICULTY (1-5
stars); admins get a Manage-personas button.
Settings (/settings): profile (name/email) via new PATCH /api/auth/profile + change
password + language.
Backend: analytics date filter; profile endpoint; /api/me/board + /api/chat/sessions
opened to any authed user.
Rebuilt frontend/dist.
This commit is contained in:
Macky
2026-08-07 22:35:49 +07:00
parent ac35be8906
commit b05907ae62
40 changed files with 319 additions and 88 deletions

View File

@@ -137,6 +137,12 @@ class UserStore:
raise AuthError("a user with this email already exists")
return self.users.update(self._norm(username), email=email)
def set_name(self, username: str, name: str) -> dict[str, Any]:
name = (name or "").strip()
if not name:
raise AuthError("name is required")
return self.users.update(self._norm(username), name=name)
def complete_setup(self, username: str, email: str, new_password: str) -> dict[str, Any]:
"""First-time admin setup: set email + password, clear must_setup."""
if not new_password or len(new_password) < 4: