From 3043f77d857a6ad7b229445b2d1bcaff1427b662 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Tue, 17 Mar 2026 21:58:31 -0500 Subject: [PATCH] add toggle for mention highlighting --- .changeset/mention-highlight-toggle.md | 5 +++++ src/app/features/room/message/Message.tsx | 7 +++++-- .../settings/notifications/SystemNotification.tsx | 15 +++++++++++++++ src/app/state/settings.ts | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .changeset/mention-highlight-toggle.md diff --git a/.changeset/mention-highlight-toggle.md b/.changeset/mention-highlight-toggle.md new file mode 100644 index 00000000..d2c7ddd2 --- /dev/null +++ b/.changeset/mention-highlight-toggle.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Added a toggle to notifications to disable full message mention highlighting. diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 9dd200ed..20625d7e 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -381,6 +381,8 @@ function MessageInternal( const profile = useUserProfile(senderId, room); const { color: usernameColor, font: usernameFont } = useSableCosmetics(senderId, room); + const [highlightMentions] = useSetting(settingsAtom, 'highlightMentions'); + // Avatars // Prefer the room-scoped member avatar (m.room.member) over the global profile // avatar so per-room avatar overrides are respected in the timeline. @@ -725,7 +727,7 @@ function MessageInternal( space={messageSpacing} collapse={collapse} highlight={highlight} - notifyHighlight={notifyHighlight} + notifyHighlight={highlightMentions ? notifyHighlight : undefined} selected={!!menuAnchor || !!emojiBoardAnchor} {...props} {...hoverProps} @@ -1150,6 +1152,7 @@ export const Event = as<'div', EventProps>( const [menuAnchor, setMenuAnchor] = useState(); const [mobileOptionsOpen, setMobileOptionsOpen] = useState(false); + const [highlightMentions] = useSetting(settingsAtom, 'highlightMentions'); const handleContextMenu: MouseEventHandler = (evt) => { if (mobileOrTablet()) { @@ -1226,7 +1229,7 @@ export const Event = as<'div', EventProps>( space={messageSpacing} autoCollapse highlight={highlight} - notifyHighlight={notifyHighlight} + notifyHighlight={highlightMentions ? notifyHighlight : undefined} selected={!!menuAnchor} {...props} {...hoverProps} diff --git a/src/app/features/settings/notifications/SystemNotification.tsx b/src/app/features/settings/notifications/SystemNotification.tsx index 47266460..c9b59549 100644 --- a/src/app/features/settings/notifications/SystemNotification.tsx +++ b/src/app/features/settings/notifications/SystemNotification.tsx @@ -193,6 +193,7 @@ export function SystemNotification() { settingsAtom, 'faviconForMentionsOnly' ); + const [highlightMentions, setHighlightMentions] = useSetting(settingsAtom, 'highlightMentions'); // Describe what the current badge combo actually does so users aren't left guessing. const badgeBehaviourSummary = (): string => { @@ -400,6 +401,20 @@ export function SystemNotification() { after={} /> + + + } + /> + ); } diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index e9331c62..82d11153 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -97,6 +97,7 @@ export interface Settings { saveStickerEmojiBandwidth: boolean; alwaysShowCallButton: boolean; faviconForMentionsOnly: boolean; + highlightMentions: boolean; // furry stuff renderAnimals: boolean; @@ -178,6 +179,7 @@ const defaultSettings: Settings = { saveStickerEmojiBandwidth: false, alwaysShowCallButton: false, faviconForMentionsOnly: false, + highlightMentions: true, // furry stuff renderAnimals: true,