Commit Graph

277 Commits

Author SHA1 Message Date
Jonas Bark
1d1a0dbf72 feat(click v2): keep the right puck awake, and say when it can't
The right puck switches itself off after a minute of not being used.
BikeControl now prevents that on its own, with no button to press. The
sequence lives in prop; this side supplies what only it knows and shows
the rider the one case they can fix.

- the gate reads raw adverts, not the device list: the sibling only has
  to be nearby, and a left puck the rider ignored — every left puck in
  right-side-only mode — still counts. Discovery is also the retrigger,
  since an ignored puck never completes a handshake
- an optional step on the controller card, and a note on the right puck's
  own card, when no left puck is in range. An offer, never a blocker
- drops the D-pad line from "use the right side only"

Fixes a related bug: the controller link counted every undone step,
optional or not, so an optional offer alone turned a working controller
amber and held back "Ready to ride". The other two links already
excluded optional steps.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 14:55:15 +02:00
Jonas Bark
1a3fea5fa6 fix instructions 2026-08-16 14:35:27 +02:00
Jonas Bark
947bfdb389 fix: stop() leaves the gamepad search timer running, and leaks one per rescan
performScanning() arms a periodic 3s gamepad poll; stop() cancelled the BLE
scan and the wifi trainer scanner but not that. Worse, stop() clears
isScanning, so the next performScanning() sails past its early-return guard
and assigns a second periodic timer over the top of the first — one leaked
per stop/rescan cycle, and restoreLeftSides plus both Click V2 unlock-mode
choices all do exactly that.

Cancel it in stop(), symmetric with the method that arms it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 08:54:23 +02:00
Jonas Bark
24f5da596d fix(home): device-testing fixes, and drop the VS takeover dialog
Four things found riding the real app.

The offline note claimed "your changes apply the next time it connects",
which is simply untrue — button mappings live in the keymap, not on the
device, so nothing is queued up waiting for a reconnect. It now says what
is actually true: you can still change what its buttons do.

A smart trainer that had only just been discovered announced itself as
"Wahoo KICKR lost connection". That was mine, and the cause is worth
recording: _handleConnectionQueue calls _connect() on every queued device,
but ProxyDevice.connect() deliberately no-ops unless the rider has asked
for that trainer. Recording "connected this session" right after connect()
returned therefore marked a trainer that never connected as having
connected — and the chain then read the disconnected state as a break.
Recording now hangs off the actual connection signal, and a new
DevicePresence.discovered ("in range, never connected") maps to a grey
"Not connected" that, being optional, doesn't stop the rider being ready.
A trainer that genuinely drops is still red.

"More options" had picked up two things that don't belong in a settings
drawer: a scanner running a permanent searching animation, implying work
the app wasn't doing on anyone's behalf, and a Close row on desktop, where
SystemNavigator.pop() does nothing useful and the window's own close
button is the way out. Pairing lives in the controller card's setup sheet,
which is where the scanner already was.

The virtual-shifting takeover dialog is gone entirely — the widget, the
shouldAutoConnect gate, the settings accessors and the onboarding call
site. Tapping Connect once is the whole consent story. Two tests asserted
the old gate; one is rewritten around intent alone being sufficient, and
the widget test for the dialog's presence is dropped rather than inverted,
because showSmartTrainerConsentDialog no longer exists and bringing the
gate back could not compile.

Also removes twelve imports in overview.dart left orphaned by the chain
refactor. Verified against the untouched 6.4 baseline: analyze reports no
errors, and the suite's failures are unchanged pre-existing golden drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 12:02:24 +02:00
Jonas Bark
0c91cc7465 feat(home): setup-chain model and remembered devices
The home screen is being rebuilt as the setup chain: one card per link,
each carrying the same status light and the same tick-off checklist. This
lands the parts that decide *what* the screen says, ahead of the widgets
that draw it.

chain_state.dart is pure data with no Flutter, no BLE and no `core`, and
steps carry ids rather than sentences, so "which step is done or pending"
is unit-testable without a locale or a radio. chain_builder.dart turns a
plain ChainInputs snapshot into cards; deriveBanner reads the cards back,
so the banner can never contradict what is under it.

Remembered devices fix a real gap: a controller that is switched off or
out of range disappeared from the app entirely, so riders could not see
what they owned or edit a mapping away from the bike. We now store the
advertisement a device connected with — exactly the fields
BluetoothDevice.fromScanResult reads — and rebuild it into a real device
object of the right subclass, kept out of the connect queue. Trainers are
remembered as data only, since their card needs a name, not a contour.

