diff --git a/.changeset/fix-color-parser.md b/.changeset/fix-color-parser.md new file mode 100644 index 000000000..0abdd8938 --- /dev/null +++ b/.changeset/fix-color-parser.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix opacity rendering in name colors. diff --git a/.changeset/fix-thread-replies.md b/.changeset/fix-thread-replies.md new file mode 100644 index 000000000..d10cf9d9f --- /dev/null +++ b/.changeset/fix-thread-replies.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix threads rendering fallback replies. diff --git a/src/app/features/room/ThreadDrawer.tsx b/src/app/features/room/ThreadDrawer.tsx index fd7075bfd..fb32d3bba 100644 --- a/src/app/features/room/ThreadDrawer.tsx +++ b/src/app/features/room/ThreadDrawer.tsx @@ -482,7 +482,12 @@ export function ThreadDrawer({ room, threadRootId, onClose, overlay }: ThreadDra const thread = room.getThread(threadRootId); const fromThread = thread?.events ?? []; if (fromThread.length > 0) { - return fromThread.filter((ev) => ev.getId() !== threadRootId && !reactionOrEditEvent(ev)); + return fromThread.filter( + (ev) => + ev.getId() !== threadRootId && + !reactionOrEditEvent(ev) && + ev.getContent()?.['m.relates_to']?.is_falling_back !== true + ); } return room .getUnfilteredTimelineSet() @@ -492,7 +497,8 @@ export function ThreadDrawer({ room, threadRootId, onClose, overlay }: ThreadDra (ev) => ev.threadRootId === threadRootId && ev.getId() !== threadRootId && - !reactionOrEditEvent(ev) + !reactionOrEditEvent(ev) && + ev.getContent()?.['m.relates_to']?.is_falling_back !== true ); })(); diff --git a/src/app/hooks/useUserProfile.ts b/src/app/hooks/useUserProfile.ts index 22ffa5b2a..8de5da050 100644 --- a/src/app/hooks/useUserProfile.ts +++ b/src/app/hooks/useUserProfile.ts @@ -69,7 +69,8 @@ const isValidHex = (c: any): string | undefined => { if (typeof c !== 'string') return undefined; // silly tuwunel smh const cleaned = c.replaceAll(/["']/g, '').trim(); - return /^#([0-9A-F]{3,6})$/i.test(cleaned) ? cleaned : undefined; + // Strictly allow only 3 or 6 digit hex codes, aka no opacity + return /^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(cleaned) ? cleaned : undefined; }; const sanitizeFont = (f: string) => f.replaceAll(/[;{}<>]/g, '').slice(0, 32);