Commit Graph

83 Commits

Author SHA1 Message Date
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
c68ef13971 feat(6.2): make Record Screen a Pro-only action (proGuard + editor badge) 2026-06-24 20:28:38 +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
952f866b9f show default OBP actions 2026-05-11 20:53:25 +02:00
Jonas Bark
d19eea9eb4 feat: treat dFly channel actions as active when Di2 BLE is enabled 2026-04-28 19:23:05 +02:00
Jonas Bark
5e4093107a 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
864e1a7e72 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
b6442d6937 ui adjustments, DRY fixes 2026-04-24 14:13:05 +02:00
Jonas Bark
d48808827b 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
aace7d7a4b new ui #20 2026-03-12 08:51:21 +01:00
Jonas Bark
97318ffa1c new ui #1 2026-03-10 12:35:36 +01:00
Jonas Bark
ada54e05eb create screenshot on Windows + macOS 2026-02-25 20:57:12 +01:00
Jonas Bark
7fb06a1e22 individual actions for single, double, long press 2026-02-25 11:20:18 +01:00
Jonas Bark
b67f104ce0 enable shortcuts on iOS as well 2026-02-24 10:56:23 +01:00
Jonas Bark
d3f64d3f1d Windows: run any command 2026-02-23 09:07:45 +01:00
Jonas Bark
a20390e78d macOS: open specific shortcut 2026-02-22 18:40:58 +01:00
Jonas Bark
2e3b1db9e3 Android: support opening assistant 2026-02-22 18:09:21 +01:00
Jonas Bark
49f8fd52d8 kickr headwind adjustments #11 2026-02-10 09:11:39 +01:00
Jonas Bark
b3a9829910 add new remote keyboard connection method 2026-02-05 17:22:21 +01:00
Jonas Bark
009fdb1019 bug fixes around keymap 2026-02-03 09:40:57 +01:00
Jonas Bark
61dcc497aa move predefined actions for keymap 2026-02-01 10:50:35 +01:00
Jonas Bark
2b7343ee9b fix action assignment 2026-01-30 17:46:58 +01:00
Jonas Bark
565d14c3c0 group buttons by device, add new unlock mechanism 2026-01-23 15:27:32 +01:00
copilot-swe-agent[bot]
b43287075b chore: update progress checklist
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-19 09:26:30 +00:00
copilot-swe-agent[bot]
a3776c9d23 feat: per-device cycplus mapping
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-19 09:23:06 +00:00
Jonas Bark
060b883872 PR feedback 2026-01-17 14:46:22 +01:00
Jonas Bark
13bd08d909 Android: simulate additional actions for local connection method (Left, Down, Right, Up, Down, Select, Back, Home, Recent Apps), allowing you to navigate in the trainer app, if supported 2026-01-17 13:52:27 +01:00
copilot-swe-agent[bot]
607fd7c77a Add Android global actions support
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-17 12:06:48 +00:00
Jonas Bark
31b6fba94d fix implementation 2026-01-12 18:42:54 +01:00
Jonas Bark
4707f0d4fc fix media key icons 2025-12-30 14:12:55 +01:00
Jonas Bark
59db7499a8 update changelog 2025-12-20 10:30:32 +01:00
Jonas Bark
2f2a5ec0db sram fix 2025-12-19 21:06:13 +01:00
Jonas Bark
af9e6f2a65 press longer for the simulator, enable long press for devices not supporting long press (e.g. Shimano Di2) 2025-12-19 11:38:30 +01:00
Jonas Bark
86b1ac1e23 press longer for the simulator, enable long press for devices not supporting long press (e.g. Shimano Di2) 2025-12-19 11:33:13 +01:00
Jonas Bark
de31f84e37 bugfix and animation 2025-12-18 09:26:25 +01:00
Jonas Bark
25f7713bba improve keymap UI 2025-12-17 14:34:08 +01:00
Jonas Bark
52062c2a59 only show supported actions 2025-12-15 13:47:43 +01:00
Jonas Bark
b568aad199 prefill obp keymap actions 2025-12-15 13:42:54 +01:00
Jonas Bark
2528342a7b remove remains of swift_control 2025-12-14 16:22:07 +01:00
Jonas Bark
02d21a01b8 ui adjustments, fixes 2025-12-06 10:02:56 +01:00
Jonas Bark
e00c297480 ui, fixes 2025-12-04 20:27:53 +00:00
Jonas Bark
58998bb61b ui, fixes 2025-12-04 19:32:02 +00:00
Jonas Bark
565bc18b48 ui adjustments 2025-12-01 22:58:29 +00:00
Jonas Bark
c4184a5bed screenshot adjustments 2025-12-01 18:14:16 +00:00
Jonas Bark
5bf82b9d3d auto start connection methods and scanning 2025-12-01 09:30:21 +00:00
Jonas Bark
92a219cf4a openbikeprotocol Bluetooth emulator 2025-11-29 17:10:23 +00:00
Jonas Bark
8a60c589db less god objects 2025-11-29 13:12:09 +00:00