Commit Graph

202 Commits

Author SHA1 Message Date
Jonas Bark
85bfa688de chore(deps): point universal_ble fork at rebased 2.1.0 + iOS patch
The fork's `changes` branch was rebased onto upstream universal_ble 2.1.0
and reduced to the single iOS/macOS background-connect Swift patch. The
Windows shared-mode/hresult fixes and addServicesInScanResponse have all
landed upstream, so they are no longer carried by the fork.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 15:40:02 +02:00
Jonas Bark
95b7a7ff06 fix(zwift): put Rouvy advertisement service UUIDs in the scan response
The Rouvy Zwift-BLE advertisement (Zwift fc82 + OBC 128-bit UUID + name
"BikeControl" = ~38 bytes) overflows Android's 31-byte primary packet, so
startAdvertising fails with "Data too large" — Rouvy users on 6.1 can't
connect (the bluetooth_low_energy -> universal_ble migration stopped
splitting service UUIDs into the scan response).

Bump universal_ble to the fork commit that adds
PeripheralAndroidOptions.addServicesInScanResponse, expose it through
PeripheralServer.startAdvertising, and enable it for the Rouvy branch of
the Zwift emulator. Primary packet becomes flags+name (~16B), scan
response carries the UUIDs (~22B); active scanners still see everything.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 08:27:39 +02:00
Jonas Bark
1b131b312a chore(6.2): lock new deps + regenerate plugin registrants (gal; no screen_recorder native yet) 2026-06-24 17:12:27 +02:00
Jonas Bark
b201cb3e53 Generate localized store screenshots (golden_screenshot 11)
- Bump golden_screenshot 8.2.0 -> ^11.0.1 (drops the Yaru dependency, hence the
  linux plugin-registrant change).
- screenshot_test.dart now renders each scene for 6 locales (en/de/es/fr/it/pl)
  via a shoot() helper, writing screenshots/<locale>/<scene>-<device>.png.
  Marketing titles are translated per locale (de/es/fr/it/pl are drafts).
  - main.dart: screenshotLocale global drives the app locale in screenshot mode
    (was hardcoded to English).
  - v11 only loads fonts found in the rendered tree, so loadAssets() runs after
    the first pump.
- Virtual Shifting scene shows the gear UI instead of the "trainer doesn't
  advertise FTMS" warning: added ProxyDevice.debugAttachFitnessBike (test seam,
  no server side-effects) and hide the MyWhoosh gearing hint in screenshot mode.
- prepare_store_screenshots.sh maps each store locale from its language folder
  (de-DE <- screenshots/de, ...).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:22:56 +02:00
Jonas Bark
c41683421e Merge remote-tracking branch 'origin/6.0.1' into custom-mdns-responder
# Conflicts:
#	.gitignore
#	lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart
#	prop
2026-06-12 12:03:37 +02:00
Jonas Bark
d40c05d64d Enable the custom mDNS responder on Android (multicast lock via prop)
prop's MulticastMdnsSocket now holds a WifiManager multicast lock on
Android, so platformDefault() selects the A-only responder there too;
flutter_multicast_lock enters the lockfile as a transitive dependency
and its plugin manifest contributes CHANGE_WIFI_MULTICAST_STATE. Only
iOS remains on the OS responder.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 10:18:46 +02:00
Jonas Bark
0573c2544c update modules 2026-06-10 09:35:23 +02:00
Jonas Bark
a60a1384e3 Merge origin/universal-ble-2-peripheral: universal_ble 2.0.0 peripheral mode
Brings the BLE peripheral-mode migration to universal_ble 2.0.0 into the
WiFi DirCon trainer-discovery branch and bumps universal_ble to the latest
fork commit (ref: changes, 2.0.0).

Conflict resolutions:
- prop submodule: merged the universal_ble 2.0 transporter migration with
  the WiFi DirCon TrainerTransport refactor; kept the '0x' short-UUID
  normalisation on startAdvertising. Updated BleCharacteristic call sites
  to the new 3-arg (uuid, properties, descriptors) constructor.
- obc_ble_emulator.dart: took the PeripheralServer / universal_ble 2.0
  write-handler migration; kept the richer Error(button:) context on
  sendAction (using _currentDeviceId, the migrated connection tracker).
- unlock.dart: kept the main.dart import.
- pubspec.yaml: kept version 6.0.0+135; took ref: changes for universal_ble.

