diff --git a/FuelBoardWidgets/FuelBoardLiveActivityView.swift b/FuelBoardWidgets/FuelBoardLiveActivityView.swift index 55c0478..a72f1dd 100644 --- a/FuelBoardWidgets/FuelBoardLiveActivityView.swift +++ b/FuelBoardWidgets/FuelBoardLiveActivityView.swift @@ -59,16 +59,24 @@ struct FuelBoardLiveActivity: Widget { private struct FuelBoardLiveActivityView: View { let context: ActivityViewContext + /// Full rich layout needs at least this much width. iPhone/iPad Lock + /// Screen Live Activities are always wider than this, so they get the + /// full view; the CarPlay/Apple Watch Smart Stack small slot is far + /// narrower, so it reliably falls through to `compactBody`. + private let richMinWidth: CGFloat = 290 + /// Only genuinely small slots get the compact strip — cap it so a + /// mid-width surface can never squeeze the full view into the car. + private let compactMaxWidth: CGFloat = 220 + var body: some View { Link(destination: context.state.mapsURL) { ViewThatFits(in: .horizontal) { // rich first — wins on full-width Lock Screen / banner richBody - // CarPlay / Watch small slot is far narrower than this, - // so ViewThatFits reliably falls through to compactBody. - .frame(minWidth: 280) + .frame(minWidth: richMinWidth) // compact fallback — the car's small supplemental slot compactBody + .frame(maxWidth: compactMaxWidth) } } } @@ -90,6 +98,8 @@ private struct FuelBoardLiveActivityView: View { .font(.subheadline) .foregroundStyle(.secondary) .lineLimit(1) + .minimumScaleFactor(0.75) + .truncationMode(.tail) } .frame(maxWidth: .infinity, alignment: .leading) @@ -127,6 +137,8 @@ private struct FuelBoardLiveActivityView: View { .font(.system(size: 9)) .foregroundStyle(.secondary) .lineLimit(1) + .minimumScaleFactor(0.7) + .truncationMode(.tail) } .padding(8) }