Move the room list sending state icons to the front of the latest event.

This commit is contained in:
Stefan Ceriu
2025-12-11 14:44:15 +02:00
committed by Stefan Ceriu
parent 4ea1aaecdd
commit 8518e67426
5 changed files with 29 additions and 29 deletions
@@ -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()