Render galleries with non-visual attachments as a list (#5932)

* Render galleries with non-visual attachments as a list

Adds GalleryListView (with GalleryDivider) for galleries containing a file or audio item, extracting the shared FileTypeIconView from FileRoomTimelineView. GalleryRoomTimelineView picks the list vs the grid via usesListLayout. Tapping to open the preview lands in a follow-up.

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>

* pr suggestions

---------

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>
This commit is contained in:
Mauro
2026-07-27 18:46:15 +02:00
committed by GitHub
parent a8c79fdd46
commit 4d7d61dae7
13 changed files with 266 additions and 22 deletions
@@ -175,4 +175,22 @@ nonisolated extension GalleryItem {
return .video(id: .mock(index),
.init(filename: filename, videoInfo: .mockVideo(duration: duration), thumbnailInfo: thumbnailInfo, blurhash: blurhash, contentType: contentType))
}
static func mockFile(index: Int = 0,
filename: String = "document.pdf",
source: MediaSourceProxy? = nil,
thumbnailSource: MediaSourceProxy? = nil,
contentType: UTType? = .pdf) -> GalleryItem {
.file(id: .mock(index),
.init(filename: filename, source: source, fileSize: nil, thumbnailSource: thumbnailSource, contentType: contentType))
}
static func mockAudio(index: Int = 0,
filename: String = "audio.m4a",
source: MediaSourceProxy? = nil,
duration: TimeInterval = 65,
contentType: UTType? = .mpeg4Audio) -> GalleryItem {
.audio(id: .mock(index),
.init(filename: filename, duration: duration, waveform: nil, source: source, fileSize: nil, contentType: contentType))
}
}