From 3a72b7c1c5b4f8ffbc67dce5b8c3f883172728fd Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 1 Jun 2026 17:21:11 -0400 Subject: [PATCH] feat: personal room name overrides (MSC4431-style) Users can right-click any room and 'Rename for me...' to set a local display name visible only to them. Stored in account data under io.lotus.room_names. Shows a pencil indicator on renamed rooms. useLocalRoomName() hook overrides useRoomName() when a local name exists. Also includes: - Rich room topic rendering via RoomTopicContent object (formatted_body support in RoomTopicViewer with HTML sanitization via sanitizeCustomHtml) - Edit history viewer: clicking '(edited)' on a message opens a modal showing all prior versions with timestamps (EditHistoryModal.tsx) Co-Authored-By: Claude Sonnet 4.6 --- README.md | 6 + src/app/components/RenderMessageContent.tsx | 6 + .../components/message/MsgTypeRenderers.tsx | 27 ++- .../message/content/FallbackContent.tsx | 27 ++- src/app/components/room-intro/RoomIntro.tsx | 2 +- .../room-topic-viewer/RoomTopicViewer.tsx | 74 ++++--- .../common-settings/general/RoomProfile.tsx | 4 +- src/app/features/lobby/LobbyHero.tsx | 2 +- src/app/features/room-nav/RoomNavItem.tsx | 183 ++++++++++++++++- src/app/features/room/RoomTimeline.tsx | 15 ++ src/app/features/room/RoomViewHeader.tsx | 2 +- .../room/message/EditHistoryModal.tsx | 186 ++++++++++++++++++ src/app/hooks/useRoomMeta.ts | 100 +++++++++- 13 files changed, 581 insertions(+), 53 deletions(-) create mode 100644 src/app/features/room/message/EditHistoryModal.tsx diff --git a/README.md b/README.md index 871cceb3f..1a720819f 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ A full custom theme engine layered on top of Cinny's vanilla-extract theming: ### Messaging Enhancements +- **Rich room topics**: Room topics that contain formatted text (bold, links, italic) are now rendered with full HTML formatting. Falls back to plain text if no `formatted_body` is present. Activates when any room admin sets a formatted topic. +- **Edit history viewer**: Clicking the "edited" label on any edited message opens a modal showing every prior version with timestamps. Fetches all `m.replace` relations for the event and displays them oldest-to-newest. Previously the "edited" label was visible but unclickable. - **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 `