Tracking which ids connected this session is what separates a red "lost
connection" from an amber "out of range"; a fresh launch with the
controller in a drawer must not paint the screen red.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 10:38:19 +02:00
Jonas Bark
ff8d393046 fix(click-v2): apply pre-merge review fixes to onboarding flow
Fixes five review findings on the Click V2 onboarding branch:

1. "Set up again" now performs the same ClickLogic side effects
   (setupHandshake / resetTimer) the connect-time flow does for an
   already-connected left side, and refreshes UnlockToggle's state on
   return instead of leaving it stale.
2. ClickV2OnboardingCard gained an onCompleted callback (wired to
   DevicePage.onUpdate) so the device list refreshes even when no
   connectionStream event fires after the onboarding page closes.
3. A connect failure in ClickV2Onboarding._connectPending() now also
   surfaces a user-visible AlertNotification, not just a logged error.
   New l10n key clickV2Onboarding_connectFailed added in all six
   languages.
4. ClickV2OnboardingPage now builds its staggered-entrance
   CurvedAnimations once in initState instead of one per row per
   build, fixing an unbounded status-listener leak on _rows.
5. pendingDevices is intentionally left ungated on isPending (gating
   it would break _connectPending, which needs it precisely because
   isPending already flipped false) but is now correctly documented,
   and _connectPending skips devices the battery saver suppressed via
   the new Connection.isAutoReconnectSuppressed.

Also drops the redundant flutter/widgets.dart import from
click_v2_onboarding.dart (shadcn_flutter re-exports PageView/
PageController).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GcRAUvS3gwjmfi2qJipcc
2026-08-03 18:14:06 +02:00
Jonas Bark
8634db7dbc refactor(bluetooth): lift shouldAutoConnect onto BaseDevice 2026-08-03 09:15:13 +02:00
Jonas Bark
7f93ad043f feat: data-informed probe candidates, full byte transcript, quiet probe churn
From the +20 field log the pod replied 04 38 0f 4b to 04 11 15 and
09 01 00 00 to 01 (on 6e400003); add both as candidates (7 frames now).
Log every inbound frame and every outbound write verbatim while probing
(WHEELTOP PROBE rx/tx <slot> <hex>) so the support log is a full
transcript, not just unparseable frames. Suppress the connect-failure
give-up guidance while the experiment runs — the 147-timeout reconnect
churn is expected and is NOT rear-derailleur contention (fixed the
misleading 'claimed by the derailleur' alert the user saw with the RD
off).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 19:50:58 +02:00
Jonas Bark
08d31ede0c feat: auto-arm WHEELTOP keepalive probe; quiet quick-drop loop when off
The probe was only reachable via a device-page toggle, but TX pods drop
so fast the user can never open the page — the one field tester couldn't
enable it. Arm the probe automatically on the first 0x10 status frame
(the moment that proves a pod needs the reply), default on; the toggle
becomes an opt-out. Move probe creation out of handleServices into a
lazy arm on that frame.

When the experiment is off, count a connect that dies within
quickDropThreshold (5s) as a failure via the same backoff, so the
endless connect/connected/disconnected loop gives up after 3 and shows
the guidance instead of spamming forever. While the experiment is on the
device opts out (keepsReconnectingWhileDropping) so the loop keeps
cycling for the probe. Extract _engageBackoff shared by both paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 13:25:54 +02:00
Jonas Bark
0cd08ab2a9 fix: silence backoff rounds, cancel cooldown timers, pin alert-once guarantee
Once a Wheeltop shifter gives up (backoff), each 90s cooldown round was
still emitting a "Connecting to:" toast and a "...disconnected" WARNING +
OS notification, defeating the "one clear alert, then quiet" goal. Add
Connection._isInBackoff and gate both the auto-connect queue's notify
toast and the connection-state listener's disconnected toast/OS
notification on it.

The cooldown timer scheduled by _recordConnectFailure was anonymous and
shared _suppressedAutoReconnect with the battery saver, so a stale timer
from an earlier round could lift a later (even unrelated) suppression
early. Track timers per device id, cancel-and-replace on each new round,
cancel on Retry, and cancel all on disconnectAll().

Also correct a comment in _connect's catch block that described only the
fake platform's failure ordering (throw before the disconnected event) —
real Android delivers the event before or after the exception depending
on the device, and both orderings depend on _connectionSubscriptions
staying attached.

