Commit Graph

219 Commits

Author SHA1 Message Date
Jonas Bark
8170cd97b9 fix(trainingpeaks): direction and face buttons now reach the app
The TPV profile mapped navigationUp and the coloured face buttons to a
keyboard key / touch position only. _handleDirectConnect forwards a KeyPair
solely when it carries an inGameAction, so those presses never left the
phone — and an actionless default is worse than no default at all, because
it shadows the action the button would otherwise inherit from
ControllerButton.action via Keymap.addNewButtons (which is exactly why
navigationDown, absent from the profile, worked).

Same gap hit the HUD-toggle and difficulty defaults. Steer Left/Right are
added to defaultObpSupportedButtons as well: TPV advertises them in its
live app-info frame, but without them the button editor hid steering
before a connection.

Reported by a rider on Android with TPV on an iPad, whose log showed
"Sent Down button press" next to "No connection method active".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 12:54:00 +02:00
Jonas Bark
db751c80e8 feat(wheeltop): recognize EDS shifters from their advertisement
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:05:05 +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
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
7e1bdaa7c9 feat(phone-steering): add calibratePhoneSteering action + steering l10n 2026-06-30 10:44:45 +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
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
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
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
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
57f0b707d8 enable trainingpeaks, version++ 2026-06-06 20:31:27 +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
75dd10371a show default OBP actions 2026-05-11 20:53:25 +02:00
Jonas Bark
860a1b3523 fix trainer connection logic 2026-05-06 06:27:21 +02:00
Jonas Bark
fd870e356d adjustments 2026-04-28 20:15:38 +02:00
Jonas Bark
7f04985a67 feat: treat dFly channel actions as active when Di2 BLE is enabled 2026-04-28 19:23:05 +02:00
Jonas Bark
152ed69b16 feat: add Wahoo ELEMNT SupportedApp with di2Ble connection method 2026-04-28 18:49:03 +02:00
Jonas Bark
4766bff12f improve HID device logic 2026-04-28 18:48:32 +02:00
Jonas Bark
153c45dc3e feat: add dFlyChannel1..4 InGameActions for Wahoo ELEMNT target 2026-04-28 18:45:30 +02:00
Jonas Bark
f8fb2749ff fix: stop reconstructing IconData on keymap decode (tree-shake fix)
The IconData(...) call in KeyPair.decodeButton — added to round-trip
ControllerButton.icon through SharedPreferences — is a non-const
constructor that defeats Flutter's icon-font tree-shaker, breaking
the release build:

    This application cannot tree shake icons fonts. It has non-constant
    instances of IconData at the following locations:
      - lib/utils/keymap/keymap.dart:511:18

In practice the round-trip was redundant: known buttons in
ControllerButton.values already carry their const icon in the static
definition, so they get the same icon back via copyWith on decode
just from the matched name. Unknown buttons never had a custom icon
in the first place, so dropping the encode side too is a no-op for
saved profiles.

Encode now emits only name (+ deviceId when set); decode never
constructs an IconData. Comment in both halves explains the
constraint so this doesn't regress.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 09:25:01 +02:00
Jonas Bark
3962d4516b feat: persist ControllerButton.icon in encoded keymaps
Extends KeyPair.encode/decode to round-trip the optional ControllerButton
icon alongside the existing name + sourceDeviceId fields. Encoded as a
{codePoint, fontFamily, fontPackage} sub-map only when present, so a
button without an icon still serialises as the legacy plain-string
shape — backward compatible with profiles already saved to
SharedPreferences.

Decoding rebuilds the IconData via its codePoint + font family/package,
then applies it via copyWith on the matched ControllerButton or as a
constructor arg for unknown-button fallback. Buttons that previously
had a default icon from their static definition are preserved on
decode (the decoded value overrides only when serialised).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 08:25:08 +02:00
Jonas Bark
39ad7b8b49 feat: add Workout Pause/Resume trainer action and inline feedback prompt
Workout: Pause/Resume action is a new InGameAction in the trainer-control
group. It toggles core.workoutRecorder between recording and paused
states without requiring a connected proxy trainer (handled in
base_actions.dart before the proxy dispatch). No-op when the recorder
is idle.

Inline feedback prompt replaces the standalone "Provide Feedback"
button on the proxy device details page. It shows "Does it work?"
with a 3-cell grid (Yes / No difference / No). Yes and No navigate
to TrainerFeedbackPage with the rating pre-filled (TrainerFeedbackPage
now accepts an optional initialRating). "No difference" dismisses
the prompt for the current page session.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 16:29:07 +02:00
Jonas Bark
2071719fbd UI adjustments 2026-04-26 09:44:56 +02:00
Jonas Bark
642fc754a1 UI adjustments, BLE advertisement fix 2026-04-26 09:14:00 +02:00
Jonas Bark
b7d9fba548 compatibility changes 2026-04-25 19:23:34 +02:00
Jonas Bark
135494819d ui adjustments, DRY fixes 2026-04-24 14:13:05 +02:00
Jonas Bark
080e8a5c90 ui fixes 2026-04-24 13:42:45 +02:00
Jonas Bark
972e13ad12 feat(apps): add BikeControl as a supported trainer app 2026-04-24 13:26:31 +02:00
Jonas Bark
238fdf0df3 feat(controller): add ControllerButton.initials getter 2026-04-24 10:33:38 +02:00
Jonas Bark
924138d1aa ui adjustments 2026-04-23 12:02:18 +02:00
Jonas Bark
b6996c937b feat(trainer-actions): consolidate shift/erg into mode-aware up/down + switchMode 2026-04-23 10:18:40 +02:00
Jonas Bark
03e1727d6a feat(supported-app): add per-app trainer connection types 2026-04-23 08:52:09 +02:00
Jonas Bark
fa6a26686a Android: broadcast a custom Intent on button press - connect your controller to automation apps like MacroDroid or Tasker to turn your phone into a ringbell, trigger Shortcuts, toggle lights, and more (Pro) 2026-04-22 10:48:42 +02:00
Jonas Bark
df937d7fec feat(keymap): add virtualGearAmount on SupportedApp (MyWhoosh=30, default=24) 2026-04-20 09:14:06 +02:00
Jonas Bark
4042de95d5 feat(actions): add 6 trainer-control InGameActions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 10:37:13 +02:00
Jonas Bark
40f171e935 new openbikecontrol actions 2026-04-12 12:06:37 +02:00
Jonas Bark
7339dbb540 integrate logos 2026-04-12 11:40:43 +02:00
Jonas Bark
3b2a04003f group trainer dropdown by official support 2026-04-12 11:29:56 +02:00
Jonas Bark
8f52f0ff34 cleanup 2026-04-12 10:44:49 +02:00
Jonas Bark
37ee97e7b7 resolve https://github.com/OpenBikeControl/bikecontrol/issues/339 2026-04-12 10:18:39 +02:00
Jonas Bark
c9dd4dd485 TrainingPeaks is fully supported now 2026-04-10 16:04:06 +02:00
Jonas Bark
2a62b9107a cleanup, dircon fixes 2026-04-10 16:02:59 +02:00