From e0d5c63dc537d42b76afa5ec84b94b559bb8160a Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 3 Mar 2026 11:12:45 +0200 Subject: [PATCH 01/15] Fix invalid matrix.to event link generation (#2717) --- src/app/features/room/message/Message.tsx | 4 +--- src/app/plugins/matrix-to.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 9324e1c29..2d87e9bde 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -327,11 +327,9 @@ export const MessageCopyLinkItem = as< const mx = useMatrixClient(); const handleCopy = () => { - const roomIdOrAlias = getCanonicalAliasOrRoomId(mx, room.roomId); const eventId = mEvent.getId(); - const viaServers = isRoomAlias(roomIdOrAlias) ? undefined : getViaServers(room); if (!eventId) return; - copyToClipboard(getMatrixToRoomEvent(roomIdOrAlias, eventId, viaServers)); + copyToClipboard(getMatrixToRoomEvent(room.roomId, eventId, getViaServers(room))); onClose?.(); }; diff --git a/src/app/plugins/matrix-to.ts b/src/app/plugins/matrix-to.ts index feeafe05e..03a7d2c17 100644 --- a/src/app/plugins/matrix-to.ts +++ b/src/app/plugins/matrix-to.ts @@ -16,11 +16,11 @@ export const getMatrixToRoom = (roomIdOrAlias: string, viaServers?: string[]): s }; export const getMatrixToRoomEvent = ( - roomIdOrAlias: string, + roomId: string, eventId: string, viaServers?: string[] ): string => { - let fragment = `${roomIdOrAlias}/${eventId}`; + let fragment = `${roomId}/${eventId}`; if (Array.isArray(viaServers) && viaServers.length > 0) { fragment = withViaServers(fragment, viaServers); From de498a7b6ce4c11e33e16ce346e32ef5f23a7f5e Mon Sep 17 00:00:00 2001 From: "Rosy.iso" Date: Tue, 3 Mar 2026 12:07:54 +0100 Subject: [PATCH 02/15] make profile section consistent --- src/app/features/settings/account/Profile.tsx | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/app/features/settings/account/Profile.tsx b/src/app/features/settings/account/Profile.tsx index ce6b855a0..03118e32d 100644 --- a/src/app/features/settings/account/Profile.tsx +++ b/src/app/features/settings/account/Profile.tsx @@ -100,11 +100,7 @@ function ProfileAvatar({ profile, userId }: ProfileProps) { return ( - Avatar - - } + title="Avatar" after={ - Profile Banner - - } + title="Banner" > - Display Name - - } + title="Display Name" > + + + + From 790415403de5a92f381da6c13e6581967f2a619b Mon Sep 17 00:00:00 2001 From: "Rosy.iso" Date: Tue, 3 Mar 2026 12:57:14 +0100 Subject: [PATCH 03/15] wip reset push notifications tile --- src/app/features/settings/account/Profile.tsx | 8 +--- .../DeregisterPushNotifications.tsx | 44 +++++++++---------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/app/features/settings/account/Profile.tsx b/src/app/features/settings/account/Profile.tsx index 03118e32d..06caf8411 100644 --- a/src/app/features/settings/account/Profile.tsx +++ b/src/app/features/settings/account/Profile.tsx @@ -276,9 +276,7 @@ function ProfileBanner({ profile, userId }: ProfileProps) { const previewUrl = isRemoving ? undefined : imageFileURL || stagedUrl || bannerUrl; return ( - + + - - This will remove push notifications from all your sessions/devices. You will need to - re-enable them on each device individually. - - {deregisterState.status === AsyncStatus.Error && ( - -
- Failed to deregister devices. Please try again. -
- )} - {deregisterState.status === AsyncStatus.Success && ( - -
- Successfully deregistered all devices. -
- )} - + <> + This will remove push notifications from all your sessions/devices. +
+ You will need to re-enable them on each device individually. + } after={ - } - /> + > + {deregisterState.status === AsyncStatus.Error && ( + +
+ Failed to deregister devices. Please try again. +
+ )} + {deregisterState.status === AsyncStatus.Success && ( + +
+ Successfully deregistered all devices. +
+ )} +
); } From a2b87fa5884c27b6dd342d30f38b98dcc9d25fb4 Mon Sep 17 00:00:00 2001 From: "Rosy.iso" Date: Tue, 3 Mar 2026 13:08:33 +0100 Subject: [PATCH 04/15] leave FIXME note for someone else to tackle this PR is only about design consistency, so it shouldn't deal with fixing things that already don't work. --- .../settings/notifications/DeregisterPushNotifications.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/features/settings/notifications/DeregisterPushNotifications.tsx b/src/app/features/settings/notifications/DeregisterPushNotifications.tsx index fd56aa6c2..9e732897d 100644 --- a/src/app/features/settings/notifications/DeregisterPushNotifications.tsx +++ b/src/app/features/settings/notifications/DeregisterPushNotifications.tsx @@ -126,6 +126,7 @@ export function DeregisterAllPushersSetting() { } > + {/* FIXME: these two things below, even before my changes, don't really seem to ever appear? */} {deregisterState.status === AsyncStatus.Error && (
From ba34babff9c68fb03533b1b0b925b8b09cf67559 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Tue, 3 Mar 2026 10:03:25 -0500 Subject: [PATCH 05/15] Implement fix for grabbing history --- src/app/features/room/RoomTimeline.tsx | 49 ++++++++++++++------------ 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 2157caef3..7c6218768 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -359,31 +359,34 @@ const useTimelinePagination = ( } fetching = true; - const [err] = await to( - mx.paginateEventTimeline(timelineToPaginate, { - backwards, - limit, - }) - ); - if (err) { - // TODO: handle pagination error. - return; - } - const fetchedTimeline = - timelineToPaginate.getNeighbouringTimeline( - backwards ? Direction.Backward : Direction.Forward - ) ?? timelineToPaginate; - // Decrypt all event ahead of render cycle - const roomId = fetchedTimeline.getRoomId(); - const room = roomId ? mx.getRoom(roomId) : null; + try { + const [err] = await to( + mx.paginateEventTimeline(timelineToPaginate, { + backwards, + limit, + }) + ); + if (err) { + // TODO: handle pagination error. + return; + } + const fetchedTimeline = + timelineToPaginate.getNeighbouringTimeline( + backwards ? Direction.Backward : Direction.Forward + ) ?? timelineToPaginate; + // Decrypt all event ahead of render cycle + const roomId = fetchedTimeline.getRoomId(); + const room = roomId ? mx.getRoom(roomId) : null; - if (room?.hasEncryptionStateEvent()) { - await to(decryptAllTimelineEvent(mx, fetchedTimeline)); - } + if (room?.hasEncryptionStateEvent()) { + await to(decryptAllTimelineEvent(mx, fetchedTimeline)); + } - fetching = false; - if (alive()) { - recalibratePagination(lTimelines, timelinesEventsCount, backwards); + if (alive()) { + recalibratePagination(lTimelines, timelinesEventsCount, backwards); + } + } finally { + fetching = false; } }; }, [mx, alive, setTimeline, limit]); From 9d8f4d55e64bd3e85cbb957bc1403fc308404096 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Tue, 3 Mar 2026 10:03:40 -0500 Subject: [PATCH 06/15] Add documentation in-app for sliding sync --- src/app/features/settings/general/General.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/features/settings/general/General.tsx b/src/app/features/settings/general/General.tsx index 52343541f..e164170c1 100644 --- a/src/app/features/settings/general/General.tsx +++ b/src/app/features/settings/general/General.tsx @@ -812,11 +812,11 @@ function Sync() { style={{ opacity: serverSlidingEnabled ? 1 : 0.5 }} > Date: Tue, 3 Mar 2026 10:09:07 -0500 Subject: [PATCH 07/15] fix documentation links (why did I think markdown would work? --- src/app/features/settings/general/General.tsx | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/app/features/settings/general/General.tsx b/src/app/features/settings/general/General.tsx index e164170c1..8736bb3d4 100644 --- a/src/app/features/settings/general/General.tsx +++ b/src/app/features/settings/general/General.tsx @@ -814,9 +814,32 @@ function Sync() { + Enable Sliding Sync for this current login/session. Requires server support and + admin configuration. May cause issues, use with caution.{' '} + + More info + + . + + ) : ( + <> + Unavailable: the server has disabled Sliding Sync in its config.{' '} + + More info + + . + + ) } after={ Date: Tue, 3 Mar 2026 10:22:32 -0500 Subject: [PATCH 08/15] fix loading chat history on jump (search) --- src/app/features/room/RoomTimeline.tsx | 35 ++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 7c6218768..05ea50ffd 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -259,6 +259,7 @@ type RoomTimelineProps = { }; const PAGINATION_LIMIT = 60; +const EVENT_TIMELINE_LOAD_TIMEOUT_MS = 12000; type Timeline = { linkedTimelines: EventTimeline[]; @@ -273,12 +274,38 @@ const useEventTimelineLoader = ( ) => useCallback( async (eventId: string) => { + const withTimeout = async (promise: Promise, timeoutMs: number): Promise => + new Promise((resolve, reject) => { + const timeoutId = window.setTimeout(() => { + reject(new Error('Timed out loading event timeline')); + }, timeoutMs); + + promise + .then((value) => { + window.clearTimeout(timeoutId); + resolve(value); + }) + .catch((error) => { + window.clearTimeout(timeoutId); + reject(error); + }); + }); + if (!room.getUnfilteredTimelineSet().getTimelineForEvent(eventId)) { - await mx.roomInitialSync(room.roomId, PAGINATION_LIMIT); - await mx.getLatestTimeline(room.getUnfilteredTimelineSet()); + await withTimeout( + mx.roomInitialSync(room.roomId, PAGINATION_LIMIT), + EVENT_TIMELINE_LOAD_TIMEOUT_MS + ); + await withTimeout( + mx.getLatestTimeline(room.getUnfilteredTimelineSet()), + EVENT_TIMELINE_LOAD_TIMEOUT_MS + ); } const [err, replyEvtTimeline] = await to( - mx.getEventTimeline(room.getUnfilteredTimelineSet(), eventId) + withTimeout( + mx.getEventTimeline(room.getUnfilteredTimelineSet(), eventId), + EVENT_TIMELINE_LOAD_TIMEOUT_MS + ) ); if (!replyEvtTimeline) { onError(err ?? null); @@ -721,7 +748,6 @@ export function RoomTimeline({ highlight, }); } else { - setTimeline(getEmptyTimeline()); loadEventTimeline(evtId); } }, @@ -1003,7 +1029,6 @@ export function RoomTimeline({ const handleJumpToUnread = () => { if (unreadInfo?.readUptoEventId) { - setTimeline(getEmptyTimeline()); loadEventTimeline(unreadInfo.readUptoEventId); } }; From 775a17e5d030a1441bc8c5344d6801ec03d3d23e Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Tue, 3 Mar 2026 10:36:38 -0500 Subject: [PATCH 09/15] Add toggle-able message previews to notifictions --- .../notifications/SystemNotification.tsx | 38 +++++++++++++++++ .../pages/client/BackgroundNotifications.tsx | 30 +++++++++++-- src/app/pages/client/ClientNonUIFeatures.tsx | 36 ++++++++++++++-- src/app/state/settings.ts | 4 ++ src/app/utils/notificationStyle.ts | 42 ++++++++++++++++++- src/sw.ts | 14 +++++++ src/sw/pushNotification.ts | 19 ++++++++- 7 files changed, 172 insertions(+), 11 deletions(-) diff --git a/src/app/features/settings/notifications/SystemNotification.tsx b/src/app/features/settings/notifications/SystemNotification.tsx index 67b40c2a1..04e31db79 100644 --- a/src/app/features/settings/notifications/SystemNotification.tsx +++ b/src/app/features/settings/notifications/SystemNotification.tsx @@ -169,6 +169,14 @@ export function SystemNotification() { settingsAtom, 'isNotificationSounds' ); + const [showMessageContent, setShowMessageContent] = useSetting( + settingsAtom, + 'showMessageContentInNotifications' + ); + const [showEncryptedMessageContent, setShowEncryptedMessageContent] = useSetting( + settingsAtom, + 'showMessageContentInEncryptedNotifications' + ); return ( @@ -193,6 +201,36 @@ export function SystemNotification() { after={} /> + + } + /> + + + + } + /> + { const payload = buildRoomMessageNotification({ roomName, roomAvatar, username, - previewText: 'new message', + previewText, silent: true, eventId, }); @@ -267,6 +278,7 @@ function MessageNotifications() { } if (showNotifications && notificationPermission('granted')) { + const isEncryptedRoom = !!getStateEvent(room, StateEvent.RoomEncryption); const avatarMxc = room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl(); notify({ @@ -280,6 +292,13 @@ function MessageNotifications() { sender, roomId: room.roomId, eventId, + previewText: resolveNotificationPreviewText({ + content: mEvent.getContent(), + eventType: mEvent.getType(), + isEncryptedRoom, + showMessageContent, + showEncryptedMessageContent, + }), }); } @@ -296,6 +315,8 @@ function MessageNotifications() { notificationSound, notificationSelected, showNotifications, + showMessageContent, + showEncryptedMessageContent, usePushNotifications, forcePushOnMobile, playSound, @@ -386,6 +407,11 @@ function HandleNotificationClick() { function SyncNotificationSettingsWithServiceWorker() { const [notificationSound] = useSetting(settingsAtom, 'isNotificationSounds'); const [usePushNotifications] = useSetting(settingsAtom, 'usePushNotifications'); + const [showMessageContent] = useSetting(settingsAtom, 'showMessageContentInNotifications'); + const [showEncryptedMessageContent] = useSetting( + settingsAtom, + 'showMessageContentInEncryptedNotifications' + ); useEffect(() => { if (!('serviceWorker' in navigator)) return; @@ -394,13 +420,15 @@ function SyncNotificationSettingsWithServiceWorker() { type: 'setNotificationSettings' as const, notificationSoundEnabled: notificationSound, preferPushOnMobile, + showMessageContent, + showEncryptedMessageContent, }; navigator.serviceWorker.controller?.postMessage(payload); navigator.serviceWorker.ready.then((registration) => { registration.active?.postMessage(payload); }); - }, [notificationSound, usePushNotifications]); + }, [notificationSound, usePushNotifications, showMessageContent, showEncryptedMessageContent]); return null; } diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index fe104bc5b..a68f8dfc5 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -46,6 +46,8 @@ export interface Settings { usePushNotifications: boolean; useInAppNotifications: boolean; isNotificationSounds: boolean; + showMessageContentInNotifications: boolean; + showMessageContentInEncryptedNotifications: boolean; hour24Clock: boolean; dateFormatString: string; @@ -97,6 +99,8 @@ const defaultSettings: Settings = { usePushNotifications: false, useInAppNotifications: true, isNotificationSounds: true, + showMessageContentInNotifications: false, + showMessageContentInEncryptedNotifications: false, hour24Clock: false, dateFormatString: 'D MMM YYYY', diff --git a/src/app/utils/notificationStyle.ts b/src/app/utils/notificationStyle.ts index a3e5a1938..0bfd85ad4 100644 --- a/src/app/utils/notificationStyle.ts +++ b/src/app/utils/notificationStyle.ts @@ -1,5 +1,7 @@ export const DEFAULT_NOTIFICATION_ICON = '/public/res/apple/apple-touch-icon-180x180.png'; export const DEFAULT_NOTIFICATION_BADGE = '/public/res/apple/apple-touch-icon-72x72.png'; +export const DEFAULT_MESSAGE_PREVIEW = 'new message'; +export const ENCRYPTED_MESSAGE_PREVIEW = 'Encrypted message'; type RoomMessageNotificationInput = { roomName?: string; @@ -16,12 +18,50 @@ type NotificationPayload = { options: NotificationOptions; }; +type NotificationPreviewInput = { + content?: unknown; + eventType?: string; + isEncryptedRoom?: boolean; + showMessageContent: boolean; + showEncryptedMessageContent: boolean; +}; + const getString = (value: unknown, fallback: string): string => { if (typeof value !== 'string') return fallback; const normalized = value.trim(); return normalized.length > 0 ? normalized : fallback; }; +const getBodyFromContent = (content: unknown): string | undefined => { + if (!content || typeof content !== 'object') return undefined; + const { body } = content as Record; + if (typeof body !== 'string') return undefined; + const normalized = body.trim(); + return normalized.length > 0 ? normalized : undefined; +}; + +export const resolveNotificationPreviewText = ({ + content, + eventType, + isEncryptedRoom, + showMessageContent, + showEncryptedMessageContent, +}: NotificationPreviewInput): string => { + const encryptedContext = isEncryptedRoom || eventType === 'm.room.encrypted'; + + if (!showMessageContent) { + return encryptedContext ? ENCRYPTED_MESSAGE_PREVIEW : DEFAULT_MESSAGE_PREVIEW; + } + if (encryptedContext && !showEncryptedMessageContent) { + return ENCRYPTED_MESSAGE_PREVIEW; + } + + const body = getBodyFromContent(content); + if (body) return body; + + return encryptedContext ? ENCRYPTED_MESSAGE_PREVIEW : DEFAULT_MESSAGE_PREVIEW; +}; + export const buildRoomMessageNotification = ({ roomName, username, @@ -33,7 +73,7 @@ export const buildRoomMessageNotification = ({ }: RoomMessageNotificationInput): NotificationPayload => { const sender = getString(username, 'Someone'); const room = getString(roomName, 'Unknown'); - const message = getString(previewText, 'new message'); + const message = getString(previewText, DEFAULT_MESSAGE_PREVIEW); const avatar = getString(roomAvatar, DEFAULT_NOTIFICATION_ICON); return { diff --git a/src/sw.ts b/src/sw.ts index 5fd27a359..51c5124ad 100644 --- a/src/sw.ts +++ b/src/sw.ts @@ -9,8 +9,12 @@ declare const self: ServiceWorkerGlobalScope; let notificationSoundEnabled = true; let preferPushOnMobile = false; +let showMessageContent = false; +let showEncryptedMessageContent = false; const { handlePushNotificationPushData } = createPushNotifications(self, () => ({ notificationSoundEnabled, + showMessageContent, + showEncryptedMessageContent, })); type SessionInfo = { @@ -124,6 +128,16 @@ self.addEventListener('message', (event: ExtendableMessageEvent) => { if (typeof (data as { preferPushOnMobile?: unknown }).preferPushOnMobile === 'boolean') { preferPushOnMobile = (data as { preferPushOnMobile: boolean }).preferPushOnMobile; } + if (typeof (data as { showMessageContent?: unknown }).showMessageContent === 'boolean') { + showMessageContent = (data as { showMessageContent: boolean }).showMessageContent; + } + if ( + typeof (data as { showEncryptedMessageContent?: unknown }).showEncryptedMessageContent === + 'boolean' + ) { + showEncryptedMessageContent = (data as { showEncryptedMessageContent: boolean }) + .showEncryptedMessageContent; + } } }); diff --git a/src/sw/pushNotification.ts b/src/sw/pushNotification.ts index 19f95226a..1459df547 100644 --- a/src/sw/pushNotification.ts +++ b/src/sw/pushNotification.ts @@ -3,10 +3,13 @@ import { buildRoomMessageNotification, DEFAULT_NOTIFICATION_ICON, DEFAULT_NOTIFICATION_BADGE, + resolveNotificationPreviewText, } from '../app/utils/notificationStyle'; type NotificationSettings = { notificationSoundEnabled: boolean; + showMessageContent: boolean; + showEncryptedMessageContent: boolean; }; export const createPushNotifications = ( @@ -49,7 +52,13 @@ export const createPushNotifications = ( roomName: pushData?.room_name, username: pushData?.sender_display_name, roomAvatar: pushData?.room_avatar_url, - previewText: 'new message', + previewText: resolveNotificationPreviewText({ + content: pushData?.content, + eventType: pushData?.type, + isEncryptedRoom: false, + showMessageContent: getNotificationSettings().showMessageContent, + showEncryptedMessageContent: getNotificationSettings().showEncryptedMessageContent, + }), silent: resolveSilent(pushData?.silent), eventId: pushData?.event_id, data, @@ -77,7 +86,13 @@ export const createPushNotifications = ( roomName: pushData?.room_name, username: pushData?.sender_display_name, roomAvatar: pushData?.room_avatar_url, - previewText: 'Encrypted message', + previewText: resolveNotificationPreviewText({ + content: pushData?.content, + eventType: pushData?.type, + isEncryptedRoom: true, + showMessageContent: getNotificationSettings().showMessageContent, + showEncryptedMessageContent: getNotificationSettings().showEncryptedMessageContent, + }), silent: resolveSilent(pushData?.silent), eventId: pushData?.event_id, data, From 09159bba3839715f7d77ec5a6fef3ae9d1ae31b5 Mon Sep 17 00:00:00 2001 From: "Rosy.iso" Date: Tue, 3 Mar 2026 16:39:03 +0100 Subject: [PATCH 10/15] outline the sliding sync's expand/collapse button --- src/app/features/settings/developer-tools/SyncDiagnostics.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/features/settings/developer-tools/SyncDiagnostics.tsx b/src/app/features/settings/developer-tools/SyncDiagnostics.tsx index 402e625f3..e6a31dd79 100644 --- a/src/app/features/settings/developer-tools/SyncDiagnostics.tsx +++ b/src/app/features/settings/developer-tools/SyncDiagnostics.tsx @@ -171,6 +171,7 @@ export function SyncDiagnostics() { size="300" variant="Secondary" fill="Soft" + outlined radii="300" before={} onClick={() => setExpandSliding((v) => !v)} From fcda7b6db899fdfec8bf6e37ab676f634e1c9135 Mon Sep 17 00:00:00 2001 From: "Rosy.iso" Date: Tue, 3 Mar 2026 16:54:43 +0100 Subject: [PATCH 11/15] fix Sync section title not becoming faded when disabled --- src/app/features/settings/general/General.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/features/settings/general/General.tsx b/src/app/features/settings/general/General.tsx index 52343541f..cfa6af327 100644 --- a/src/app/features/settings/general/General.tsx +++ b/src/app/features/settings/general/General.tsx @@ -804,7 +804,9 @@ function Sync() { return ( - Sync + + Sync + Date: Tue, 3 Mar 2026 17:02:46 +0100 Subject: [PATCH 12/15] make Support button open the pull requests page --- src/app/features/settings/about/About.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/features/settings/about/About.tsx b/src/app/features/settings/about/About.tsx index 1e83a947f..15c4b65a5 100644 --- a/src/app/features/settings/about/About.tsx +++ b/src/app/features/settings/about/About.tsx @@ -67,7 +67,7 @@ export function About({ requestClose }: AboutProps) {