Commit Graph

1218 Commits

Author SHA1 Message Date
Jonas Bark
c95eb147c3 feat(emulation): EmulationManager, profiles model, Click/Ride profiles, debug platform install
Adds the EmulationProfile/EmulatedInput model, EmulationManager +
EmulationSession, removePeripheral on the fake BLE platform, the first two
device profiles (Zwift Click + Ride) with an allEmulationProfiles registry,
core.emulation, and the debug-only RoutingBlePlatform install in main().
2026-07-02 09:45:12 +02:00
Jonas Bark
c648705949 feat(core): showLocalKeyboardCard/showLocalTouchCard visibility getters
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRVXtrmcgtKKz46AVDyqQp
2026-07-02 08:51:00 +02:00
Jonas Bark
fc83374306 refactor(incline): drive dispatch/sink-selection/UI off any incline device
- connection.dart: add inclineDevices getter (ManualInclineDevice) and
  generalize sinkProvider to pick any connected InclineSink, not just
  WahooKickrClimb; relay fallback unchanged
- base_actions.dart: dispatch incline actions to inclineDevices, not
  climbAccessories; error message now says "No incline device connected"
- button_edit.dart: gate incline card on inclineDevices, title uses
  inclineActions l10n key (generic "Incline")
- keymap.dart: hasActiveAction incline clause gates on inclineDevices
- incline_controller.dart: reset _lastWritten on manual hold so returning
  to auto re-asserts the grade even when grade equals last auto-written value
- incline_controller_test.dart: add re-asserts-after-manual-hold test

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 23:40:41 +02:00
Jonas Bark
1b10dee7f1 refactor(incline): generic incline in-game actions + labels
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 23:34:57 +02:00
Jonas Bark
7e03a96741 feat(climb): surface Climb actions in the keymap editor
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:49:53 +02:00
Jonas Bark
8d99bf418b feat(climb): register KICKR Climb, generalize accessory exclusion, dispatch actions
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:28:50 +02:00
Jonas Bark
199d6d2be2 feat(climb): Climb in-game actions + localizations
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:04:15 +02:00
Jonas Bark
b1fff33480 feat(phone-steering): dispatch calibratePhoneSteering action to recalibrate device
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 10:48:13 +02:00
Jonas Bark
7e1bdaa7c9 feat(phone-steering): add calibratePhoneSteering action + steering l10n 2026-06-30 10:44:45 +02:00
Jonas Bark
50d9eea27d feat(iap): exempt internal trainer commands from daily limit during free testing
When the active FitnessBikeDefinition handles a trainer action internally
(gear shift, front shift, mode switch, intensity), don't count it against
the daily command limit for a free tester whose bridge session is still
counting down — no Pro on this device, no full version, and the 20-minute
budget not yet exhausted. All other counting paths are unchanged.

