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 7ce5adbe..0ee9f339 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. @@ -744,7 +746,7 @@ function MessageInternal( space={messageSpacing} collapse={collapse} highlight={highlight} - notifyHighlight={notifyHighlight} + notifyHighlight={highlightMentions ? notifyHighlight : undefined} selected={!!menuAnchor || !!emojiBoardAnchor} {...props} {...hoverProps} @@ -1169,6 +1171,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()) { @@ -1245,7 +1248,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 0c9c651d..0a8e47fd 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -98,6 +98,7 @@ export interface Settings { saveStickerEmojiBandwidth: boolean; alwaysShowCallButton: boolean; faviconForMentionsOnly: boolean; + highlightMentions: boolean; // furry stuff renderAnimals: boolean; @@ -180,6 +181,7 @@ const defaultSettings: Settings = { saveStickerEmojiBandwidth: false, alwaysShowCallButton: false, faviconForMentionsOnly: false, + highlightMentions: true, // furry stuff renderAnimals: true,