From 221b96097dd43e9571e4a528d3c19933da599034 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Wed, 19 Aug 2026 16:09:02 +0100 Subject: [PATCH] live activity: drop .small family so iPhone/iPad show full-width card The active activity was rendering the narrow .small form on the iPhone Lock Screen (squeezed, small text) because .supplementalActivityFamilies([.small]) made iOS eligible to present it that way. Remove it so iPhone/iPad always get the full three-column card; CarPlay's small form still comes from the Dynamic Island compact closures. Keep compactBody as a narrow-width safety fallback. --- .../FuelBoardLiveActivityView.swift | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/FuelBoardWidgets/FuelBoardLiveActivityView.swift b/FuelBoardWidgets/FuelBoardLiveActivityView.swift index a72f1dd..df2b722 100644 --- a/FuelBoardWidgets/FuelBoardLiveActivityView.swift +++ b/FuelBoardWidgets/FuelBoardLiveActivityView.swift @@ -4,27 +4,25 @@ // Shows the cheapest station for the pinned fuel within the app's chosen // radius. Tapping anywhere opens Apple Maps directions to that station. // -// ADAPTIVE LAYOUT: ActivityConfiguration shares ONE content view across the -// Lock Screen, banner, and the CarPlay small slot — there is no per-platform -// closure. So this view provides two layouts and lets ViewThatFits pick by -// available width: -// • richBody — the full three-column design (glyph · fuel+station · price), -// wins wherever there's Lock Screen width (it carries an -// explicit minWidth so it can never be squeezed into the car). -// • compactBody — a minimal price-strip (glyph+fuel+price, station caption -// below) that wins in the CarPlay/Apple Watch Smart Stack -// small slot. +// ADAPTIVE LAYOUT: the Lock Screen body provides two layouts and lets +// ViewThatFits pick by available width, but the narrow `.small` family is NOT +// declared (see note on the config), so iPhone/iPad always render the full +// three-column card (`richBody`) with proper text sizes. `compactBody` is kept +// as a safety fallback should any surface ever hand this view a narrow width. +// +// IMPORTANT: `.supplementalActivityFamilies([.small])` is deliberately absent — +// it made iOS render the squeezed `.small` card on the iPhone Lock Screen. +// CarPlay's small form comes from the Dynamic Island compact closures. import ActivityKit import SwiftUI import WidgetKit /// The Live Activity itself — registered in the widget bundle alongside the -/// regular price widget. No CarPlay entitlement involved: this renders on the -/// Lock Screen, Dynamic Island, and the car display (CarPlay Ultra, iOS 26+). -/// `.supplementalActivityFamilies([.small])` makes it eligible for the car's -/// small Live Activity slot — display-only there (FuelBoard is not a -/// CarPlay-enabled app, so car-side taps can't launch anything). +/// regular price widget. No CarPlay entitlement involved: renders on the +/// Lock Screen (full-width card on iPhone/iPad) and the Dynamic Island +/// (incl. the island's compact form used in the car, display-only — FuelBoard +/// is not a CarPlay-enabled app, so car-side taps can't launch anything). struct FuelBoardLiveActivity: Widget { var body: some WidgetConfiguration { ActivityConfiguration(for: FuelBoardLiveActivityAttributes.self) { context in @@ -51,7 +49,12 @@ struct FuelBoardLiveActivity: Widget { .font(.caption2.bold().monospacedDigit()) } } - .supplementalActivityFamilies([.small]) + // NOTE: deliberately NO `.supplementalActivityFamilies([.small])`. + // That modifier makes iOS eligible to render this activity in the + // narrow `.small` form on the iPhone/iPad Lock Screen, which is what + // produced the squeezed, small-text card. Dropping it keeps the + // full-width Lock Screen card on iPhone/iPad; CarPlay still shows a + // small form via the Dynamic Island compact closures below. } }