more visual fixes

Signed-off-by: Shea <[email protected]>
This commit is contained in:
Shea committed 2026-07-28 07:48:29 +03:00
1 parent fc6d0552fc
commit 68de59f361
3 files changed
+58 -80

No files matched your search

+2 -27
View File
@@ -32,14 +32,7 @@ import { getReactionKey, getReactionShortcode, getRedactionTargetId } from '$uti
import { getMxIdLocalPart } from '$utils/matrix';
import { randomNumberBetween } from '$utils/common';
import { sanitizeCustomHtml } from '$utils/sanitize';
import {
getReactCustomHtmlParser,
scaleSystemEmoji,
LINKIFY_OPTS,
makeMentionCustomProps,
factoryRenderLinkifyWithMention,
renderMatrixMention,
} from '$plugins/react-custom-html-parser';
import { getReactCustomHtmlParser, scaleSystemEmoji } from '$plugins/react-custom-html-parser';
import { useRoomEvent } from '$hooks/useRoomEvent';
import { useSableCosmetics } from '$hooks/useSableCosmetics';
import { useMediaAuthentication } from '$hooks/useMediaAuthentication';
@@ -332,24 +325,6 @@ export const Reply = as<'div', ReplyProps>(
let image: ReactNode | undefined;
let mentioned = sender != null && (mentions?.user_ids?.includes(sender) ?? false);
const replyLinkifyOpts = useMemo(
() => ({
...LINKIFY_OPTS,
render: factoryRenderLinkifyWithMention(
settingsLinkBaseUrl,
(href) =>
renderMatrixMention(
mx,
room.roomId,
href,
makeMentionCustomProps(mentionClickHandler),
nicknames
),
mentionClickHandler
),
}),
[mx, room.roomId, mentionClickHandler, nicknames, settingsLinkBaseUrl]
);
if (eventType === M_POLL_START.name) {
const question = (
replyEvent?.getContent()[M_POLL_START.name] as {
@@ -364,7 +339,7 @@ export const Reply = as<'div', ReplyProps>(
if (shouldParseReplyFormattedPreview(sanitizedHtml)) {
const parserOpts = getReactCustomHtmlParser(mx, room.roomId, {
settingsLinkBaseUrl,
linkifyOpts: replyLinkifyOpts,
linkifyOpts: undefined,
useAuthentication,
nicknames,
handleMentionClick: mentionClickHandler,
@@ -152,7 +152,60 @@ function CatalogTweakCard({
>
<Box direction="Row" alignItems="Start" justifyContent="SpaceBetween" gap="200">
<Box direction="Column" gap="100" grow="Yes" style={{ minWidth: 0 }}>
<Text size="H6">{displayName}</Text>
<Box direction="Row" justifyContent="SpaceBetween" alignContent="Center">
<Text size="H6">{displayName}</Text>
<Box direction="Row" gap="100" alignItems="Center" shrink="No">
<CssViewerButton
title={`${displayName} — CSS`}
cssText={cssText}
ariaLabel="View tweak CSS"
/>
{copyUrl && (
<IconButton
size="300"
variant="Secondary"
fill="Soft"
outlined
radii="300"
aria-label={copied ? 'Copied tweak link' : 'Copy tweak link'}
onClick={() => {
handleCopy().catch(() => undefined);
}}
>
{menuIcon(copied ? Check : Link)}
</IconButton>
)}
{onExport && (
<IconButton
size="300"
variant="Secondary"
fill="Soft"
outlined
radii="300"
aria-label="Export tweak CSS"
onClick={() => {
onExport();
}}
>
{menuIcon(Download)}
</IconButton>
)}
<IconButton
size="300"
variant={isFavorited ? 'Primary' : 'Secondary'}
fill="Soft"
outlined
radii="300"
aria-label={isFavorited ? 'Remove tweak from saved' : 'Save tweak'}
onClick={() => {
Promise.resolve(onToggleFavorite()).catch(() => undefined);
}}
>
{menuIcon(Star, { weight: isFavorited ? 'fill' : 'regular' })}
</IconButton>
<Switch variant="Primary" value={isOn} onChange={onSetApplied} />
</Box>
</Box>
<Text size="T200" priority="300" style={{ wordBreak: 'break-word' }}>
{description}
</Text>
@@ -166,57 +219,6 @@ function CatalogTweakCard({
<Text size="B300">Third-party URL</Text>
</Chip>
)}
<Box direction="Row" gap="100" alignItems="Center">
<CssViewerButton
title={`${displayName} — CSS`}
cssText={cssText}
ariaLabel="View tweak CSS"
/>
{copyUrl && (
<IconButton
size="300"
variant="Secondary"
fill="Soft"
outlined
radii="300"
aria-label={copied ? 'Copied tweak link' : 'Copy tweak link'}
onClick={() => {
handleCopy().catch(() => undefined);
}}
>
{menuIcon(copied ? Check : Link)}
</IconButton>
)}
{onExport && (
<IconButton
size="300"
variant="Secondary"
fill="Soft"
outlined
radii="300"
aria-label="Export tweak CSS"
onClick={() => {
onExport();
}}
>
{menuIcon(Download)}
</IconButton>
)}
<IconButton
size="300"
variant={isFavorited ? 'Primary' : 'Secondary'}
fill="Soft"
outlined
radii="300"
aria-label={isFavorited ? 'Remove tweak from saved' : 'Save tweak'}
onClick={() => {
Promise.resolve(onToggleFavorite()).catch(() => undefined);
}}
>
{menuIcon(Star, { weight: isFavorited ? 'fill' : 'regular' })}
</IconButton>
<Switch variant="Primary" value={isOn} onChange={onSetApplied} />
</Box>
</Box>
</Box>
</Box>
+2 -1
View File
@@ -585,7 +585,7 @@ export const getReactCustomHtmlParser = (
roomId: string | undefined,
params: {
settingsLinkBaseUrl: string;
linkifyOpts: LinkifyOpts;
linkifyOpts?: LinkifyOpts;
highlightRegex?: RegExp;
handleSpoilerClick?: ReactEventHandler<HTMLElement>;
handleMentionClick?: ReactEventHandler<HTMLElement>;
@@ -828,6 +828,7 @@ export const getReactCustomHtmlParser = (
}
}
if (!params.linkifyOpts) return <span {...anchorProps}>{renderChildren()}</span>;
return <a {...anchorProps}>{renderedChildren}</a>;
}