Add the gallery timeline item rendered as a placeholder

Introduces the GalleryRoomTimelineItem and its typed GalleryItem model (reusing the existing per-message content types), builds it in the RoomTimelineItemFactory and routes it through RoomTimelineItemView. For now it renders as a placeholder; the grid/list media views and the full-screen preview land in follow-up PRs.

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>
This commit is contained in:
Mauro Romito
2026-07-24 11:10:17 +02:00
committed by Mauro
parent 3796fdc966
commit 4a9cd02fbc
12 changed files with 289 additions and 22 deletions
@@ -18,6 +18,7 @@ nonisolated enum EventBasedMessageTimelineItemContentType: Hashable {
case video(VideoRoomTimelineItemContent)
case location(LocationRoomTimelineItemContent)
case voice(AudioRoomTimelineItemContent)
case gallery(GalleryRoomTimelineItemContent)
}
nonisolated protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineItemProtocol {
@@ -27,7 +28,7 @@ nonisolated protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineIt
nonisolated extension EventBasedMessageTimelineItemProtocol {
var supportsMediaCaption: Bool {
switch contentType {
case .audio, .file, .image, .video:
case .audio, .file, .image, .video, .gallery:
true
case .emote, .notice, .text, .location, .voice:
false
@@ -48,6 +49,8 @@ nonisolated extension EventBasedMessageTimelineItemProtocol {
content.caption
case .video(let content):
content.caption
case .gallery(let content):
content.caption
case .emote, .notice, .text, .location, .voice:
nil
}
@@ -63,6 +66,8 @@ nonisolated extension EventBasedMessageTimelineItemProtocol {
content.formattedCaption
case .video(let content):
content.formattedCaption
case .gallery(let content):
content.formattedCaption
case .emote, .notice, .text, .location, .voice:
nil
}