Pre-existing prop test failures (composite/dircon/fitness serviceUUIDs) are
unchanged by this merge — they fail identically on the pre-merge branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 09:19:58 +02:00
Jonas Bark
1ce9ab43c0 fix scanner 2026-06-10 07:23:36 +02:00
Jonas Bark
1c064e1867 update libs 2026-05-20 23:06:42 +02:00
Jonas Bark
29741e520f migrate peripheral mode to universal_ble 2.0.0
Drop bluetooth_low_energy. Move OBC BLE emulator, Zwift emulator, and
the remote mouse / keyboard pairing flows onto a new PeripheralServer
wrapper around UniversalBlePeripheral that routes per-characteristic
read/write handlers, so multiple peripheral instances coexist without
clobbering universal_ble's process-wide handlers.

Also: onValueChange callback gains a timestamp param (v1.0.0 breaking
change), PeripheralManager().showAppSettings() → openAppSettings(),
UUID.short(0x12) → literal UUID, and prop submodule bumped to the
matching universal_ble peripheral rewrite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 09:28:39 +02:00
Jonas Bark
6ab4eeee3a overlay/macos: rebase vendored multi_window_native on GitHub master (1.0.5)
The previous commit vendored the pub.dev 1.0.4 release. The
GitHub repo (https://github.com/Swatimishra8/multi_window_native)
is ahead of pub.dev at 1.0.5 and contains improvements that
matter for the trainer-overlay use case:

- `windowDidBecomeKey` delegate to resume Flutter's render
  pipeline on focus — fixes sub-windows freezing after the
  main app regains focus.
- `applicationShouldHandleReopen` for dock-icon restore.
- Delayed (0.1s) cleanup of secondary windows in `closeWindow`
  so Flutter's onWindowClose callbacks finish executing.
- `generateUniqueTitle`/`registerWindowTitle`/`unregisterWindowTitle`
  bridge methods.
- Native Windows implementation in the package itself
  (we still use our own runner/main.cpp wiring; the package's
  Windows code is unused but harmless).

Re-applied the NSPanel substitution in `createNewWindow`:
.nonactivatingPanel + .utilityWindow style, level .screenSaver,
collectionBehavior including .fullScreenAuxiliary, initial size
220x140 / minSize 160x80 — so the sub-window sits above
fullscreened trainer apps from the moment it's shown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:21:47 +02:00
Jonas Bark
7cfd3b98c0 overlay/macos: rebase vendored multi_window_native on GitHub master (1.0.5)
The previous commit vendored the pub.dev 1.0.4 release. The
GitHub repo (https://github.com/Swatimishra8/multi_window_native)
is ahead of pub.dev at 1.0.5 and contains improvements that
matter for the trainer-overlay use case:

- `windowDidBecomeKey` delegate to resume Flutter's render
  pipeline on focus — fixes sub-windows freezing after the
  main app regains focus.
- `applicationShouldHandleReopen` for dock-icon restore.
- Delayed (0.1s) cleanup of secondary windows in `closeWindow`
  so Flutter's onWindowClose callbacks finish executing.
- `generateUniqueTitle`/`registerWindowTitle`/`unregisterWindowTitle`
  bridge methods.
- Native Windows implementation in the package itself
  (we still use our own runner/main.cpp wiring; the package's
  Windows code is unused but harmless).

Re-applied the NSPanel substitution in `createNewWindow`:
.nonactivatingPanel + .utilityWindow style, level .screenSaver,
collectionBehavior including .fullScreenAuxiliary, initial size
220x140 / minSize 160x80 — so the sub-window sits above
fullscreened trainer apps from the moment it's shown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:21:47 +02:00
Jonas Bark
8bf8aa6bb7 overlay/macos: vendor multi_window_native and make sub-windows NSPanels
Forked the upstream package
(https://github.com/Swatimishra8/multi_window_native) into
packages/multi_window_native and pinned pubspec to the path dep.

Key macOS change in the vendored plugin's createNewWindow:
- NSPanel instead of NSWindow with styleMask = [.titled, .closable,
  .resizable, .nonactivatingPanel, .utilityWindow].
- isFloatingPanel = true, becomesKeyOnlyIfNeeded = true,
  hidesOnDeactivate = false.
- level = .screenSaver (highest standard user-space level).
- collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary,
  .stationary, .ignoresCycle].
- Initial size dropped from 1440x900 / minSize 800x900 to 220x140 /
  minSize 160x80 (closer to what the trainer overlay needs).

With those properties set at construction time, the sub-window sits
above fullscreened trainer apps from the moment it's shown — no more
retry loop chasing the window after the fact.

MainFlutterWindow.swift's onEngineCreatedCallback no longer needs the
elevation retry; it just calls RegisterGeneratedPlugins on the new
engine and leaves the window-level work to the plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:18:58 +02:00
Jonas Bark
29a267eba4 overlay/macos: vendor multi_window_native and make sub-windows NSPanels
Forked the upstream package
(https://github.com/Swatimishra8/multi_window_native) into
packages/multi_window_native and pinned pubspec to the path dep.

Key macOS change in the vendored plugin's createNewWindow:
- NSPanel instead of NSWindow with styleMask = [.titled, .closable,
  .resizable, .nonactivatingPanel, .utilityWindow].
- isFloatingPanel = true, becomesKeyOnlyIfNeeded = true,
  hidesOnDeactivate = false.
- level = .screenSaver (highest standard user-space level).
- collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary,
  .stationary, .ignoresCycle].
- Initial size dropped from 1440x900 / minSize 800x900 to 220x140 /
  minSize 160x80 (closer to what the trainer overlay needs).

With those properties set at construction time, the sub-window sits
above fullscreened trainer apps from the moment it's shown — no more
retry loop chasing the window after the fact.

MainFlutterWindow.swift's onEngineCreatedCallback no longer needs the
elevation retry; it just calls RegisterGeneratedPlugins on the new
engine and leaves the window-level work to the plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:18:58 +02:00
Jonas Bark
805d0e410c overlay/desktop: use multi_window_native on both platforms with selective plugin registration
Drop desktop_multi_window entirely; unify macOS + Windows on
multi_window_native. Windows runner re-gets the CreateNewWindow /
CloseWindow / SetMainWindowMethodHandler plumbing with selective
sub-engine registration (only WindowManagerPlugin +
MultiWindowNativePlugin) to avoid the deadlock caused by full
RegisterPlugins on secondary engines. macOS MainFlutterWindow narrows
onEngineCreatedCallback from RegisterGeneratedPlugins to the same two
plugins for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 11:14:05 +02:00
Jonas Bark
960a12d077 overlay/desktop: use multi_window_native on both platforms with selective plugin registration
Drop desktop_multi_window entirely; unify macOS + Windows on
multi_window_native. Windows runner re-gets the CreateNewWindow /
CloseWindow / SetMainWindowMethodHandler plumbing with selective
sub-engine registration (only WindowManagerPlugin +
MultiWindowNativePlugin) to avoid the deadlock caused by full
RegisterPlugins on secondary engines. macOS MainFlutterWindow narrows
onEngineCreatedCallback from RegisterGeneratedPlugins to the same two
plugins for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 11:14:05 +02:00
Jonas Bark
7c06b3330f overlay/desktop: use desktop_multi_window on Windows, keep multi_window_native on macOS
Add `desktop_multi_window: ^0.3.0` alongside `multi_window_native: ^1.0.4`.
On Windows the sub-window is now spawned via `WindowController.create` with a
JSON `role=trainer-overlay` argument (detected in `main()` before any heavy
bootstrap), and state/actions flow over `WindowMethodChannel(kOverlayChannel)`.
macOS continues using `MultiWindowNative.createWindow` / `notifyAllWindows` /
`registerListener` unchanged.

Windows runner reverts all `multi_window_native` plumbing:
`SecondaryWindowContext`, `CreateNewWindow`, `CloseWindow`,
`SetMainWindowMethodHandler`, and the plugin source compiled directly into the
runner are removed. `flutter_window.cpp` instead registers
`DesktopMultiWindowSetWindowCreatedCallback` so every sub-engine gets plugins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 10:33:14 +02:00
Jonas Bark
20fc10395d overlay/desktop: use desktop_multi_window on Windows, keep multi_window_native on macOS
Add `desktop_multi_window: ^0.3.0` alongside `multi_window_native: ^1.0.4`.
On Windows the sub-window is now spawned via `WindowController.create` with a
JSON `role=trainer-overlay` argument (detected in `main()` before any heavy
bootstrap), and state/actions flow over `WindowMethodChannel(kOverlayChannel)`.
macOS continues using `MultiWindowNative.createWindow` / `notifyAllWindows` /
`registerListener` unchanged.

Windows runner reverts all `multi_window_native` plumbing:
`SecondaryWindowContext`, `CreateNewWindow`, `CloseWindow`,
`SetMainWindowMethodHandler`, and the plugin source compiled directly into the
runner are removed. `flutter_window.cpp` instead registers
`DesktopMultiWindowSetWindowCreatedCallback` so every sub-engine gets plugins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 10:33:14 +02:00
Jonas Bark
40d297ba64 overlay/desktop: switch to multi_window_native
Drops desktop_multi_window 0.3.0 in favour of multi_window_native 1.0.4
on a new branch (feature/trainer-overlay-multi-window-native).

Mechanism is different but the responsibilities map cleanly:
- `MultiWindowNative.createWindow([routeName, argsJson, theme])` spawns
  the sub-window; main() detects it via the first arg.
- Communication is broadcast by method name through
  `notifyAllWindows` + `registerListener`. Conventions:
    main → overlay: trainerOverlay.state
    overlay → main: trainerOverlay.action / ready / positionChanged
  Each side filters by method name; the API has no per-window targeting.
- The overlay window grabs its windowId via `windowManager.getId()` and
  broadcasts `trainerOverlay.ready` so the controller can later close it.
- `notifyUiRendered()` is called after the first frame, per the package's
  black-screen workaround on macOS/Windows.

Native shims:
- macOS MainFlutterWindow.swift: re-register plugins on every new
  sub-engine via `MultiWindowNativePlugin.onEngineCreatedCallback`. Kept
  the `.statusBar` / `.fullScreenAuxiliary` elevation for visibility
  above fullscreened trainer apps; the callback now finds the new
  sub-window's NSWindow by matching the FlutterViewController's engine.
- Windows flutter_window.cpp: reverted the desktop_multi_window callback;
  multi_window_native's Windows wiring requires a more invasive
  flutter_window.h / cpp change (SetOnCloseCallback, GetFlutterViewController,
  callback registration in main.cpp) which is TBD. The overlay is only
  verified on macOS in this branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 09:11:00 +02:00
Jonas Bark
c39d4191f6 overlay/desktop: switch to multi_window_native
Drops desktop_multi_window 0.3.0 in favour of multi_window_native 1.0.4
on a new branch (feature/trainer-overlay-multi-window-native).

Mechanism is different but the responsibilities map cleanly:
- `MultiWindowNative.createWindow([routeName, argsJson, theme])` spawns
  the sub-window; main() detects it via the first arg.
- Communication is broadcast by method name through
  `notifyAllWindows` + `registerListener`. Conventions:
    main → overlay: trainerOverlay.state
    overlay → main: trainerOverlay.action / ready / positionChanged
  Each side filters by method name; the API has no per-window targeting.
- The overlay window grabs its windowId via `windowManager.getId()` and
  broadcasts `trainerOverlay.ready` so the controller can later close it.
- `notifyUiRendered()` is called after the first frame, per the package's
  black-screen workaround on macOS/Windows.

Native shims:
- macOS MainFlutterWindow.swift: re-register plugins on every new
  sub-engine via `MultiWindowNativePlugin.onEngineCreatedCallback`. Kept
  the `.statusBar` / `.fullScreenAuxiliary` elevation for visibility
  above fullscreened trainer apps; the callback now finds the new
  sub-window's NSWindow by matching the FlutterViewController's engine.
- Windows flutter_window.cpp: reverted the desktop_multi_window callback;
  multi_window_native's Windows wiring requires a more invasive
  flutter_window.h / cpp change (SetOnCloseCallback, GetFlutterViewController,
  callback registration in main.cpp) which is TBD. The overlay is only
  verified on macOS in this branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 09:11:00 +02:00
Jonas Bark
8c24190198 deps: add desktop_multi_window 0.3.0 and wire macOS plugin callback
Add desktop_multi_window ^0.3.0 alongside window_manager. Update
macos/Runner/MainFlutterWindow.swift with the FlutterMultiWindowPlugin
window-created callback so sub-window engines register all generated
plugins automatically. Also includes flutter pub get generated changes to
linux/windows/macos plugin registrants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:07:18 +02:00
Jonas Bark
12fc7eed87 deps: add desktop_multi_window 0.3.0 and wire macOS plugin callback
Add desktop_multi_window ^0.3.0 alongside window_manager. Update
macos/Runner/MainFlutterWindow.swift with the FlutterMultiWindowPlugin
window-created callback so sub-window engines register all generated
plugins automatically. Also includes flutter pub get generated changes to
linux/windows/macos plugin registrants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:07:18 +02:00
Jonas Bark
f17fc8eb2b deps: add flutter_overlay_window (Android) and live_activities (iOS) for trainer overlay 2026-05-08 22:43:39 +02:00
Jonas Bark
1917031c41 deps: add flutter_overlay_window (Android) and live_activities (iOS) for trainer overlay 2026-05-08 22:43:39 +02:00
Jonas Bark
4c0cfdc334 chore: bump universal_ble fork to 8bffbde
Picks up the windows-side fix that catches winrt::hresult_error in
ConnectAsync, the .Completed lambdas, and the WinRT delegates so a
disconnect mid-GATT-discovery no longer triggers RoFailFastWithErrorContext.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:22:40 +02:00
Jonas Bark
8f203ec327 chore: bump universal_ble fork to 8bffbde
Picks up the windows-side fix that catches winrt::hresult_error in
ConnectAsync, the .Completed lambdas, and the WinRT delegates so a
disconnect mid-GATT-discovery no longer triggers RoFailFastWithErrorContext.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:22:40 +02:00
Jonas Bark
f150f16149 update code push 2026-04-28 11:56:26 +02:00
Jonas Bark
1beceb528d update code push 2026-04-28 11:56:26 +02:00
Jonas Bark
ff448717ff UI adjstments 2026-04-27 15:32:23 +02:00
Jonas Bark
1e025731a9 UI adjstments 2026-04-27 15:32:23 +02:00
Jonas Bark
1f652d7565 fill prop_public 2026-04-26 11:02:23 +02:00
Jonas Bark
8167f16ee9 fill prop_public 2026-04-26 11:02:23 +02:00
Jonas Bark
278ec97e13 use proper visuals for controllers 2026-04-25 10:39:22 +02:00
Jonas Bark
1a9559d67d use proper visuals for controllers 2026-04-25 10:39:22 +02:00
Jonas Bark
76b6a03cc7 feat(workout): WorkoutRecorder with idle/recording/paused state machine
Implements WorkoutRecorder with start/pause/resume/stop transitions, 1 Hz
sampling loop via configurable tick timer, active duration tracking that
excludes pause time, and WorkoutResult with summary. Wires recorder into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
838e97cdcf feat(workout): WorkoutRecorder with idle/recording/paused state machine
Implements WorkoutRecorder with start/pause/resume/stop transitions, 1 Hz
sampling loop via configurable tick timer, active duration tracking that
excludes pause time, and WorkoutResult with summary. Wires recorder into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
8b0a9898af chore(workout): add fit_tool + share_plus deps and i18n strings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:43 +02:00
Jonas Bark
7c3092c2c9 chore(workout): add fit_tool + share_plus deps and i18n strings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:43 +02:00
Jonas Bark
ccbb9abc2c fix hint 2026-04-12 12:56:55 +02:00
Jonas Bark
249cb57044 fix hint 2026-04-12 12:56:55 +02:00
Jonas Bark
e70a7bcf6c improve gamepad support (should fix https://github.com/OpenBikeControl/bikecontrol/issues/343 ) 2026-04-12 12:43:24 +02:00
Jonas Bark
8b6be82183 improve gamepad support (should fix https://github.com/OpenBikeControl/bikecontrol/issues/343 ) 2026-04-12 12:43:24 +02:00
Jonas Bark
1693ba4fed downgrade path_provider_foundation to potentially fix crash issue
https://www.facebook.com/groups/1892836898778912/posts/1977263700336231/?comment_id=1981595913236343&notif_id=1774027006680009&notif_t=group_comment
2026-03-20 18:24:39 +01:00
Jonas Bark
655c01ad85 downgrade path_provider_foundation to potentially fix crash issue
https://www.facebook.com/groups/1892836898778912/posts/1977263700336231/?comment_id=1981595913236343&notif_id=1774027006680009&notif_t=group_comment
2026-03-20 18:24:39 +01:00
Jonas Bark
6435be973f new ui #19 2026-03-12 10:11:17 +01:00
Jonas Bark
788c8bef06 new ui #19 2026-03-12 10:11:17 +01:00
Jonas Bark
00b83c1422 translations #1 2026-03-06 09:59:18 +01:00
Jonas Bark
d75f58a636 translations #1 2026-03-06 09:59:18 +01:00
Jonas Bark
3ae45e6fbb scripting #1 2026-03-02 20:16:40 +01:00