84b34019e77d513a36d898545973c4594e4a4432
Task #49: When the sole admin leaves a group and a successor is auto- or manually-promoted, surface the change prominently in addition to the existing system messages. Changes: - artifacts/teaboy-os/src/pages/chat.tsx - New effect on conversations list: tracks the set of group conversations where the current user is currently an admin (from participant.isAdmin). On first load it silently records a baseline in localStorage (key teaboy:admin-known:<userId>); thereafter, any newly-admin group triggers a toast ("You are now the admin of <group>"). The set is pruned when the user is no longer admin so a future re-promotion toasts again. Using participant.isAdmin (rather than only lastMessage) ensures the cue fires even if newer messages have arrived in the conversation since the promotion. - Conversation list rows now render a small amber "New admin" / "You are now the admin" Crown badge whenever the most recent message is an admin_promoted system message. Variant differs for the promoted user vs other members. data-testid="badge-new-admin-<convId>" for tests. - Imported Crown from lucide-react. - artifacts/teaboy-os/src/locales/en.json + ar.json - Added bilingual strings under chat.actions: youAreAdminTitle, youAreAdminDescription, newAdminBadge, newAdminLabel. Implementation notes: - lastMessage.meta is already returned by GET /conversations and includes the promoted user (id, displayNameAr/En, username), so no API changes were needed. - Regenerated api-client-react via `pnpm --filter @workspace/api-spec run codegen` (pre-existing stale codegen was failing typecheck unrelated to this task, now clean for chat.tsx). - Did not add automated tests; the existing follow-up task "Make sure the leave-and-handoff flow stays working with automated tests" already covers it.
Description
No description provided
Languages
TypeScript
69.4%
JavaScript
29%
CSS
0.6%
Shell
0.6%
Dockerfile
0.2%
Other
0.2%