diff --git a/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift b/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift index 26f263b47..1cec14840 100644 --- a/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift +++ b/ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift @@ -11,6 +11,7 @@ extension View { /// Constrains the max height of a media item in the timeline, whilst preserving its aspect ratio. @ViewBuilder func timelineMediaFrame(height contentHeight: CGFloat?, aspectRatio contentAspectRatio: CGFloat?) -> some View { + let defaultMediaSize = 100.0 let minMediaHeight = 100.0 let maxMediaHeight = 300.0 @@ -23,9 +24,8 @@ extension View { .frame(maxHeight: min(maxMediaHeight, max(minMediaHeight, contentHeight ?? .infinity))) // Required to prevent the reply details to get higher priority in rendering the width of the view. .aspectRatio(contentAspectRatio, contentMode: .fit) - } else { // Otherwise let the image load and use its native aspect ratio with a max height - aspectRatio(contentMode: .fit) - .frame(maxHeight: maxMediaHeight) + } else { // Otherwise force the image to be `defaultMediaSize` x `defaultMediaSize` + frame(width: defaultMediaSize, height: defaultMediaSize) } } } diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-en-GB.1.png index 91467ebe2..5469ed0e3 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec3b4d8dbd25c91790ca8a220c5d0d848dbc2e82668070ba4e1649990ba4d598 -size 462017 +oid sha256:f63e72b33f82f8b679dd8b1fc810078438914d70d395c23abd13571d01643597 +size 227546 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-pseudo.1.png index 91467ebe2..5469ed0e3 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec3b4d8dbd25c91790ca8a220c5d0d848dbc2e82668070ba4e1649990ba4d598 -size 462017 +oid sha256:f63e72b33f82f8b679dd8b1fc810078438914d70d395c23abd13571d01643597 +size 227546 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-en-GB.1.png index ef24497c7..bd08a5288 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:63011572252e6377c8d7717c1623e2b733b38fb95a469718d8f8f75c4e622148 -size 388241 +oid sha256:fb0bce1bf5571926c9ae760503e3aff11bfa962d646e257ab9481bc9496b95a6 +size 169079 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-pseudo.1.png index ef24497c7..bd08a5288 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_imageRoomTimelineView-iPhone-15-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:63011572252e6377c8d7717c1623e2b733b38fb95a469718d8f8f75c4e622148 -size 388241 +oid sha256:fb0bce1bf5571926c9ae760503e3aff11bfa962d646e257ab9481bc9496b95a6 +size 169079 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-en-GB.1.png index 5dc3afdcf..a40034429 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45e913fecbfca17c27d455118c4b0a8adb477966a43f8865936387896859e26f -size 554832 +oid sha256:bd110afc7d00be27146e58474b810415af9dc7d5ed6faf1536419f01f41f9a3a +size 404161 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-pseudo.1.png index 5dc3afdcf..a40034429 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45e913fecbfca17c27d455118c4b0a8adb477966a43f8865936387896859e26f -size 554832 +oid sha256:bd110afc7d00be27146e58474b810415af9dc7d5ed6faf1536419f01f41f9a3a +size 404161 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-en-GB.1.png index 79f80fec5..3ab5d2b0b 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:139d1ad264ee618f6dd806f74db0bb09cc5f550ff6c6aec705e63695372200cb -size 476465 +oid sha256:ef76e5d6f293ae298df0e70744ffed330e1fcb4a1e1157fbd7578e59bbe52fd4 +size 336667 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-pseudo.1.png index 79f80fec5..3ab5d2b0b 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_stickerRoomTimelineView-iPhone-15-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:139d1ad264ee618f6dd806f74db0bb09cc5f550ff6c6aec705e63695372200cb -size 476465 +oid sha256:ef76e5d6f293ae298df0e70744ffed330e1fcb4a1e1157fbd7578e59bbe52fd4 +size 336667 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Encryption-Indicators.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Encryption-Indicators.png index b1737febd..ec2c0f596 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Encryption-Indicators.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Encryption-Indicators.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91293e02a282b89e52d98d10c0ed042e107f58cd661455652c3a50a1295ac9a6 -size 438937 +oid sha256:517d2adbb60ff9e40d7b0f530b05f3810f302180fed9259673afe57f2598d669 +size 174777 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Thread-decorator.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Thread-decorator.png index 2b33e3e79..c643b3f33 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Thread-decorator.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-en-GB.Thread-decorator.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:28d71dc48e5a4bc8671f67f4b1985ae98dd5f4df1817321bde786f724254cbcf -size 391551 +oid sha256:c781557f5fe6df00faed8dd42be033130829d70463ddd32cf0fb2c5824b28a87 +size 182594 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Encryption-Indicators.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Encryption-Indicators.png index d2899ca01..7d4aeba08 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Encryption-Indicators.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Encryption-Indicators.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d15d0a6e23b80979c7f0025316673e7f20b1b7de6efdf700fb5fc2aebd33a1e2 -size 441049 +oid sha256:685784026c5fbf1676f2e41105303c150a8520c0588081960dd6c679cb16f86f +size 176916 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Thread-decorator.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Thread-decorator.png index 54ffd319a..0e33bc0a4 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Thread-decorator.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPad-pseudo.Thread-decorator.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2c46543a0eafef243bbed2b92dd889e7fdcc11dc39a7400f986c90cec47c2f2 -size 396860 +oid sha256:3d7c7b295d08a8f36ff42ba885f8e3633e5e63d877c08808043753ed3b145bc5 +size 189906 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Encryption-Indicators.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Encryption-Indicators.png index c655b3c0a..f2a14f4ba 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Encryption-Indicators.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Encryption-Indicators.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a5a5711cb02a63320e78b0001d014ef7342ab0b6df128af23c836239656cae3b -size 343702 +oid sha256:0ad54f532f3ec4333e004b763956ea2ffec9aecfa0c3113b423f6a9f85ac87c7 +size 127545 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Thread-decorator.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Thread-decorator.png index 24cf36e3f..55926339e 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Thread-decorator.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-en-GB.Thread-decorator.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b548f6af318563685185a8fe2ab1c59dce4712d88dc23b4d5e0b646e0f254d2f -size 286789 +oid sha256:2f2a1fd7f2e30a9835c9c684da06cb5edfd352b14f53f4d3a8d665ea2aa798c0 +size 134209 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Encryption-Indicators.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Encryption-Indicators.png index c427dc3f5..45fc5a690 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Encryption-Indicators.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Encryption-Indicators.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c8c1c59dd74c9d11e0496583ec9348d1fc7d1eb6504b975eda2e597b3d0fa8f -size 344963 +oid sha256:8dd04554290d3299b0ce0a95d2304bce2d90a7c130f48a64efc6fc4b3b15727c +size 128846 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Thread-decorator.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Thread-decorator.png index e4ebeb22c..0d69adde7 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Thread-decorator.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_timelineItemBubbledStylerView-iPhone-15-pseudo.Thread-decorator.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:98e22ec3f450dfc28e4e556b9b5cb7f41e11f2001029bfc4f668dcf48340e619 -size 288246 +oid sha256:a92c6e0f7a53d5fbffa090cb6bda583920317649b3f7e1cf8a96d74a1d9b64cf +size 136933 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-en-GB.1.png index 038f9c5e0..1bc9dd26d 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd3b3ad512b4fcd3bf9c4822f3332f61a23a20a880f791ca6693aaeb5ad8b3f0 -size 81295 +oid sha256:919c37cec762f3a5ead4e55e611e78bc3b6a52fdb6c2f2435d387511bdaf3bb3 +size 81177 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-pseudo.1.png index 038f9c5e0..1bc9dd26d 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd3b3ad512b4fcd3bf9c4822f3332f61a23a20a880f791ca6693aaeb5ad8b3f0 -size 81295 +oid sha256:919c37cec762f3a5ead4e55e611e78bc3b6a52fdb6c2f2435d387511bdaf3bb3 +size 81177 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-en-GB.1.png index e85e3fd8d..15d62f213 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d4c247516251a85727f948204a18127bce75f5aa7a640ca0248ecfc4d09eecd7 -size 40156 +oid sha256:bbf8a9e38c8188356a7e9758b7afbcbc84c4b58b4ada32999e1591883c99704c +size 40312 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-pseudo.1.png index e85e3fd8d..15d62f213 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_videoRoomTimelineView-iPhone-15-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d4c247516251a85727f948204a18127bce75f5aa7a640ca0248ecfc4d09eecd7 -size 40156 +oid sha256:bbf8a9e38c8188356a7e9758b7afbcbc84c4b58b4ada32999e1591883c99704c +size 40312