From 24da60059ca9b94ed4a78251f7e63e34822ed0df Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 23 Sep 2026 00:45:10 -0700 Subject: [PATCH] admin chat posts say they go out as CivFix --- apps/admin/src/features/events/events-page.tsx | 1 + .../src/features/reports/official-author.test.ts | 12 ++++++++++++ apps/admin/src/features/reports/reports-page.tsx | 7 ++++++- apps/admin/src/styles/admin.css | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/admin/src/features/reports/official-author.test.ts diff --git a/apps/admin/src/features/events/events-page.tsx b/apps/admin/src/features/events/events-page.tsx index a3a9f21..09b6485 100644 --- a/apps/admin/src/features/events/events-page.tsx +++ b/apps/admin/src/features/events/events-page.tsx @@ -723,6 +723,7 @@ function EventDetail({ eventId, onCancelled }: { eventId: string; onCancelled: ( > Post update ⌘⏎ +
Updates are posted as CivFix, not from your own account.
diff --git a/apps/admin/src/features/reports/official-author.test.ts b/apps/admin/src/features/reports/official-author.test.ts new file mode 100644 index 0000000..f61835f --- /dev/null +++ b/apps/admin/src/features/reports/official-author.test.ts @@ -0,0 +1,12 @@ +import { readFileSync } from "node:fs" + +import { describe, expect, it } from "vitest" + +const source = readFileSync(new URL("./reports-page.tsx", import.meta.url), "utf8") + +describe("official author in the report chat", () => { + it("marks CivFix posts by the server's official flag, never by name or handle", () => { + expect(source).toMatch(/msg\.from\?\.official && !removed/) + expect(source).not.toMatch(/handle\s*===|name\s*===\s*"CivFix"/) + }) +}) diff --git a/apps/admin/src/features/reports/reports-page.tsx b/apps/admin/src/features/reports/reports-page.tsx index 97bd27f..d4b77a9 100644 --- a/apps/admin/src/features/reports/reports-page.tsx +++ b/apps/admin/src/features/reports/reports-page.tsx @@ -251,6 +251,11 @@ function ChatMessageRow({ {authorName} )} {handle && !removed && {handle}} + {msg.from?.official && !removed && ( + + Official + + )} {msg.forwardedToCity && ( Forwarded to city @@ -437,7 +442,7 @@ function ReportDiscussion({ className="rep-followup" rows={3} maxLength={MESSAGE_BODY_MAX} - placeholder="Message the neighbors in this report's chat…" + placeholder="Message the neighbors as CivFix…" value={draft} onChange={(e) => setDraft(e.target.value)} onKeyDown={(e) => { diff --git a/apps/admin/src/styles/admin.css b/apps/admin/src/styles/admin.css index 1fd910e..390f715 100644 --- a/apps/admin/src/styles/admin.css +++ b/apps/admin/src/styles/admin.css @@ -2508,6 +2508,7 @@ img.user-av { object-fit: cover; background: var(--paper-2); } .evt-msg-who { font-weight: 700; font-size: 12px; color: var(--sun-700); } .evt-msg-when { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); } .evt-msg-text { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink); line-height: 1.4; } +.evt-post-hint { font-size: 11px; color: var(--ink-3); margin-top: 6px; } /* -- Report discussion (public comment thread; distinct from the Activity timeline) -- */ .dsc-list { display: flex; flex-direction: column; gap: 10px; }