Previously the close button only lived in the expanded Dynamic Island's
trailing region — invisible on the lock-screen banner and only revealed
on long-press for the island. Move it into `bottomRow`, which is shared
by both surfaces, so the user sees the button in the default lock-screen
view and the expanded island without any interaction.
The Dynamic Island trailing region goes back to showing the mode pill.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the SF Symbol "gear" (compactLeading) and "bicycle" (lock
screen / no-controls primary row) with the actual app icon.
Added an Assets.xcassets to the TrainerActivity widget extension
(the Runner's catalog isn't visible to the extension target) with
AppIcon@2x.png (120×120) and AppIcon@3x.png (180×180) copied from
the main app's AppIcon set. Referenced as `Image("AppIcon")` with
`.resizable().scaledToFit()` and a rounded-rect clip to match
iOS's standard app-icon shape.
The PBXFileSystemSynchronizedRootGroup membership for the
TrainerActivity folder auto-includes the new asset catalog in the
extension target — no project.pbxproj edits needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the trailing mode pill in the Dynamic Island expanded
region (which was redundant — the bottom row already shows the
SIM/ERG pill) with an `xmark.circle.fill` button.
Tapping the button:
1. Fires a new `StopRideIntent` App Intent.
2. That intent posts a Darwin notification
`de.jonasbark.swiftcontrol.overlay.action.stop`.
3. `AppDelegate.swift`'s observer forwards `action: 'stop'` over
the `bike_control/overlay_actions_ios` MethodChannel.
4. `IosOverlayController._stopRide`:
- `core.connection.disconnectAll()`
- `core.connection.stop()`
- `core.settings.setOverlayEnabled(false)` so Navigation's
auto-show doesn't immediately re-open the activity on the
next BLE reconnect.
- `hide()` ends the Live Activity.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Flutter overlay was redesigned: row 1 is the big mode-aware primary
(gear N/M in SIM, target W in ERG), row 2 has the SIM/ERG pill plus
opted-in metrics (power · cadence · ×ratio in SIM). Mirror that shape
in the iOS Widget Extension:
- Lock Screen / banner: bicycle SF Symbol on the left, big primary
centered, mode pill + metrics on row 2.
- Dynamic Island expanded: leading = primary, trailing = mode pill,
bottom = metrics row.
- Compact-trailing: '14/24' in SIM, '<target>W' in ERG.
- Minimal: gear number or watts target.
Centralised reads into a TrainerSnapshot helper so the lock-screen view
and dynamic-island regions can't drift apart. iOS Live Activities are
display-only; the +/- controls field has no analogue here.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Xcode 16's PBXFileSystemSynchronizedRootGroup pulls every file in the
ios/TrainerActivity/ folder into the TrainerActivityExtension target by
default (Info.plist is the only membership exception). The leftover
TrainerActivity.entitlements (the actual one is ios/TrainerActivityExtension.entitlements)
and README.md from initial setup were getting bundled into the extension,
which may have confused the build.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two structural fixes after diffing against the package's working example:
- Revert ContentState to empty. The plugin's createActivity calls a
ContentState() constructor with no args from the example pattern; the
appGroupId field was a red herring from the plugin's internal type.
- Switch the widget's @available marker from iOS 16.1 to
iOSApplicationExtension 16.1, the correct platform key for an app
extension target. iOS 16.1 was being honored at compile time but the
WidgetKit registration uses the extension-specific availability scope.
- Inline the field reads inside the widget closures (matches the example
layout) instead of routing through a helper struct.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The plugin's internal LiveActivitiesAppAttributes.ContentState declares
'var appGroupId: String' and constructs Activity requests with that
field populated. Our widget declared an empty ContentState, so ActivityKit
rejected every launch with ActivityInput error 0 (malformedAttributes).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The package always launches Activity<LiveActivitiesAppAttributes> internally
and writes payload fields to the App Group's UserDefaults keyed by
"<id>_<fieldName>". Our custom TrainerActivityAttributes was never matched
by the system (ActivityInput error 0).
- Replace TrainerActivityAttributes with the package-required
LiveActivitiesAppAttributes (empty ContentState + UUID id + prefixedKey
helper extension).
- Rewrite TrainerActivity widget to read all fields from
UserDefaults(suiteName: "group.de.jonasbark.swiftcontrol.overlay") via
attributes.prefixedKey(...).
- Wrap the widget in a WidgetBundle gated on iOS 16.1 so the @main entry
point compiles on older deployment targets too.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds all source files for the TrainerActivity WidgetKit extension:
TrainerActivity.swift (@main, Lock Screen banner + Dynamic Island views),
TrainerActivityAttributes.swift (ActivityAttributes struct with gear,
mode, power, cadence, and erg-target fields), Info.plist, and
TrainerActivity.entitlements (App Group group.de.jonasbark.swiftcontrol.overlay).
A README documents the one-time manual Xcode steps required to wire the
target before flutter build ios will succeed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>