Extend the "successful connect resets the failure counter" integration
test to also cover Retry clearing the counter and the give-up alert
firing only once per session across a second suppression round.
Post-threshold rounds no longer toast, so tests now count attempts via a
new FakePeripheral.connectAttempts platform-level counter where needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 17:32:22 +02:00
Jonas Bark
2b01f2f04d feat: stop auto-connect spam after repeated Wheeltop connect failures
Adds per-device consecutive-failure tracking, suppression with a cooldown,
and a one-shot guidance alert (log-only on later rounds) when a device's
maxAutoConnectAttempts is exhausted. Also fixes Connection._connect's
failure path: it was cancelling the per-device connectionStream
subscription synchronously on a failed connect, before the platform's
disconnected event (delivered a radio-roundtrip later) could reach it —
silently breaking the rediscovery-driven retry loop for any failed first
connect, not just backoff-tracked devices.
2026-07-12 16:58:32 +02:00
Jonas Bark
e310adbceb Merge branch '6.2' into 6.3
Brings SRAM AXS shifter support, beta-access/Shorebird track, and the
battery-saver timeout fix into 6.3. Merged the prop submodule (83f4bf9) so the
SRAM parser/button-tables and the Climb protocol coexist. Resolved: CHANGELOG
(SRAM AXS folded into 6.3.0), the prop pointer, and repointed the SRAM
integration test to the fake-BLE harness that 6.3 promoted into lib/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 12:04:00 +02:00
Jonas Bark
df1cebd326 fix(sram): exclude non-button components from pre-registration; stabilize names
sramShifterAdverts now gates on effectiveType (no model escape hatch), so a
front derailleur or dropper post no longer mints a phantom paddle button.
Persist each shifter's advertised type/model by serial so a button's §6.4 name
survives sessions where the shifter isn't advertising, instead of orphaning the
keymap mapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 17:34:52 +02:00
Jonas Bark
821ba2d0fe feat(sram): connect only to the rear derailleur; name buttons per shifter type
Filter scan results to the RD (device-type record in the 0xFE51 advertising
service data, §2), so we no longer create a controller for bare shifters. Name
buttons from the pressing shifter's advertised type/model (§6.4 — Left/Right
Shifter, Aux Top, Bonus, ...) and pre-register nearby shifters' buttons on
connect so they appear without a press; degrade to Shifter A/B when no advert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 17:17:18 +02:00
Jonas Bark
f48f786ab8 fix(battery-saver): extend local-method inactivity timeout to 60 min
When the local connection method (Keyboard/Touch/Media) is the only one
active, the battery saver disconnected idle controllers after 30 minutes
of no button activity. Riders on long steady efforts (e.g. Z2) with no
shifting got dropped mid-ride. Double the local-only sliding window to
60 minutes; the network method still never times out while connected.

The disconnect alert is parameterized off timeout.inMinutes, so it now
reads "60 minutes" with no string change.

