From 2119f825d6ea558885bcaf922ef11e55743010f9 Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Sat, 16 May 2026 22:38:59 +0200 Subject: [PATCH] mail UI: dedupe broadcast fan-out and drop in-game admin compose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two issues surfaced once the long-lived dev environment finally reached the diplomail view: 1. `/sent` returns one row per recipient for broadcast and admin fan-outs (so the admin tooling can render the materialised audience). The list pane fed all rows into the stand-alone bucket, so the `{#each entries as e (entryKey(e))}` key in `thread-list.svelte` collapsed to the same `standalone:${id}` for every recipient and Svelte 5 aborted the render with `each_key_duplicate`. Dedupe stand-alones by `message_id` in `buildEntries`. 2. The compose dialog exposed an `admin` kind toggle gated on "owner of game". That was a Phase 28 plan decision, but admin compose is an operator tool (server admin), not an in-game action — every game owner should not be able to broadcast admin notifications. Drop the admin option, the audience sub-toggles, and the admin path through `submit`. The `MailStore.composeAdmin` wrapper and the backend RPC stay so the future admin UI can call them. Vitest covers the fan-out dedup with three rows sharing one `message_id` collapsing to a single stand-alone entry. Co-Authored-By: Claude Opus 4.7 --- .../src/lib/active-view/mail/compose.svelte | 52 ++++--------------- ui/frontend/src/lib/mail-store.svelte.ts | 17 +++++- ui/frontend/tests/mail-store.test.ts | 27 ++++++++++ 3 files changed, 52 insertions(+), 44 deletions(-) diff --git a/ui/frontend/src/lib/active-view/mail/compose.svelte b/ui/frontend/src/lib/active-view/mail/compose.svelte index 3cdb3b5..a3bd876 100644 --- a/ui/frontend/src/lib/active-view/mail/compose.svelte +++ b/ui/frontend/src/lib/active-view/mail/compose.svelte @@ -1,8 +1,10 @@