fix: abbr dotted underline + space settings label fixes

- Add textDecoration: 'underline dotted' and cursor: 'help' to <abbr>
  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
This commit is contained in:
Evie Gauthier committed 2026-03-24 23:33:26 -04:00
1 parent f31d4edf95
commit 920a992740
3 files changed
+12 -7

No files matched your search

+5 -1
View File
@@ -41,7 +41,11 @@ function AbbreviationTerm({ text, definition }: AbbreviationTermProps) {
<TooltipProvider position="Top" tooltip={tooltipContent}>
{(triggerRef) => (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
<abbr ref={triggerRef as React.Ref<HTMLElement>} onClick={handleClick}>
<abbr
ref={triggerRef as React.Ref<HTMLElement>}
onClick={handleClick}
style={{ textDecoration: 'underline dotted', cursor: 'help' }}
>
{text}
</abbr>
)}
@@ -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) {
</Box>
)}
{parentSpace && (
{!isSpace && parentSpace && (
<Box direction="Column" gap="100">
<Text size="L400">
{spaceEntries.length > 0
@@ -240,8 +241,8 @@ export function RoomAbbreviations({ requestClose }: AbbreviationsProps) {
<Box direction="Column" gap="100">
<Text size="L400">
{entries.length > 0
? `Room Abbreviations (${entries.length})`
: 'Room Abbreviations'}
? `${isSpace ? 'Space' : 'Room'} Abbreviations (${entries.length})`
: `${isSpace ? 'Space' : 'Room'} Abbreviations`}
</Text>
{entries.length === 0 ? (
<SequenceCard
@@ -250,7 +251,7 @@ export function RoomAbbreviations({ requestClose }: AbbreviationsProps) {
direction="Column"
>
<Text size="T300" style={{ color: 'var(--mx-surface-variant-on)' }}>
No room-level abbreviations defined yet.
No {isSpace ? 'space' : 'room'}-level abbreviations defined yet.
{canEdit && ' Use the form above to add some.'}
</Text>
</SequenceCard>
@@ -194,7 +194,7 @@ export function SpaceSettings({ initialPage, requestClose }: SpaceSettingsProps)
<DeveloperTools requestClose={handlePageRequestClose} />
)}
{activePage === SpaceSettingsPage.AbbreviationsPage && (
<RoomAbbreviations requestClose={handlePageRequestClose} />
<RoomAbbreviations isSpace requestClose={handlePageRequestClose} />
)}
</PageRoot>
);