Commit Graph

127 Commits

Author SHA1 Message Date
Jonas Bark
ff9671bfc5 fix: no crash on button press when no keymap is set
The keymap ('app') and the trainer app ('trainer_app') are independent
prefs. When the keymap one is missing while a trainer app is selected,
actionHandler.supportedApp stays null — every button press then threw
"Null check operator used on a null value" and the device registered no
buttons at all, so the SRAM edit screen came up empty.

- RemoteActions/DesktopActions/AndroidActions no longer dereference
  supportedApp (or getKeyPair) with `!`; they return the same
  noKeymapSet / noActionAssigned Error BaseActions already produces.
- Fall back to the selected trainer app when the keymap pref can't be
  resolved (initializeActions, Settings.init, deleteCustomAppProfile).
- BaseDevice.getOrAddButton keeps the created button in availableButtons
  even without a keymap, so the device still renders its buttons.
- The OBC BLE/mDNS emulators evaluated connectedApp.value! before the
  null guard that follows, making the guard dead code — reordered.
- handleButtonsClicked now forwards through recordError, which is why
  this never showed up in crash reporting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 13:14:09 +02:00
Jonas Bark
d985e6d2b5 feat(accessory): name the actions an accessory obeys, and where to assign them
An accessory's settings page had nothing to say about what the device can
actually do: its actions live on a controller's buttons, and the page that
would have shown them (button mapping) is hidden here because a fan has no
buttons of its own.

It now lists them — the six Headwind speed/HR actions, the four incline
ones — straight off the device via a new BaseDevice.assignableActions, and
hands over to the controller that can carry them: the connected one, since
that is the one a rider can test a mapping on right away. With no
controller around it says so rather than offering a dead link.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 16:23:28 +02:00
Jonas Bark
56a8e87f7d i18n(home): translate the setup chain, align its checklist, stop billing
undelivered shifts

Three things.

The chain's 68 strings existed only in English, so five locales fell back
to it on the app's main screen. Now translated, in each file's own register
— informal second person throughout, matching the copy already around
them. Polish needed a `few` plural category for the step and day counters:
it uses a distinct form for 2-4, so `other` would have rendered "Zostały 2
kroków" instead of "kroki". Two keys written speculatively and never wired
up are dropped rather than sent to five translators.

The checklist's summary row sat inside a Button whose own padding inset it
past the steps below, and the leading glyphs differed in both width (15px
icon, 17px tick) and gap, so matching the outer inset alone would not have
lined them up. One _rowInset / _leadingSize / _leadingGap now governs both,
with the glyphs centred in a box of equal width. Two tests pin the tick and
the label columns, because this is exactly what drifts back unnoticed.