The increment now runs after handleTrainerAction so the decision can key
off whether the FBD actually handled the action. Gating lives in the pure,
testable BaseActions.isExemptInternalTrainerAction and is applied in both
the performAction trainer branch and the both-shifters combo path. Bumps
the prop submodule to its 6.3 branch for the new isCountingDown getter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRVXtrmcgtKKz46AVDyqQp
2026-06-30 10:17:02 +02:00
Jonas Bark
08914aff7e feat(config): link to each trainer app's official site from the chooser
The trainer-app picker now shows an external-link button next to every app
that has an official site, opening it in the browser. Adds an officialUrl to
SupportedApp with per-app overrides (Strappo, MyWhoosh, Rouvy, Zwift,
TrainingPeaks Virtual, Biketerra, BikeControl, OpenBikeControl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 12:52:23 +02:00
Jonas Bark
7e1de77bdd feat(apps): add Strappo as an officially supported trainer app
Strappo (getstrappo.com) integrates the open OpenBikeControl protocol, so it
joins the supported-apps list as an official network/BLE partner (obpMdns +
obpBle) — button events arrive over the protocol, so no keyboard keymap is
needed. Adds the SupportedApp definition, registry entry, partner logo asset,
and a registration test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 12:38:30 +02:00
Jonas Bark
ebe038e1e2 feat(help): link to the bikecontrol.app setup guide for the controller + app
Adds a "Use {controller} with {app}" link that opens the matching
bikecontrol.app/use-<controller>-with-<app>/ how-to page:
- as the first entry in the Help & Support dropdown (above Instruction
  Videos), using the connected controller + selected trainer app;
- on the controller detail page, for that controller + the selected app.

Each controller device and trainer app maps to its website slug
(SupportedApp.helpSlug + a controller lookup in help_article.dart), with a
generic "other-training-app" fallback when a combination has no dedicated
page and no entry when the controller type has none. New localized string
useControllerWithApp across all 6 languages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 20:31:23 +02:00
Jonas Bark
9116688d63 fix(shifting): apply front-derailleur settings live; bound chainrings; handle combo errors
- FrontShiftCard now applies its toggle/chainring changes to the live
  FitnessBikeDefinition (not just the persisted config), so enabling the
  virtual front derailleur takes effect immediately instead of only after a
  reconnect/mode-switch — the combo gate read the config while the action
  checked the def, so the just-enabled feature reported itself disabled.
- Bound the small-ring stepper to the large ring so small can't exceed large
  (which inverted the ratio and made the shift a no-op).
- Error-handle the fire-and-forget front-shift combo so a throw is recorded
  instead of becoming an unobserved async error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 19:58:26 +02:00
Jonas Bark
ff57b005d5 feat(shifting): show 2×N gear position when the front derailleur is active
With the virtual front derailleur on, the compact gear readout switches
from rear gear/total (14/25) to head-unit-style front×rear position
notation (small ring 1×N, large ring 2×N, e.g. 2×14) — matching how
Garmin/Wahoo display Di2/AXS gearing. With it off, it stays 14/25.

- Add tested formatGearReadout helper.
- Wire into the proxy card, debug menu, desktop second window + Android
  PiP/overlay (trainer_overlay_view), and the gear hero card (2× · 50T).
- Carry frontShiftEnabled + frontRingLarge through TrainerOverlayState
  (json, ==, hashCode, activity map) so the snapshot reaches the overlay
  and the iOS surfaces.
- iOS PiP + Live Activity: format 2×N centrally in GearSnapshot.
- Standardize the off-state readout to 14/25 across all surfaces.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 15:02:40 +02:00
Jonas Bark
c68ef13971 feat(6.2): make Record Screen a Pro-only action (proGuard + editor badge) 2026-06-24 20:28:38 +02:00
Jonas Bark
59467b5a56 refactor: remove dead supportsNativeFrontShift getter
Re-introduced by a merge; the forward path emits the both-shifters combo
regardless of app, so the capability flag is unused.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 20:27:36 +02:00
Jonas Bark
42c246799d Merge feat/screen-recording into 6.2: screen recording action (Android + macOS) + changelog 2026-06-24 20:21:47 +02:00
Jonas Bark
b60876e6dd feat(pip): opt-in on Dynamic-Island iPhones + immediate floating window on iPad
- New "Floating window (Picture-in-Picture)" overlay setting (iOS 16+). Default
  follows the per-device auto behavior (on for iPad / non-DI iPhones, off for
  Dynamic-Island iPhones); DI-iPhone users can opt in. The Live Activity keeps
  running alongside it (additive).
- iPad: start PiP immediately on activation (foreground) instead of only when
  backgrounded — there's screen room (DeviceCapabilities.prefersForegroundPip +
  scheduleForegroundStart poll).
- DeviceCapabilities.isPipCapable (any iOS 16+ PiP device) + bike_control/pip_ios
  "isCapable"; settings.getOverlayUsePip/setOverlayUsePip; show() resolves the
  preference.
