fix colors and threads

This commit is contained in:
7w1 committed 2026-03-16 23:32:00 -05:00
1 parent 85994c8335
commit e81d24e0ea
4 files changed
+20 -3

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix opacity rendering in name colors.
+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix threads rendering fallback replies.
+8 -2
View File
@@ -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
);
})();
+2 -1
View File
@@ -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);