fix: add server_name to moderation_actions for full context retention

Denormalize guild name alongside username so the moderation dashboard
shows both TARGET and server even after message table purges.
Migration 0018. Frontend displays 'username · server_name' in TARGET.
This commit is contained in:
asepharyana
2026-08-27 12:32:12 +07:00
parent cccfd89266
commit 0de393625f
10 changed files with 30 additions and 2 deletions
@@ -151,6 +151,14 @@ export function LiveModerationFeed({
<span className="text-ink-soft">
{a.username ?? a.user_id ?? "UNKNOWN_SUBJECT"}
</span>
{a.server_name && (
<>
<span>·</span>
<span className="text-ink-soft">
{a.server_name}
</span>
</>
)}
</div>
</div>
</div>
@@ -20,6 +20,7 @@ export interface ModerationAction {
created_at: number | null;
executed_at: number | null;
username: string | null;
server_name: string | null;
content: string | null;
// ── Explainability (structured verdict, surfaced read-only to public web) ──
flags: string[] | null;
@@ -80,6 +81,7 @@ export interface CategoryAction {
confidence: number | null;
score: number | null;
username: string | null;
server_name: string | null;
content: string | null;
}