fix: solve small pm chat ui issues

unwrap the pill
fix the fetching images in pm not auto download
This commit is contained in:
2026-05-25 17:17:32 +02:00
parent 1259645706
commit 161f57f52e
28 changed files with 697 additions and 82 deletions
@@ -0,0 +1,24 @@
import { getWatchedAttachmentRoomIdFromUrl, isDirectMessageAttachmentRoomId } from './attachment.logic';
describe('attachment logic', () => {
it('extracts watched server room ids from room URLs', () => {
expect(getWatchedAttachmentRoomIdFromUrl('/room/general')).toBe('general');
expect(getWatchedAttachmentRoomIdFromUrl('/room/general/chat')).toBe('general');
});
it('extracts watched direct-message storage ids from DM URLs', () => {
expect(getWatchedAttachmentRoomIdFromUrl('/dm/alice%3Abob')).toBe('direct-message:alice:bob');
expect(getWatchedAttachmentRoomIdFromUrl('/pm/dm-group-1?tab=chat')).toBe('direct-message:dm-group-1');
});
it('ignores non-message URLs', () => {
expect(getWatchedAttachmentRoomIdFromUrl('/settings')).toBeNull();
expect(getWatchedAttachmentRoomIdFromUrl('/dm')).toBeNull();
});
it('identifies direct-message attachment storage ids', () => {
expect(isDirectMessageAttachmentRoomId('direct-message:alice:bob')).toBe(true);
expect(isDirectMessageAttachmentRoomId('room-1')).toBe(false);
expect(isDirectMessageAttachmentRoomId(null)).toBe(false);
});
});