From a55e1a278fc22b9094e4ab252f9a4662aa383778 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 21 Oct 2026 12:15:46 +0200 Subject: [PATCH] Fix timeline scroll buttons growing too large with Dynamic Type CompoundIcon already scales its size with Dynamic Type, but the chevron was given a size that was itself a @ScaledMetric, so it scaled twice: the button reached about 202pt at the largest accessibility size, more than twice the composer's mic button. Pass the base icon size and scale the icon, its padding and the badge once, relative to headingLG like the composer buttons. The button now keeps its proportions at every size (72pt at the largest, mic 88pt) and is unchanged at the default size. --- .../Other/SwiftUI/Views/TimelineScrollButton.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ElementX/Sources/Other/SwiftUI/Views/TimelineScrollButton.swift b/ElementX/Sources/Other/SwiftUI/Views/TimelineScrollButton.swift index dfef66de5..0f76f87f2 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/TimelineScrollButton.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/TimelineScrollButton.swift @@ -23,8 +23,7 @@ struct TimelineScrollButton: View { let onLongPress: (() -> Void)? let callback: () -> Void - @ScaledMetric(relativeTo: .compound.bodyLG) private var iconSize: CGFloat = 24 - @ScaledMetric(relativeTo: .compound.bodyLG) private var badgeDotSize: CGFloat = 12 + @ScaledMetric(relativeTo: .compound.headingLG) private var badgeDotSize: CGFloat = 12 @GestureState private var isPressing = false /// Set when a long-press is recognized so the trailing touch-up doesn't also fire `callback()`. @State private var consumedByLongPress = false @@ -103,10 +102,10 @@ struct TimelineScrollButton: View { @ViewBuilder private var icon: some View { let chevron = CompoundIcon(direction == .down ? \.chevronDown : \.chevronUp, - size: .custom(iconSize), - relativeTo: .compound.bodyLG) + size: .medium, + relativeTo: .compound.headingLG) .foregroundStyle(.compound.iconPrimary) - .padding(iconPadding) + .scaledPadding(iconPadding, relativeTo: .compound.headingLG) if #available(iOS 26, *) { chevron .glassEffect(.regular, in: Circle())