mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 18:39:53 +08:00
Follow-up nits on the #573 profile/avatar work: - UserAvatar: validate an icon marker's icon/color against the known sets and fall back to the deterministic avatar for unknown values. The backend _ICON_MARKER_RE accepts any [a-z0-9-] color, so a hand-set marker like "icon⭐bogus" previously rendered an invisible avatar (AVATAR_COLORS[unknown] === undefined). - ProfileLink: pass role to UserAvatar so admins get the amber ring in the sidebar, matching the "amber ring at every size" intent. - useAuthStatus: share one in-flight /api/v1/auth/status request across the hook's consumers (sidebar Admin/Logout/Profile links) so a page load makes a single call instead of one per consumer; cleared once settled so a later mount (after login/logout) refetches. Verified: tsc, eslint, web node tests (142). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>