- 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>
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>
A half-received or corrupt app-info write was retained forever (cleared only
on a successful parse), poisoning every later parse so OpenBikeControl never
reported "Connected to app" again until app restart. Reset the reassembler on
disconnect and cap the buffer at 512 bytes so a stuck/corrupt stream recovers
and can't leak. Adds regression tests for reset and the bound.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
Extract the OpenBikeControl app-info fragment-stitching out of the BLE
emulator's write handler into a small, behavior-preserving AppInfoReassembler
so it can be unit-tested directly (the emulator's startServer() is otherwise
only reachable through the live peripheral platform).
Adds regression tests for the multi-packet app-info write (TrainingPeaks on
macOS), including the three-fragment case the previous single prior-fragment
buffer dropped — it kept only the first failed fragment, so a message split
across three packets never reassembled.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
Extracts the recovery added for OpenBikeControl (abe636d4) into
PeripheralAdvertisingRecovery and applies it to ZwiftEmulator too.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Rouvy Zwift-BLE advertisement (Zwift fc82 + OBC 128-bit UUID + name
"BikeControl" = ~38 bytes) overflows Android's 31-byte primary packet, so
startAdvertising fails with "Data too large" — Rouvy users on 6.1 can't
connect (the bluetooth_low_energy -> universal_ble migration stopped
splitting service UUIDs into the scan response).
Bump universal_ble to the fork commit that adds
PeripheralAndroidOptions.addServicesInScanResponse, expose it through
PeripheralServer.startAdvertising, and enable it for the Rouvy branch of
the Zwift emulator. Primary packet becomes flags+name (~16B), scan
response carries the UUIDs (~22B); active scanners still see everything.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The OpenBikeControl mDNS emulator hit EADDRINUSE on its fixed port 36867
when "Connect directly over network" was toggled off then on: the
un-awaited stop() hadn't released the socket before start() rebound it.
- Bump prop submodule: ResilientTcpServer now supersedes a stale
same-port instance before binding and defaults to walking ports
(portAttempts: 5).
- OBC advertises the ACTUAL bound port via mDNS instead of a hardcoded
36867, so it can walk to a free port and stay reachable (mirrors the
DirCon emulator). Companion apps read the port from the SRV record.
- Reset isStarted on every start-failure path so a genuinely blocked
port no longer leaves the feature showing as "running".
- Pin MyWhoosh Link to portAttempts: 1 (fixed-port contract preserved).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
Intercept InGameAction.frontShift in ZwiftEmulator.sendAction and emit
the SHFT_UP_R|SHFT_UP_L combined buttonMap frame followed by the release
frame — the standard Zwift Ride gesture that triggers a front-chainring
shift in Zwift (SRAM) and a generic controller gesture in other apps.
No app-capability flag, no fallback, no toggle state.
UNVERIFIED: bitmask vs live Zwift SRAM — confirm on-device.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add frontShift case to handleTrainerAction: ERG mode returns Ignored,
disabled returns Ignored, sim mode toggles front ring and returns
Success with large/small ring message. Add 3 ARB keys (6 locales) and
4 TDD tests in the consolidated test file.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
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>
- Bump golden_screenshot 8.2.0 -> ^11.0.1 (drops the Yaru dependency, hence the
linux plugin-registrant change).
- screenshot_test.dart now renders each scene for 6 locales (en/de/es/fr/it/pl)
via a shoot() helper, writing screenshots/<locale>/<scene>-<device>.png.
Marketing titles are translated per locale (de/es/fr/it/pl are drafts).
- main.dart: screenshotLocale global drives the app locale in screenshot mode
(was hardcoded to English).
- v11 only loads fonts found in the rendered tree, so loadAssets() runs after
the first pump.
- Virtual Shifting scene shows the gear UI instead of the "trainer doesn't
advertise FTMS" warning: added ProxyDevice.debugAttachFitnessBike (test seam,
no server side-effects) and hide the MyWhoosh gearing hint in screenshot mode.
- prepare_store_screenshots.sh maps each store locale from its language folder
(de-DE <- screenshots/de, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The "use the right side only" button remapped the active keymap (+ shifts up,
B shifts down) in memory, but the change was lost on the next launch when the
active profile was a built-in app: those keymaps are code-defined templates
rebuilt on startup, and Settings.setKeyMap only persists key pairs for custom
profiles.
Mirror the button editor: if the active profile isn't already a custom one,
fork it into a "<App> (Copy)" custom profile (via KeymapManager.duplicateSync)
before applying the remap, then persist. The remap now runs before the left
side is disconnected so the forked copy keeps every connected controller's
existing mappings. Adds a regression test covering both the built-in-fork and
already-custom paths, including a reload from storage.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Move the new-unlock-method toggle from showAdditionalInformation (rendered on
both the compact overview card and the detail page) into buildPreferences,
which the controller detail page renders under "Preferences". The toggle now
appears only when the controller entry is opened, not on the overview card.
The Click V2 left side inherits this from ZwiftClickV2; the right side gets its
own override. Unlock-status warnings and the "use right side only" prompt are
unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- 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>
The "connected"/"disconnected" activity alerts fired when a trainer app
attaches to one of our emulators now name the app ("Connected to Zwift",
"Disconnected from Zwift") and tag the alert with the transport, so the
activity log shows a WiFi or Bluetooth icon depending on how the app is
connected instead of always Bluetooth.
- AlertNotification gains a connectionType field + a connection() factory
that builds the localized, app-named message and tags the transport.
- All 6 emulator call sites (Zwift BLE, FTMS/Rouvy mDNS) route through it,
passing their own type and core.settings.getTrainerApp()?.name.
- ConnectionMethodType.activityIcon maps network -> wifi, else -> bluetooth;
overview threads connectionType through and uses it for the leading icon.
- Reuse existing connectedTo string; add disconnectedFrom (en/de/es/fr/it/pl).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Zwift and Rouvy drop a wired LAN controller after ~30s without traffic. The Ftms/Rouvy mDNS emulators only emit on a button press, so an idle rider (pedalling, not shifting) goes silent and gets disconnected.
Add a ControllerKeepAlive timer that re-emits the neutral "released" controller frame every 5s while a client is connected, started/stopped from each emulator's isConnected listener. It's the same frame a key-up sends, so it resets the peer's inactivity watchdog without registering a phantom press.
Also drops an earlier keepalive attempt from OpenBikeControlMdnsEmulator — that path speaks the OpenBikeControl protocol, which Zwift doesn't use.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces 'first non-loopback IPv4', which on Android advertised the
phone-internal CLAT dummy address (192.0.0.8) when the 464XLAT
interface enumerated before wlan0.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Switch the OBC/DirCon advertisement to prop's ServiceAdvertiser seam and
select the in-process responder backend on macOS/Windows/Linux at app
startup. The advertisement now carries a dedicated hostname with a
single A record, so Mono-based trainer apps (TrainingPeaks) no longer
pick a scope-less IPv6 link-local and fail with 'No route to host'.
iOS/Android keep the OS responder via nsd.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both had the fragile accept-loop copy: no teardown identity check (a
reconnecting app's old socket killed the new session), no onError
(abrupt resets became uncaught async errors), shared: true (a second
app instance silently stole connections). They keep their fixed
protocol ports (36867 / 21587) — no port fallback; a blocked port now
fails loudly instead of misbehaving.
Bumps prop with the shared ResilientTcpServer, its tests, and the
in-flight custom mDNS responder work.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>