Small widget: support .systemMedium so the icon menu offers both sizes
The iOS 18+ long-press app-icon menu (turn icon into a widget) shows the supported SIZES of the FIRST-registered widget kind only — it does not list widget kinds and is not keyed by intent type (two distinct intents in6375af4changed nothing on-device). The bundle's first kind (FuelPriceSmallWidget, small-first since38b47ee) therefore decided the menu offered only the small tile. The early build worked because FuelPriceWidget was registered first back then. Reordering to medium-first would fix the menu but flip the gallery order (38b47ee). Instead: this first kind now supports BOTH .systemSmall and .systemMedium, so the icon menu offers both size tiles (ChatGPT/Safari behave the same way — their first kind supports several families). The gallery still lists both widget kinds in bundle order; the Small entry just gains a medium variant. The shared view already branches on family, so medium renders the station list.
This commit is contained in:
@@ -75,16 +75,23 @@ struct FuelPriceWidget: Widget {
|
||||
}
|
||||
}
|
||||
|
||||
// Small widget — exactly ONE station (the first of the configured result).
|
||||
// Uses its OWN intent TYPE (FuelBoardSmallWidgetConfigurationIntent) with the
|
||||
// IDENTICAL minimal parameter set as the medium intent. iOS keys the
|
||||
// long-press app-icon contextual menu by configuration-intent TYPE, so two
|
||||
// kinds sharing one intent collapsed there to the first-registered kind (the
|
||||
// small widget won — medium vanished from the icon menu). Distinct intent
|
||||
// TYPE, same minimal params: restores both entries in the icon menu AND keeps
|
||||
// fresh-widget default-config resolution working (the skeleton root cause was
|
||||
// the extra favourite AppEntity params, not intent separation — see the
|
||||
// Fresh-widget defaults section). Favourites sort on the small face shows the
|
||||
// Small widget — exactly ONE station (the first of the configured result)
|
||||
// when rendered at systemSmall; the SAME kind also supports .systemMedium,
|
||||
// where the shared view renders the station list (identical content to the
|
||||
// medium widget — the view branches on family, not kind).
|
||||
//
|
||||
// WHY medium is here (2026-08-14): the iOS 18+ long-press app-icon menu
|
||||
// ("turn app icon into a widget") shows the supported SIZES of the
|
||||
// FIRST-registered widget kind only — it does NOT list widget kinds, and it
|
||||
// is NOT keyed by configuration-intent type (a two-intent experiment,
|
||||
// 6375af4, changed nothing on-device). So the bundle's first kind decides
|
||||
// which size tiles the icon menu offers: small-only meant the menu showed
|
||||
// only the small tile even though the app has a medium widget. Giving this
|
||||
// first-registered kind BOTH .systemSmall and .systemMedium puts both size
|
||||
// tiles in the icon menu (ChatGPT/Safari show multiple sizes the same way —
|
||||
// their first kind supports several families). The gallery still lists both
|
||||
// widget kinds in bundle order (small, then medium); this kind's entry just
|
||||
// gains a medium variant. Favourites sort on the small face shows the
|
||||
// cheapest favourite of the chosen fuel.
|
||||
struct FuelPriceSmallWidget: Widget {
|
||||
let kind = "FuelPriceWidgetSmall"
|
||||
@@ -104,7 +111,7 @@ struct FuelPriceSmallWidget: Widget {
|
||||
}
|
||||
.configurationDisplayName("FuelBoard Small")
|
||||
.description("Fuel prices near you. Configure fuel + sort per widget.")
|
||||
.supportedFamilies([.systemSmall])
|
||||
.supportedFamilies([.systemSmall, .systemMedium])
|
||||
.disfavoredLocations([.carPlay], for: [.systemSmall])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user