Fix call timeline item snapshots. (#5923)

* Fix call timeline item snapshots.

* Fix a warning and hard code the call timer during tests.
This commit is contained in:
Doug
2026-07-23 14:42:44 +01:00
committed by GitHub
parent ae71a92ab7
commit 3796fdc966
7 changed files with 28 additions and 19 deletions
@@ -98,7 +98,7 @@ struct ActiveCallTimelineItemView: View {
VStack(spacing: 4) {
if !isJoined {
Button(action: { context?.send(viewAction: .joinActiveCall(isVoiceCall: isVoiceCall)) }) {
Button { context?.send(viewAction: .joinActiveCall(isVoiceCall: isVoiceCall)) } label: {
Text(L10n.actionJoin)
.font(.compound.bodyMDSemibold)
.padding(.horizontal, 6)
@@ -107,12 +107,10 @@ struct ActiveCallTimelineItemView: View {
.buttonStyle(.compound(.primary, size: .small))
}
if let callStartTimestamp {
Text(callStartTimestamp, style: .timer)
.font(.compound.bodyXS)
.foregroundColor(.compound.textSecondary)
.monospacedDigit()
}
callTimer
.font(.compound.bodyXS)
.foregroundColor(.compound.textSecondary)
.monospacedDigit()
}
}
.padding(12)
@@ -120,6 +118,17 @@ struct ActiveCallTimelineItemView: View {
.stroke(.compound.borderInteractivePrimary, lineWidth: 1))
.padding(16)
}
@ViewBuilder
private var callTimer: some View {
if let callStartTimestamp {
if ProcessInfo.isRunningTests {
Text("0:00") // A slow runner can take more than a second to record the snapshot 🤦‍♂️
} else {
Text(callStartTimestamp, style: .timer)
}
}
}
}
// MARK: - Previews