- requiresLinearPlayback = true to drop the PiP skip/scrub (next/prev) controls
  (it's a live HUD; central play/pause is system chrome, harmless no-op).
- overlayUsePip + overlayUsePipSubtitle in all 6 languages; changelog updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 18:50:33 +02:00
Jonas Bark
2eb7e56219 feat(6.2): move Record Screen under Weitere Aktionen (below screenshot) + open-folder action on saved recording 2026-06-24 18:48:22 +02:00
Jonas Bark
43052a2180 feat(6.2): handle screenRecording action in base_actions 2026-06-24 16:36:10 +02:00
Jonas Bark
81f5a433a6 feat: both-shifters combo (coincidence window) + BaseActions helpers
Add frontShiftComboEnabled getter, performInGameAction synthetic dispatch,
and a coincidence-window detector to BaseActions for two-device controllers
(e.g. Zwift Play) whose shifts arrive as separate performAction calls. When
the opposite rear shift lands within 120 ms, additively emit a frontShift
(the two rear shifts cancel; the front ring toggles). Reuses the existing
trainer-action/direct-connect routing rather than extracting a dispatcher.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 16:34:41 +02:00
Jonas Bark
9185d71a92 feat(6.2): register core.screenRecording with platform backend factory 2026-06-24 16:30:54 +02:00
Jonas Bark
dd26041ccb feat(6.2): add screenRecording action enum + localized strings 2026-06-24 16:27:54 +02:00
Jonas Bark
5057d8b333 feat: supportsNativeFrontShift capability flag (Zwift=true)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 15:54:45 +02:00
Jonas Bark
6e7b0f446e feat: add frontShift in-game action + l10n
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 15:44:20 +02:00
Jonas Bark
6b49eed044 iOS: fix bluetooth permission 2026-06-19 13:24:22 +02:00
Jonas Bark
a6f409f9ea misc fixes 2026-06-18 17:48:25 +02:00
Jonas Bark
843f798537 cleanup 2026-06-18 16:30:01 +02:00
Jonas Bark
786621a11b Localize TrainerConnection titles (re-evaluate per locale)
The connection titles ("Connect using Bluetooth", "Connect directly over
Network", "Connect using MyWhoosh Link", ...) were captured once at object
construction in English, so they didn't follow the active locale. Back the
title with a builder (String Function()) and expose it via a getter so it
re-localizes — fixing the English titles in the localized store screenshots.
Updated all 10 subclasses and the fake connection in the bridge-transport test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:47:43 +02:00
Jonas Bark
91336836ee Localize keymap strings + trial banner in screenshots
- Show the Base version in screenshots (re-assert IAPManager.isPurchased in the
  shoot() helper, which core.settings.reset() had cleared — so the overview no
  longer shows "N day trial available").
- Localize previously-hardcoded strings (en source; de/es/fr/it/pl are drafts):
  - InGameAction labels (~50): title is now a localized getter backed by
    englishTitle (Steer Right, Change Camera, Tuck, ...).
  - ButtonTrigger (Single/Double Click, Long Press).
  - Button-simulator action categories (Shifting/Steering/Other).
  - The "N day trial available" banner string.
- Regenerated all localized screenshots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:43:27 +02:00
Jonas Bark
3bfe743705 feat(iap): mirror Android freemium model on iOS/macOS (80/day trial, 15/day after) 2026-06-17 20:28:37 +02:00
Jonas Bark
5426aa2c99 feat(iap): gate iOS/macOS full version on isPurchasedBuild (free from build 138) 2026-06-17 20:25:58 +02:00
Jonas Bark
5d06ffa65f feat(iap): add freeAgainFromBuild gate (isPurchasedBuild helper) + tests 2026-06-17 20:20:10 +02:00
Jonas Bark
6778c1e45b feat: optimize Zwift Click V2 left/right experience
- Make the split left/right controllers available to everyone: replace the
  isPro gate in the device factory with a "Use new unlock method" setting
  (default on); off falls back to the legacy unified ZwiftClickV2.
- Add the "Use new unlock method" toggle to all three Click V2 settings panels;
  flipping it reconnects the Click as the new/legacy representation.
- Fix the "Unlock again" button placement: on narrow side-by-side cards the
  action now drops below the status text instead of squeezing it.
- Add "Use the right side only" to the right side when a left side is connected:
  ignores the left side (reversible via Ignored Devices) and remaps the active
  keymap so + shifts up and B shifts down.
- Localize new strings (de/es/fr/it/pl; en already present) and add
  factory/settings unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-17 19:50:08 +02:00
Jonas Bark
b5c25c5b21 Clearer log message when a trainer-app action can't be delivered (issue #367)
Pressing a virtual-shifting button after the trainer app (Zwift) had
disconnected logged the misleading "Could not perform <key>: No action
assigned" — but an action *is* assigned; the trainer app just isn't
connected to receive it.

Root cause: a pure in-game action (gear shift) has no keyboard/touch
fallback, so when no trainer app accepts it the press fell through to the
platform keyboard path, which reports "no action assigned". This only
surfaced with local control enabled, because `local` counts as a
"connected" trainer connection yet its sendAction always returns
NotHandled — so isTrainerConnected() was true and the generic
"no connection method active" guard was bypassed.

Fix: detect delivery failure after _handleDirectConnect. When a
trainer-app-only keypair (KeyPair.isTrainerAppActionOnly — an in-game
action with no keyboard/touch/command/screenshot fallback, excluding
headwind/trainer-control which target a proxy/accessory) goes unhandled,
report "Could not perform <key>: <app> is not connected" instead. Such
keypairs also now skip the generic isTrainerConnected early-return so the
specific message wins consistently. Keypairs with a keyboard fallback are
untouched and still fall through to the keyboard.

Tests: KeyPair.isTrainerAppActionOnly discrimination (keyboard/touch/
command fallback and outside-trainer-app actions excluded) and an
end-to-end regression covering the exact #367 trigger (local control on).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 09:46:38 +02:00
Jonas Bark
fb84ffbcf1 Merge remote-tracking branch 'origin/6.0.0' into custom-mdns-responder
# Conflicts:
#	lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart
2026-06-11 21:56:19 +02:00
Jonas Bark
22e09bc246 Add first-run Virtual Shifting beta intro on Smart Trainer page
Show a one-time, full-screen explainer the first time the Smart Trainer
page is opened: Virtual Shifting is in beta, works with dozens of trainers
(some not perfectly yet), links to the supported-trainers list, and invites
feedback. Gated by a global 'virtual_shifting_intro_seen' pref and skipped in
screenshot mode. Reuses existing icons only. Strings added in all 6 locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 20:35:36 +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
e79edf4809 UI adjustments 2026-06-10 08:53:30 +02:00
Jonas Bark
c957817fb5 fix logic 2026-06-09 22:13:17 +02:00
Jonas Bark
57f0b707d8 enable trainingpeaks, version++ 2026-06-06 20:31:27 +02:00
Jonas Bark
8f221245cc new unlock method 2026-06-06 19:54:00 +02:00
Jonas Bark
3de50a0907 fix button mapping popup 2026-06-01 12:01:31 +02:00
Jonas Bark
a68b68a1b4 fix button mapping popup 2026-06-01 11:53:55 +02:00
Jonas Bark
bd7cb80014 feat: reload emulator advertisement when trainer app changes
- Settings.trainerAppListenable fires from setTrainerApp.
- Connection.initialize listens and restarts ftmsEmulator + each
  ProxyDevice's _proxyEmulator so the new advertisement name (e.g.
  "Zwift Hub" for Rouvy) appears on the wire without reconnect.
- ProxyDevice.restartProxyEmulator no-ops in VS mode (ftmsEmulator
  handles itself).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-31 18:33:33 +02:00
Jonas Bark
afa5777e86 fixes 2026-05-21 22:25:28 +02:00
Jonas Bark
51f2455166 rouvy mode 2026-05-21 20:34:51 +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
78294aefeb Support intake form: "Something else" category + DE wording fix
Adds a fifth top-level intake category for problems that don't fit
the trainer-app / controller / smart-trainer / account buckets — no
follow-up dropdown, the user just continues to the composer.

Also renames "Anleitung lesen" → "Beitrag lesen" in the German
recommended-help button.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 19:32:11 +02:00