feat(room): per-room "Show link previews" toggle (#493)
CI / Build & Quality Checks (push) Skipped
CI / Secret scan (gitleaks) (push) Skipped
CI / Playwright smoke (e2e) (push) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 53s
CI / Build & Quality Checks (pull_request) Successful in 4m1s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Playwright smoke (e2e) (pull_request) Successful in 17m49s

Rooms that post nothing but links (e.g. World News RSS) fill the timeline
with preview cards, and the only fix was turning previews off everywhere.

Room settings → General → Display now has "Show link previews" for that
room only, for this user only. It is saved as the standard
org.matrix.room.preview_urls room account data ({ disable }), the same
event Element reads, so it syncs across devices and works in Element.
The room's choice wins over the global setting; "Use global setting"
saves {} to go back. Room timeline and threads both follow it.

Closes #493

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-25 12:43:05 -05:00
1 parent 4fe9b97eb2
commit f63ec2e373
8 files changed
+215 -6

No files matched your search

@@ -108,6 +108,7 @@ import {
import { useTheme } from '../../../hooks/useTheme';
import { useRoomCreatorsTag } from '../../../hooks/useRoomCreatorsTag';
import { usePowerLevelTags } from '../../../hooks/usePowerLevelTags';
import { useRoomUrlPreview } from '../../../hooks/useRoomUrlPreview';
import { roomToParentsAtom } from '../../../state/room/roomToParents';
import { EditHistoryModal } from '../message/EditHistoryModal';
import {
@@ -267,9 +268,8 @@ export function ThreadTimeline({ room, thread, editor }: ThreadTimelineProps) {
const [showDeveloperTools] = useSetting(settingsAtom, 'developerTools');
const [lotusTerminal] = useSetting(settingsAtom, 'lotusTerminal');
const [mediaAutoLoad] = useSetting(settingsAtom, 'mediaAutoLoad');
const [urlPreview] = useSetting(settingsAtom, 'urlPreview');
const [encUrlPreview] = useSetting(settingsAtom, 'encUrlPreview');
const showUrlPreview = room.hasEncryptionStateEvent() ? encUrlPreview : urlPreview;
// [Gitea #493] The room's own link-preview choice, else the global setting.
const showUrlPreview = useRoomUrlPreview(room);
const [hour24Clock] = useSetting(settingsAtom, 'hour24Clock');
const [hapticFeedback] = useSetting(settingsAtom, 'hapticFeedback');
const { navigateRoom } = useRoomNavigate();