Run SwiftFormat.

This commit is contained in:
Doug
2026-05-27 14:38:50 +01:00
committed by Doug
parent 5138e05e47
commit fa67713726
573 changed files with 2426 additions and 2426 deletions
@@ -20,7 +20,7 @@ extension EstimatedWaveform {
guard maxSamplesCount > 0 else {
return []
}
// Filter the data to keep only the expected number of samples
let result: [UInt16]
if data.count > maxSamplesCount {
@@ -32,7 +32,7 @@ extension EstimatedWaveform {
} else {
result = data
}
// Normalize the sample in the allowed range
return result.map { Float($0) / Float(Self.dataRange.upperBound) }
}
@@ -10,14 +10,14 @@ import SwiftUI
struct PlaybackSpeedButton: View {
let speed: AudioPlaybackSpeed
let onTap: () -> Void
var body: some View {
Button(action: onTap) {
ZStack {
Text(speed.placeholder)
.font(.compound.bodyXSSemibold)
.hidden()
Text(speed.label)
.font(.compound.bodyXSSemibold)
.foregroundColor(.compound.iconSecondary)
@@ -44,7 +44,7 @@ struct VoiceMessageButton: View {
self.state = state
self.action = action
}
var body: some View {
Button(action: action) {
buttonLabel
@@ -58,7 +58,7 @@ struct VoiceMessageButton: View {
.disabled(state == .loading)
.accessibilityLabel(accessibilityLabel)
}
@ViewBuilder
private var buttonLabel: some View {
switch state {
@@ -87,7 +87,7 @@ private struct VoiceMessageButtonStyle: ButtonStyle {
@Environment(\.isEnabled) var isEnabled: Bool
let color: Color
func makeBody(configuration: Configuration) -> some View {
configuration.label
.foregroundColor(isEnabled ? color.opacity(configuration.isPressed ? 0.6 : 1) : .compound.iconDisabled)
@@ -11,7 +11,7 @@ import SwiftUI
struct WaveformCursorView: View {
var color: Color = .compound.iconAccentTertiary
var body: some View {
RoundedRectangle(cornerRadius: 1)
.fill(color)
@@ -19,11 +19,11 @@ private struct WaveformInteractionModifier: ViewModifier {
let progress: Double
let showCursor: Bool
let onSeek: (Double) -> Void
@ScaledMetric private var cursorVisibleWidth = 2.0
@ScaledMetric private var cursorVisibleHeight = 24.0
private let cursorInteractiveSize: CGFloat = 50
func body(content: Content) -> some View {
GeometryReader { geometry in
content
@@ -52,6 +52,6 @@ private struct WaveformInteractionModifier: ViewModifier {
.coordinateSpace(name: Self.namespaceName)
.animation(nil, value: progress)
}
private static let namespaceName = "voice-message-waveform"
}