From 920a9927401d16568c4efaa435e714bd976b5d96 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Fri, 20 Mar 2026 08:29:32 -0400 Subject: [PATCH] fix: abbr dotted underline + space settings label fixes - Add textDecoration: 'underline dotted' and cursor: 'help' to elements in AbbreviationTerm so users can see the hover indicator - RoomAbbreviations: add isSpace prop; when true, show 'Space Abbreviations' / 'space-level' labels and hide the inherited-from-space section - SpaceSettings: pass isSpace to RoomAbbreviations --- src/app/components/message/RenderBody.tsx | 6 +++++- .../room-settings/abbreviations/RoomAbbreviations.tsx | 11 ++++++----- src/app/features/space-settings/SpaceSettings.tsx | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/app/components/message/RenderBody.tsx b/src/app/components/message/RenderBody.tsx index bf86ffcb..679ea742 100644 --- a/src/app/components/message/RenderBody.tsx +++ b/src/app/components/message/RenderBody.tsx @@ -41,7 +41,11 @@ function AbbreviationTerm({ text, definition }: AbbreviationTermProps) { {(triggerRef) => ( // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions - } onClick={handleClick}> + } + onClick={handleClick} + style={{ textDecoration: 'underline dotted', cursor: 'help' }} + > {text} )} diff --git a/src/app/features/room-settings/abbreviations/RoomAbbreviations.tsx b/src/app/features/room-settings/abbreviations/RoomAbbreviations.tsx index 08761c43..cedaf74a 100644 --- a/src/app/features/room-settings/abbreviations/RoomAbbreviations.tsx +++ b/src/app/features/room-settings/abbreviations/RoomAbbreviations.tsx @@ -31,9 +31,10 @@ import { SequenceCardStyle } from '$features/common-settings/styles.css'; type AbbreviationsProps = { requestClose: () => void; + isSpace?: boolean; }; -export function RoomAbbreviations({ requestClose }: AbbreviationsProps) { +export function RoomAbbreviations({ requestClose, isSpace }: AbbreviationsProps) { const room = useRoom(); const mx = useMatrixClient(); const powerLevels = usePowerLevels(room); @@ -190,7 +191,7 @@ export function RoomAbbreviations({ requestClose }: AbbreviationsProps) { )} - {parentSpace && ( + {!isSpace && parentSpace && ( {spaceEntries.length > 0 @@ -240,8 +241,8 @@ export function RoomAbbreviations({ requestClose }: AbbreviationsProps) { {entries.length > 0 - ? `Room Abbreviations (${entries.length})` - : 'Room Abbreviations'} + ? `${isSpace ? 'Space' : 'Room'} Abbreviations (${entries.length})` + : `${isSpace ? 'Space' : 'Room'} Abbreviations`} {entries.length === 0 ? ( - No room-level abbreviations defined yet. + No {isSpace ? 'space' : 'room'}-level abbreviations defined yet. {canEdit && ' Use the form above to add some.'} diff --git a/src/app/features/space-settings/SpaceSettings.tsx b/src/app/features/space-settings/SpaceSettings.tsx index 87eb2a9c..586fba3f 100644 --- a/src/app/features/space-settings/SpaceSettings.tsx +++ b/src/app/features/space-settings/SpaceSettings.tsx @@ -194,7 +194,7 @@ export function SpaceSettings({ initialPage, requestClose }: SpaceSettingsProps) )} {activePage === SpaceSettingsPage.AbbreviationsPage && ( - + )} );