From dc5570f5f73b62f48f7aa335050675c49f3b9c76 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 1 Jun 2026 17:11:21 -0400 Subject: [PATCH] feat: add Report Room (MSC4151) and fix URL preview default for encrypted rooms - Report Room: new ReportRoomModal with reason + category, POST /rooms/{id}/report - URL preview: encUrlPreview default changed to true; security note added to settings Co-Authored-By: Claude Sonnet 4.6 --- README.md | 5 + src/app/features/room/ReportRoomModal.tsx | 186 ++++++++++++++++++ src/app/features/room/RoomViewHeader.tsx | 38 +++- src/app/features/settings/general/General.tsx | 1 + src/app/state/settings.ts | 2 +- 5 files changed, 228 insertions(+), 4 deletions(-) create mode 100644 src/app/features/room/ReportRoomModal.tsx diff --git a/README.md b/README.md index 51a35fa20..a9a3c3cc8 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,10 @@ A full custom theme engine layered on top of Cinny's vanilla-extract theming: - **Dark mode in element-call**: After joining, `CallEmbed.applyStyles()` injects `:root { color-scheme: dark|light }` into the iframe document so `@media (prefers-color-scheme)` rules inside element-call resolve to the correct Cinny theme regardless of the OS system preference. `themeKind` is stored on the `CallEmbed` instance and updated on every `setTheme()` call, so live theme switching also re-injects the CSS. Without this, users with OS light mode would see a white background even when Cinny is in dark mode. - **Call embed wallpaper**: The user's `chatBackground` pattern (Blueprint, Carbon, Stars…) is applied as the `backgroundImage`/`backgroundColor` of `div[data-call-embed-container]` when the call is in full view (not PiP). The iframe `html, body` is forced to `background: none !important` so the pattern shows through. When `chatBackground` is `none`, behaviour is unchanged. +### Moderation + +- **Report Room**: A "Report Room" option in the room header menu (⋮) allows users to report a room to homeserver admins with a reason and abuse category (Spam / Harassment / Inappropriate Content / Other). Calls `POST /_matrix/client/v3/rooms/{roomId}/report` (MSC4151, confirmed supported on matrix.lotusguild.org). Implemented in `ReportRoomModal.tsx` with loading/success/error states. + ### Messaging Enhancements - **GIF picker**: Giphy-powered GIF search and send. Button appears in the message composer only when `gifApiKey` is set in `config.json`. Sends GIF as `m.image` — fetches blob, uploads via `mx.uploadContent`, sends with `mx.sendMessage`. `FocusTrap` handles click-outside / Escape to close. When TDS is active: dark navy background (`#060c14`), orange dim border, `// GIF_SEARCH` header, CSS overrides for Giphy SDK search bar (dark bg, orange border/focus ring, JetBrains Mono), custom orange scrollbar. All TDS styles live in `lotus-terminal.css.ts` — no runtime `