- self_test_card.dart: a precheck refusal on "Run again" now clears
_engine inside the same setState. _body only renders _idle (where
_refusal is shown) when _engine is null, so a refusal raised while a
finished verdict engine was still attached rendered invisibly behind
the verdict view — the rerun CTA silently no-opped.
- settings.dart: add missing static to _selfTestKey, matching its
sibling key helpers.
- self_test_harness_test.dart: drop unused self_test_harness.dart import.
Adds a widget test: complete a run to a verdict, attach the trainer
app, tap "Run again" — the trainer-app refusal is now visible and no
new run starts.
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>
Riders keep writing in about the wrong gear number in MyWhoosh and others.
The answer has always been the gear overlay, and the one-time toast that said
so was the wrong messenger: it fired once, mid-connect, and scrolled away
before anyone read it.
Move the offer onto the trainer card, where it stays until it is acted on.
- New SetupStepId.trainerGearOverlay, last in the trainer checklist and
offered only once the bridge is up, the trainer app runs on this device
(Target.thisDevice), the platform can draw an overlay, and a Virtual
Shifting session is producing a gear to draw. Ticks off — and leaves the
card — as soon as the overlay is enabled.
- Its button reads "Enable overlay" and deep-links to the trainer detail
page's Overlay section, which owns the permission and PiP flows.
- SetupStep gains an `optional` flag so an offer stays an offer: it does not
colour the card, does not count towards the banner's steps, and never
stops "Ready to ride". Marked OPTIONAL on its own line, via the tag the
card header already wore (now a shared OptionalTag).
- Drops OverlayConnectHint, its ProxyDevice listener and the
overlay_connect_hint_shown flag. The two l10n strings it owned are reused
as the step's hint and button label in all six locales.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nearly every MyWhoosh/Rouvy bridge rider pairs the virtual trainer, then
writes support asking why the gear shown in the trainer app doesn't sync
— trainer apps can't display BikeControl's virtual gears. Surface the
canonical answer (the gear overlay) exactly once, at the moment the
question would otherwise arise: the first time a trainer app connects to
the virtual trainer while the overlay is off.
- OverlayConnectHint fires an AlertNotification (toast + activity-log
entry) whose button deep-links to the trainer detail page, scrolled to
the Overlay section (new revealOverlaySection param).
- Hooked on ProxyDevice's device-level isConnected wrapper so it
survives emulator/mode swaps; gated on an active VS session
(fitnessBike != null), overlay disabled, and a persisted one-time
flag (overlay_connect_hint_shown).
- New l10n strings in all six locales.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The first-run explainer offered "use the left side only" as the way to
avoid Zwift. That is the one puck Zwift actually locks. Picking it left
the rider on the 59-second restart loop, and — because
ZwiftClickV2RightSide.shouldAutoConnect required unlock-with-Zwift — it
also withheld the puck that needs nothing at all. Worse, with Zwift's
built-in keymap binding the right paddle to shiftUp and the left paddle
to shiftDown, the left side alone could only ever shift down. The
genuinely clean setup was reachable only by first choosing the mode it
was meant to replace, then tapping "Use the right side only" on the
right card.
So the option becomes right-side-only: no unlock ever, no restarts, and
the +/B remap the right card already applied so one puck covers both
shift directions. The cons now name the real price — no D-pad, so no
steering and no action bar.
Click V2 state is three modes now, not a boolean, and both connect gates
say so out loud. ClickLogic drives the left side's restart loop from a
single static timer that the right side's handshake cancels, so those
two can never be live together; that invariant used to be implied by one
gate and is now stated in both. Left-restart mode survives as the left
card's existing Select for riders who want the D-pad, just not as a
first-run choice.
The right card's shortcut delegates to the same policy rather than
keeping its own path, so both leave identical state: the left side held
back by the setting instead of pushed onto the ignored-devices list,
which is what lets "Set up again" undo it. Its confirmation copy moves
accordingly, and it stops offering itself once the left side is merely
listed rather than connected.
The remap sits in its own recordError guard. It needs a trainer app to
have been picked, and a mode the rider explicitly chose must not be left
half-written because an optional convenience could not run.
This also turns emulation_zwift_profiles_test's right-side case green:
it had been red since the gate landed, because e74c5920 fixed only the
isPending half of what was holding that side back.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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>
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>
TX pods drop the link after three unanswered 1 Hz status frames; the
derailleur's reply is unknown and undocumented anywhere public. When the
user opts in (device page > Preferences), each reconnect cycle writes
the next reply candidate (type-echo, ack, 3-byte XOR shapes, bare ACK —
on 6e400003 first, then other writable NUS slots) once after subscribe
and again per status frame, and logs the connection lifetime per
candidate. A lifetime past 5 s marks the likely answer; unexpected
frames are logged loudly as potential pod responses. Worst case per
attempt is the disconnect that already happens.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Testers reported both AXS shifters doing the same thing and gears only ever
increasing, with presses logged as a generic "SRAM Paddle". Root cause: both
drop-bar paddles report button mask 1, so the mask alone can't tell them apart,
and every discovered button was hardcoded to InGameAction.shiftUp.
- Use the button event's controller device_type (prop SramPress.deviceType,
field 2) to name and key buttons, so left and right become distinct keymap
entries even in a plaintext (serial-less) session — the common case in the
field. Names now resolve to "SRAM Left/Right Shifter" without needing an
advert or the sparse d9050003 serial.
- Default the LEFT paddle to shift DOWN and everything else to shift UP so the
shifters aren't identical out of the box ("one lever changes down") without
hunting through the keymap. Every button stays freely remappable.
- Persist the device_type in the button record so a restart re-registers the
same left/right name + default instead of a duplicate entry; two serial-less
paddles that differ only by side stay separate, and a legacy side-less record
upgrades in place once the side is known.
- Remember a shifter's side against its serial (preserving any known model) when
both are seen, so its other buttons resolve the same name.
- Bump the prop submodule to the field-2 decode.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H48NvkfXYm2spiiwcTQsv8
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>
setupControl captures the original config only once and never overwrites a
saved backup (a re-run reads the already-cleared device and would wipe it);
restore clears the backup so a later setup re-captures. Both flows verify the
session key via ensureBonded and persist any re-bond.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each physical (shifter, button) now emits one press so the base device
handles single/double click from the keymap, like every other controller.
Removes the SRAM-specific tap-count timer and the double-click-window setting/UI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- New "Floating window (Picture-in-Picture)" overlay setting (iOS 16+). Default
follows the per-device auto behavior (on for iPad / non-DI iPhones, off for
Dynamic-Island iPhones); DI-iPhone users can opt in. The Live Activity keeps
running alongside it (additive).
- iPad: start PiP immediately on activation (foreground) instead of only when
backgrounded — there's screen room (DeviceCapabilities.prefersForegroundPip +
scheduleForegroundStart poll).
- DeviceCapabilities.isPipCapable (any iOS 16+ PiP device) + bike_control/pip_ios
"isCapable"; settings.getOverlayUsePip/setOverlayUsePip; show() resolves the
preference.
- requiresLinearPlayback = true to drop the PiP skip/scrub (next/prev) controls
(it's a live HUD; central play/pause is system chrome, harmless no-op).
- overlayUsePip + overlayUsePipSubtitle in all 6 languages; changelog updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <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>
Show a one-time, full-screen explainer the first time the Smart Trainer
page is opened: Virtual Shifting is in beta, works with dozens of trainers
(some not perfectly yet), links to the supported-trainers list, and invites
feedback. Gated by a global 'virtual_shifting_intro_seen' pref and skipped in
screenshot mode. Reuses existing icons only. Strings added in all 6 locales.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 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>
The prop package re-exports protocol/zp.pb.dart which defines a protobuf
`class Set`, shadowing the built-in Set type. Added `hide Set` to the
prop import so Dart's Set is visible and the overlay accessors can use
proper Set<OverlayField> types instead of dynamic.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a sticky 'support_chat_active' bool to Settings, flipped to true
the first time SupportChatService.openChat succeeds. HelpButton becomes
a StatefulWidget; if the flag is set in initState it kicks off a
background fetchChat() and counts admin-side messages whose createdAt
is later than the chat's lastSeenAt. When at least one is found, a
small destructive-coloured dot appears both on the button's leading
icon (top-right corner) and as the trailing slot of the inline 'Chat
with Support' menu entry.
Opening the chat clears the dot locally and re-runs the unread check
on return so the indicator stays in sync with what the user has now
seen. All checks are best-effort: missing auth, network errors, and
edge-function failures are swallowed and the dot just stays off.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds ProxyDevice.defaultRetrofitMode that returns RetrofitMode.bluetooth or
RetrofitMode.wifi when the device advertises FTMS and the user has a
matching Trainer Connection enabled (resolved via preferredBridgeTransport).
Power-meter-only and HRM-only devices, plus smart trainers with no enabled
Bridge transport, fall back to RetrofitMode.proxy.
Threads the device default through Settings.getRetrofitMode as a `fallback`
parameter so the auto-connect path, the tap-to-connect handler in
ProxyPage, and the picker's initState all surface VS first.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Persist a per-trainer auto_connect_<trainerKey> flag via Settings. Set
to true whenever the user explicitly starts the emulator (tap in the
Trainer & Accessories list, or the Connect button on the disconnected
card). Clear to false when they tap Disconnect (or Disconnect & forget).
In Connection._handleConnectionQueue's proxy branch, after the shared
listener setup finishes, check the flag for the scanned ProxyDevice —
if set and nothing else is in flight, pick up the saved retrofit mode
and fire startProxy() so the emulator is ready by the time the user
opens the details page (or without opening it at all).
All call sites now go through core.shiftingConfigs and the active
ShiftingConfig. Remove the global getProxy*/setProxy*/clear helpers
and the associated clamp constants; these lived at lib/utils/settings/settings.dart:488-568.
The unused fitness_bike_definition import it pulled in drops with
them.
Adds getProxyGearRatios/setProxyGearRatios/clearProxyGearRatios on
the Settings class, bumps the prop submodule to pick up the mutable
table and public gear constants on FitnessBikeDefinition, and covers
the roundtrip + edge cases with tests.