Finally, shifting with a trainer connected but no app holding the bridge
was charged to the daily command budget. Those shifts reach nothing. The
existing exemption only covered the case where the 20-minute
virtual-shifting budget was already ticking — that avoids double-billing —
so it grows a second reason: a command that was never delivered anywhere is
not a command the rider spent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 14:39:07 +02:00
Jonas Bark
8634db7dbc refactor(bluetooth): lift shouldAutoConnect onto BaseDevice 2026-08-03 09:15:13 +02:00
Jonas Bark
2954deb1f2 test: full connection-card goldens (with action badges) for 8 controllers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 18:14:08 +02:00
Jonas Bark
1549c4c73c feat(proxy): show transport icon to disambiguate same-named trainers
When the same trainer is discovered over both WiFi (DirCon) and Bluetooth,
two proxy entries appear with an identical name (both already Beta). Add a
small WiFi/Bluetooth icon left of the Beta pill, shown only when a same-named
sibling exists, so the duplicates can be told apart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 09:39:38 +02:00
Jonas Bark
7c9ee4f747 feat: same-frame both-shifters combo → frontShift (Ride/Click)
Detect when a single BLE frame carries both the shiftUp-mapped and
shiftDown-mapped buttons (Zwift Ride / Click single-device controllers)
and emit a single frontShift, suppressing the two rear shifts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 16:43:33 +02:00
Jonas Bark
27919882b4 Fix UX, translation 2026-06-06 20:20:29 +02:00
Jonas Bark
a68b68a1b4 fix button mapping popup 2026-06-01 11:53:55 +02:00
Jonas Bark
60ba3121c6 animations 2026-05-25 20:13:08 +02:00
Jonas Bark
43cf9482bd UI fixes 2026-04-28 08:39:48 +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
03dfde8189 UI adjustments 2026-04-25 22:58:22 +02:00
Jonas Bark
edf6af55f7 UI improvements 2026-04-25 22:36:25 +02:00
Jonas Bark
79acae8271 refactor: render BaseDevice connection state via StatusIcon
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 20:50:51 +02:00
Jonas Bark
32c9021756 feat(controller): ControllerLayout + contour painter + BaseDevice.controllerLayout hook 2026-04-24 10:52:57 +02:00
Jonas Bark
f19a244618 Add guarded long-press repeat for Pro users
- Make implicit repeat single-click behavior Pro-only and single-button only
- Prevent overlapping repeat actions and add coverage for repeat cleanup
- Update close action to shut down gracefully
2026-04-07 08:11:07 +02:00
Jonas Bark
284a0ad0f0 Long press now repeats the single click action by default, useful for continuous gear shifting or volume adjustments 2026-04-04 20:43:29 +02:00
Jonas Bark
38597c1ae7 fix UI issue 2026-03-22 10:36:56 +01:00
Jonas Bark
40769d4577 new ui #18 2026-03-12 07:38:20 +01:00
Jonas Bark
054414b019 new ui #11 2026-03-11 16:52:19 +01:00
Jonas Bark
0ed0eee8d5 new ui #10 2026-03-11 15:13:00 +01:00
Jonas Bark
b2836dda9b new ui #9 2026-03-11 13:34:07 +01:00
Jonas Bark
3a67d55495 new ui #7 2026-03-11 12:09:21 +01:00
Jonas Bark
d9b389198b FIX: events are swallowed on some devices, UI fix 2026-03-11 11:04:17 +01:00
Jonas Bark
a3518d8b86 new ui #6 2026-03-10 21:11:13 +01:00
Jonas Bark
8c5d9d579c new ui #3 2026-03-10 15:51:19 +01:00
Jonas Bark
74ee11d98c new ui #1 2026-03-10 12:35:36 +01:00
Jonas Bark
a365df9a86 do not delay long press when keymap doesn't have single or double click 2026-03-05 10:44:46 +01:00
Jonas Bark
fba1b82b07 add long press option for devices that do not support it (tap once = down, tap again = up) 2026-02-25 18:43:00 +01:00
Jonas Bark
f4b9a349d0 individual actions for single, double, long press 2026-02-25 11:20:18 +01:00
Jonas Bark
0e6ca6ee97 supports long press for base device as field 2026-02-25 09:47:52 +01:00
Jonas Bark
052850b9f2 cleanup 2026-02-15 10:11:43 +01:00
copilot-swe-agent[bot]
c0f52b9057 Add clarifying comments for two-call pattern in handleButtonsClickedWithoutLongPressSupport
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-02-14 07:51:10 +00:00
copilot-swe-agent[bot]
7ed904c03e Fix VS200 double shifting by handling non-long-press buttons correctly
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-02-14 07:49:25 +00:00
Jonas Bark
acff977c71 bug fixes around keymap 2026-02-03 09:40:57 +01:00
Jonas Bark
ce995440e3 show a message in configuration when no buttons available for a device 2026-02-01 10:00:43 +01:00
Jonas Bark
8997b54a9a group buttons by device, add new unlock mechanism 2026-01-23 15:27:32 +01:00
Jonas Bark
cc691c0102 show side identifier for Zwift Play 2026-01-21 13:06:26 +01:00
Jonas Bark
1d57c18dd9 onboarding for new users 2025-12-31 15:52:30 +01:00
Jonas Bark
39cb6e0264 implement logic 2025-12-26 19:36:20 +01:00
Jonas Bark
d28d8515f3 bugfixes and clarifications 2025-12-20 10:01:37 +01:00
Jonas Bark
5c219153d7 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
05d1588a76 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
57ce58448e translations and ux changes 2025-12-17 11:39:39 +01:00
Jonas Bark
6bc6d21559 show connection update notifications 2025-12-17 10:34:40 +01:00
Jonas Bark
95d79b5d7f notifications on iOS 2025-12-17 10:20:36 +01:00
Jonas Bark
ae4008d4de limit to 80 on Android during trial period, only count sent out commands 2025-12-17 10:02:32 +01:00
Jonas Bark
a035237e54 Merge branch 'main' into copilot/implement-in-app-purchase
# Conflicts:
#	CHANGELOG.md
#	lib/bluetooth/devices/base_device.dart
#	pubspec.yaml
2025-12-17 08:41:47 +01:00