feat(client): sidebar previews for name_changed + icon_changed

This commit is contained in:
Jannis Braun
2026-05-10 19:43:31 +02:00
parent d508fecfb0
commit 91aa06b48b
2 changed files with 97 additions and 2 deletions
+13
View File
@@ -101,6 +101,9 @@ interface SystemEventPayload {
newOwnerId?: unknown;
newOwnerDisplayName?: unknown;
reason?: unknown;
// name_changed payload
oldName?: unknown;
newName?: unknown;
// space_invite payload
snapshot?: { spaceName?: unknown };
}
@@ -149,6 +152,16 @@ function formatSystemPreview(content: string | null, actor: User | null | undefi
const newOwner = asString(data.newOwnerDisplayName) ?? 'A member';
return `${newOwner} is now the group owner`;
}
case 'name_changed': {
// newName === null is a meaningful "cleared" state — distinct from a
// missing field — so we check for a non-empty string explicitly.
return asString(data.newName)
? `${actorName} renamed the group`
: `${actorName} cleared the group name`;
}
case 'icon_changed': {
return `${actorName} updated the group icon`;
}
default:
return 'System message';
}