diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift index 3ec36ec96..950d6b483 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift @@ -79,26 +79,11 @@ struct HomeScreenRoomCell: View { @ViewBuilder private var header: some View { HStack(alignment: .top, spacing: 16) { - HStack(spacing: 4) { - Text(room.name) - .font(.compound.bodyLGSemibold) - .foregroundColor(.compound.textPrimary) - .lineLimit(1) - - switch room.lastMessageState { - case .sending: - CompoundIcon(\.time, size: .xSmall, relativeTo: .compound.bodyLGSemibold) - .foregroundStyle(.compound.iconTertiary) - .accessibilityLabel(L10n.commonSending) - case .failed: - CompoundIcon(\.errorSolid, size: .xSmall, relativeTo: .compound.bodyLGSemibold) - .foregroundStyle(.compound.iconCriticalPrimary) - .accessibilityHidden(true) // The last message contains the error. - case .none: - EmptyView() - } - } - .frame(maxWidth: .infinity, alignment: .leading) + Text(room.name) + .font(.compound.bodyLGSemibold) + .foregroundColor(.compound.textPrimary) + .lineLimit(1) + .frame(maxWidth: .infinity, alignment: .leading) if let timestamp = room.timestamp { Text(timestamp) @@ -118,7 +103,22 @@ struct HomeScreenRoomCell: View { .hidden() .environment(\.redactionReasons, []) // Always maintain consistent height - lastMessage + HStack(alignment: .top, spacing: 4.0) { + switch room.lastMessageState { + case .sending: + CompoundIcon(\.time, size: .xSmall, relativeTo: .compound.bodyLGSemibold) + .foregroundStyle(.compound.iconTertiary) + .accessibilityLabel(L10n.commonSending) + case .failed: + CompoundIcon(\.errorSolid, size: .xSmall, relativeTo: .compound.bodyLGSemibold) + .foregroundStyle(.compound.iconCriticalPrimary) + .accessibilityHidden(true) // The last message contains the error. + case .none: + EmptyView() + } + + lastMessage + } } Spacer() diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-en-GB.png index 591c20f3b..e68c1dfc8 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-en-GB.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-en-GB.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:899b9e713623f1653ca25f5cb03af6aa9e50c92c38f38dbeba5168852f163252 -size 96321 +oid sha256:fb5f3d945f3fdd9c57613c9c3110d285ebdc881e30d4fe72988d1ac4d5249ac4 +size 96301 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-pseudo.png index 340a0d66a..0c757e7ba 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-pseudo.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPad-pseudo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8a898c4e79d167633d0e503a3554a6a10634a49b3e25eeffc221c3399424468f -size 97646 +oid sha256:c000bb9cb033c8258697cab9854acad257703bb0522ba793831e5177d6daeb98 +size 97622 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-en-GB.png index a931218f0..5e1029e39 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-en-GB.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-en-GB.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e32a4b30150f9ea92243c0e4dc01c0643459f635348fcd9d8073e0b04d882584 -size 81929 +oid sha256:46777589e3790e982b497eee806f2d68c7f50ee9dcb9fc08e3aef08eeae02471 +size 82974 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-pseudo.png index 0676380a6..7007bf6d0 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-pseudo.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenRoomCell.Last-Message-State-iPhone-pseudo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7bb0e71201fad83310529b313a6a4e9cd44bdc712996e0c42c43f0314e534d6c -size 85654 +oid sha256:9f798d16e787c4053e1b8534c9c2bb381b4cb01338e26db07d3c46d9bb6b0897 +size 87668