Merge pull request #355 from SableClient/fix-mention-highlight-toggle

Add toggle for mention highlighting
This commit is contained in:
7w1 authored and GitHub committed 2026-03-17 22:03:26 -05:00
commit 476ec6ffe1
4 files changed
+27 -2

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Added a toggle to notifications to disable full message mention highlighting.
+5 -2
View File
@@ -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<RectCords>();
const [mobileOptionsOpen, setMobileOptionsOpen] = useState(false);
const [highlightMentions] = useSetting(settingsAtom, 'highlightMentions');
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (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}
@@ -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={<Switch variant="Primary" value={showPingCounts} onChange={setShowPingCounts} />}
/>
</SequenceCard>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Highlight Mentions"
description="Highlight the full background message when it contains a mention/keyword."
after={
<Switch variant="Primary" value={highlightMentions} onChange={setHighlightMentions} />
}
/>
</SequenceCard>
</Box>
);
}
+2
View File
@@ -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,