Fixes #349

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 11:41:25 +02:00
Jonas Bark
b7225bc965 fix(battery-saver): allow auto-reconnect 90s after the inactivity disconnect (#329)
The suppression that lets a controller power down was permanent, and the
controller's post-disconnect advertisement left a stale scan-dedup entry
that blocked every later advertisement from reaching addDevices — a woken
controller could not reconnect until an app restart. A cooldown timer now
lifts the suppression and purges the stale entry, so waking the controller
reconnects it automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 07:58:51 +02:00
Jonas Bark
de746a0788 feat(emulation): unregister emulated peripheral on forget
Forgetting an emulated device now tears down its fake peripheral and
clears the scan-result dedupe cache so the same profile can be
re-added later.
2026-07-02 09:58:10 +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
8bd23d7385 refactor(incline): rename Climb incline pipeline to device-agnostic Incline*
ClimbInclineSink → InclineSink, ClimbController → InclineController,
ClimbManualState → InclineManualState, ClimbMode → InclineMode.
Moves lib/bluetooth/climb/{climb_incline_sink,climb_manual_state,climb_controller}.dart
→ lib/bluetooth/incline/{incline_sink,incline_manual_state,incline_controller}.dart
and corresponding tests. Decouples InclineManualState from wahoo_climb.dart
constants (own kInclineManualMinGrade001/kInclineManualMaxGrade001, same values).
WahooKickrClimb and _ClimbRelaySink stay Climb-named; no behavior changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 23:27:58 +02:00
Jonas Bark
4a7637a815 feat(climb): ClimbController 1 Hz pipeline + Connection wiring
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:47:45 +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
4612e62778 fix(battery-saver): extend local-method inactivity timeout to 60 min
When the local connection method (Keyboard/Touch/Media) is the only one
active, the battery saver disconnected idle controllers after 30 minutes
of no button activity. Riders on long steady efforts (e.g. Z2) with no
shifting got dropped mid-ride. Double the local-only sliding window to
60 minutes; the network method still never times out while connected.

The disconnect alert is parameterized off timeout.inMinutes, so it now
reads "60 minutes" with no string change.

Fixes #349

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 09:58:26 +02:00
Jonas Bark
3eaea1932d Stop battery-saver-disconnected controllers from auto-reconnecting
The inactivity disconnector parks idle controllers with
disconnect(forget: true, persistForget: false) so they stay off the
ignore list and the user can reconnect. But controllers auto-connect
unconditionally at the addDevices() choke point, so the controller
reconnected the instant it was rediscovered (scan result /
getSystemDevices / the disconnect listener's performScanning) — right
after being parked, defeating the battery saver.

Track parked controllers in a session-scoped _suppressedAutoReconnect
set, populated before each inactivity disconnect and filtered at the
addDevices() choke point. Clear it only on explicit intent — the alert's
Reconnect action and connectDevice() — and wholesale in disconnectAll().
Clearing on every successful _connect raced: a connect still in flight
when the timeout fires resolved afterwards and wiped the fresh
suppression, so the controller looped straight back.

disconnectAll() clears the set (BT off / full reset makes it moot), and
the integration harness reset routes through it so a parked controller
can't leak into the next test and block its connect.

Tests: a parked controller is not auto-reconnected on rediscovery, and
the Reconnect action lifts the suppression and brings it back.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 16:55:36 +02:00
Jonas Bark
f29546f3c7 refactor: address review feedback on inactivity disconnect wiring 2026-06-17 19:50:08 +02:00
Jonas Bark
ad8501ac8b feat: wire activity-aware inactivity disconnect into Connection (#329)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 17:17:10 +02:00
Jonas Bark
e9e7425c29 Integration tests: controller connections + virtual shifting through fake platform seams
Add test/integration with platform fakes installed at the plugin seams
(UniversalBle.setInstance, NsdPlatformInterface.instance); everything
above them — Connection, device classification, protocol parsers, press
state machine, keymaps, ProxyDevice — is the real code:

- controller_connection_test: scan→classification (Zwift Click/Ride via
  manufacturer data, Di2 via service UUID, FTMS trainer→ProxyDevice,
  ignored names/devices), connect lifecycle (device-info reads, battery,
  RideOn handshake, subscriptions), drops, dedupe, forget list.
- controller_button_chain_test: byte-accurate BLE notifications through
  the full reaction chain — single/double/long press, trigger remapping,
  duplicate-frame dedupe, unmapped-button error surfacing, multi-button
  Ride presses.
- virtual_shifting_connection_logic_test: retrofit-mode defaults (WiFi /
  BT-wins / proxy for power meters), auto-connect consent gating,
  in-place "No connection" disconnect + in-place reconnect, WiFi trainer
  discovery rules (found/lost/connected-survives-flap, self-exclusion),
  and an end-to-end Click-press → real action pipeline → gear shift.

Protocol-level coverage (DirCon over real TCP, BLE peripheral) lives in
the prop submodule's own tests — no prop internals in this repo.

Bug fix found by these tests: Connection.disconnect(keepInList: true)
was defeated — UniversalBle.disconnect resolves only after the platform
disconnect event, so the still-attached connectionStream listener
re-entered disconnect() without keepInList and dropped the device,
orphaning the object the open details page holds (the exact bug
0db8cf0c addressed). Guarded via _inPlaceDisconnects.

Also update stale tests to current behavior: sim-mode shifts return
Ignored since e0e4494d (handled by the bridge, not forwarded, logged
neutrally), ControllerButton.initials direction arrows, and skip the
third BC2 state-machine test consistently with its siblings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 18:59:14 +02:00
Jonas Bark
0d612ce032 Re-attach connection listeners on in-place reconnect
After an in-place "No connection" disconnect, selecting Virtual Shifting
again reconnected the BLE upstream but the connect never completed:
device.isConnected stayed false and the card hung on "connecting".

The listener that flips isConnected (and drives the handshake to
completion) is created only in _connect(), which runs once via the
auto-connect queue at app start. The first manual connect reuses that
listener; disconnect cancels it (so a BLE drop doesn't fire
auto-reconnect); the second manual connect via startProxy() had no
listener and never re-ran _connect.

Route the in-place reconnect through a new Connection.connectDevice()
wrapper over _connect, re-attaching the action / connection-state
listeners — the same path the working auto-connect uses — instead of
calling ProxyDevice.startProxy() directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 14:39:10 +02:00
Jonas Bark
0db8cf0c31 Keep the device registered on in-place "No connection" disconnect
The "No connection" picker entry disconnects without leaving the details
page, but Connection.disconnect(forget: false) removed the ProxyDevice
from the registry (isResetting is false). The open page kept the now
orphaned object: rediscovery built a *new* ProxyDevice while the page
still pointed at the old one, so selecting Virtual Shifting again
reconnected a device absent from bluetoothDevices — its BLE notifications
were rejected ("Device not found") and the connection was force-dropped.

Add a keepInList flag to disconnect; the in-place "No connection" path
passes it so the same device object stays registered (and its scan
result is retained to avoid a churned duplicate) and remains
reconnectable on the same card. The Disconnect buttons, which pop the
page, keep the default removing behaviour.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 14:14:48 +02:00
Jonas Bark
60817dabee Smart Trainer card: stable keys, reconnect rebinding, awaited mDNS stop, No-connection UX
- ConnectionCard: "No connection" shows "Not connected" instead of the
  bridge connect instruction; switching modes keeps the bridge accordion
  mounted with inline progress (drops the "Connecting in ... mode"
  placeholder card).
- proxy_device_details: stable keys on ConnectionCard / LiveMetricsSection
  / MiniWorkoutCard. On (dis)connect, conditional siblings toggle both
  above (FTMS warning) and below (gear/settings/VS-notice) these widgets,
  trapping the unkeyed ones in Flutter's reconciliation middle and
  remounting them — which collapsed the accordion and rebuilt the page.
- ProxyDevice: re-establish the emulator-state bindings on every
  (re)connect (_rebindEmulatorState in startProxy). The in-place
  "No connection" disconnect detaches them on a reused ProxyDevice, so
  reconnecting Virtual Shifting left the UI stuck on "connecting" while
  the emulator was actually connected.
- ProxyDevice.disconnect/switchRetrofitMode/handleServices: await the
  emulator stops so mDNS/TCP is torn down before reporting disconnected,
  and log the previously swallowed detach errors.
- connection.dart: log the discovered device name instead of its runtime
  type.
- Bump prop for the awaited mDNS teardown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 14:06:12 +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
95c717e58d feat: surface mDNS-discovered DirCon trainers in Connection.proxyDevices
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 07:10:40 +02:00
Jonas Bark
27919882b4 Fix UX, translation 2026-06-06 20:20:29 +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
cfadaff94e adjustments 2026-05-21 12:27:37 +02:00
Jonas Bark
db3cb986cc deactivate script on invalid format detected 2026-05-19 22:12:12 +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
925e836774 i18n: translate connection alerts and scan/disconnect log strings
Replaces hard-coded English strings in lib/bluetooth/connection.dart
with AppLocalizations accessors and adds the new keys to all six ARB
locales (en, de, es, fr, it, pl).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 20:33:02 +02:00
Jonas Bark
073b8fec31 i18n: translate connection alerts and scan/disconnect log strings
Replaces hard-coded English strings in lib/bluetooth/connection.dart
with AppLocalizations accessors and adds the new keys to all six ARB
locales (en, de, es, fr, it, pl).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 20:33:02 +02:00
Jonas Bark
4cf347580d warn when connecting smart trainer 2026-05-07 15:57:02 +02:00
Jonas Bark
72d26000e1 warn when connecting smart trainer 2026-05-07 15:57:02 +02:00
Jonas Bark
9cabbf0925 Merge branch 'patchit' into feat/proxy-device-details-page
# Conflicts:
#	.github/workflows/patch.yml
2026-04-22 18:51:31 +02:00
Jonas Bark
8f6a55460f Merge branch 'patchit' into feat/proxy-device-details-page
# Conflicts:
#	.github/workflows/patch.yml
2026-04-22 18:51:31 +02:00
Jonas Bark
6a366517c7 fix potential leak, cleanup 2026-04-22 18:26:43 +02:00
Jonas Bark
5e86e86500 fix potential leak, cleanup 2026-04-22 18:26:43 +02:00
Jonas Bark
8693a71f18 Merge branch 'main' into feat/proxy-device-details-page 2026-04-21 21:07:43 +02:00
Jonas Bark
86b32ba4f7 Merge branch 'main' into feat/proxy-device-details-page 2026-04-21 21:07:43 +02:00
Jonas Bark
99b928aa6c patch it 2026-04-21 21:07:08 +02:00
Jonas Bark
0c49983070 patch it 2026-04-21 21:07:08 +02:00
Jonas Bark
624f871c5d patch it 2026-04-21 21:04:19 +02:00