Updates sramSetupIntro and sramAuthorizeBody in intl_en.arb to the
clearer design wording (English only; other locales retranslate via
Localazy), adds the setup-wizard CHANGELOG entry under 6.3.0, and fixes
a test assertion that collided with the reworded SRAM intro copy.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Implement onboardingWhereBody widget showing Local vs Network target options
- Wire step into onboarding page with target selection state and footer handler
- Add L10n strings for step UI and enables text
- Add snapshot tests for unselected and selected states
- All tests pass; flutter analyze clean
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wires the onboarding wizard's Help button to a contextual sheet (per-step
answer + setup guides / troubleshooting / support channels) and adds a
permission-denied sheet for Task 8 to consume.
The advertised serial was sliced off the raw device id. WiFi trainer ids
are `dircon://<name>` and `dircon://` is itself exactly nine characters —
the same length as the reference serial the slice was sized against — so
every WiFi-proxied trainer advertised the identical, information-free
`serial-number=dircon://`.
Strip any `scheme://` prefix before slicing, and pad short ids instead of
letting substring throw. BLE device ids keep their existing derivation,
covered by a regression test.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The decision page is about choosing, not explaining -- the animated
padlock that sells page 1's Zwift-unlock trade-off was noise once both
options are already laid out in the buttons below. Pass
ClickContours(page: 1, animate: false) there instead, leaving pages 0
and 1's badges untouched.
Also covers animate: false with real test coverage (previously only
MediaQuery.disableAnimations exercised the no-loop path) and updates
click_contours.dart's stale doc comment, which still pointed at the
64x40 card thumbnail removed in an earlier task.
- Drop the nested Card in the placeholder device-list entry so it sits
flush with sibling cards, and replace the 64x40 ClickContours thumbnail
(illegible at that scale) with the standard StatusIcon badge, matching
the gamepad icon Zwift Click V2 devices already carry.
- Move the onboarding pager's hero inside each page's own scrollable
content instead of as fixed chrome above the PageView, so a drag on the
contours swipes the pager and short viewports can scroll the hero too.
Each page now gets a fixed hero state instead of the shared scrubbing
value, since two scrubbing heroes sliding past each other mid-swipe
looked broken.
- Make the swipe hint tappable (advances one page via the PageController)
per updated product direction, while keeping it visually light and
free of any choice-applying behavior.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GcRAUvS3gwjmfi2qJipcc
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
Riders were tapping the first page's CTA by reflex without ever swiping
to compare the two unlock modes, so page one became a de-facto default.
The two option pages are now explanation-only (swipe hint instead of a
CTA), and a new third pager page presents both choices side by side with
equal visual weight so a decision can't be made without seeing both.
Also updates test/click_v2_onboarding_l10n_test.dart's hardcoded key
count (19 -> 24) and runtime smoke-test list for the five new arb keys,
since that test was not otherwise part of the brief's file list but
would fail on the new keys without it.
Adds looping state badges to the onboarding hero (an idle-timeout pill on
page 0, a padlock with a sweeping ring on page 1, cross-fading with the
pager) and a staggered fade/rise entrance for each option's pro/con rows,
so the trade-off reads at a glance instead of as two paragraphs of text.
Both badges respect reduced motion via a MediaQuery.disableAnimations
guard that stops the shared loop controller rather than letting it run
forever under pumpAndSettle. Also closes a minor double-tap gap on the
two CTAs.
The three pre-existing tests that navigate to the onboarding page and
pumpAndSettle needed a one-line disableAnimations pin so the new
perpetual-while-visible loop doesn't make them hang, matching the
existing pattern in device_page_click_v2_collapse_test.dart for the same
class of problem.
ZwiftClickV2.shouldAutoConnect gates connect() on ClickV2Onboarding.isPending,
which reads true from this suite's empty-prefs setUp (env.resetState()).
That held both Click V2 sides out of the connect queue, so connect() returned
early and the handshake write these tests wait for never arrived, timing out.
Mark onboarding done in setUp so the gate doesn't interfere with tests that
exercise a connected controller's button/profile behaviour.
Adds a ghost "Set up again" button beside the Unlock mode label in
UnlockToggle so the Click V2 explainer stays reachable after the
one-time onboarding flow completes.
Also guards ClickLogic.setupHandshake against a null `services`: a
device's isConnected can flip true (via the raw BLE connection-state
listener) before connect() finishes assigning services, so the prior
force-unwrap could throw on that narrow race. The setting write still
happens either way; only the handshake is skipped, and skipping is
logged via a LogNotification rather than swallowed.
Review found the onboarding card test only exercised the card in
isolation, leaving _deviceGroups' actual collapse/pairing logic
unverified. Add device_page_click_v2_collapse_test.dart covering both
pending, only-one-side pending, already-onboarded (regression), and
the preserved connected-pair layout. Also close a vacuous-pass gap in
the existing card test's ancestor-exclusion assertion.
Review findings on ClickContours:
- The glow blur/spread and the right-puck outward offset were authored as
absolute pixels against the onboarding pager's 180px-tall hero. A later
task reuses this widget as a much smaller card thumbnail, where a 34px
blur or a 14px translate would overwhelm the art. Wrap the layout in a
LayoutBuilder and scale those three constants by
(availableHeight / 180).clamp(0, 1), so appearance at the pager size is
unchanged and the thumbnail degrades proportionally instead of breaking.
- Document the widget's bounded-width/finite-height contract in the class
doc comment (Row+Flexible asserts otherwise).
- Add ValueKeys to the right puck's Transform.scale/Transform.translate and
the left puck's glow DecoratedBox, and cover the previously-untested
interpolated properties: right puck scale and x-offset, left puck glow
alpha, and a small-thumbnail case proving the offset scales down rather
than staying a flat 14px. The existing right-puck-opacity key and its
four tests are unchanged.
Adds ClickContours, the two-puck silhouette that animates as the Click V2
onboarding pager moves between "left side only" and "unlock with Zwift".
Takes a fractional page value instead of owning a PageController so it can
be scrubbed continuously by a swipe or driven by a plain animation later.
Replace runtime-only assertions with direct arb-file verification that catches
missing keys and ensures complete translations across all languages. Test now:
- Reads each of the six arb files
- Verifies English has exactly 19 clickV2Onboarding_ keys
- Verifies all other locales have identical key sets
- Asserts all values are non-empty strings
This catches the failure mode the original test missed: a key present in one
language and absent in another would have silently passed before, due to Intl's
fallback to English. Keep runtime resolution check as smoke test only.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GcRAUvS3gwjmfi2qJipcc
The picker asks the user to choose between BikeControl's virtual
shifting, a plain proxy, and letting the trainer app handle shifting
itself — without much to go on. Link out to the blog post that compares
the two paths honestly, so the trade-offs are one tap away.
Localized across all six locales. Also adds the snapshot test that
generates the picker image used in that post.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Renders "×N" on folded entries so a continuous poller reads as one line that
fired N times rather than silently occupying one slot. Single occurrences stay
unmarked.
Picks up the prop-side fold + the 40 -> 200 ceiling, after a field capture
filled the whole buffer in eight seconds and lost the window that mattered.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PanTG9kRBi4QTQ2psvpTxP
Adds the "mDNS queries received" section to the diagnostics report, listing
each query the responder saw with its source, the QU bit and whether the reply
went out unicast, multicast, both or not at all.
This is the missing half of diagnosing "the trainer app on this machine can't
find BikeControl". A same-host querier appears with the advertised address as
its source, so the report now distinguishes three very different situations:
the app never queried us at all, it queried for the service (PTR/SRV — the
browse step), or it queried for our hostname (A — the resolve step). Empty on
iOS, where the OS responder handles queries and never reports them to us.
Picks up the prop-side fix for the Windows shared-port QU delivery problem.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PanTG9kRBi4QTQ2psvpTxP
The advertising record layout and device-type codes are prop's; this test
asserts only the app's routing decision. Renamed so the old path can be
removed from history.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The device-side spec (bond handshake, anti-replay bookkeeping, press framing)
now lives in the private prop package. This file keeps its app-wiring
coverage and consumes the fake through package:prop/testing.dart.
The rename is deliberate: it lets the old path be removed from history while
this trimmed version stays at HEAD.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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>
The +15 field log showed the probe auto-arming and the pod RESPONDING to
each candidate — but the response logged as empty. Cause: we subscribed
to 6e400002 only, so a reply on the second Nordic-UART slot (6e400003)
was never delivered, and the empty frames were artifacts on the write
slot. Subscribe to every notify/indicate characteristic (pressed-set
dedup absorbs any duplicated button event), and log each unexpected frame
with its slot and byte length so an empty artifact is distinguishable
from a real reply. Next field log will show which slot the pod answers on
and the actual bytes.
Co-Authored-By: Claude Fable 5 <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>
TX firmware frames carry a sender type byte and an additive checksum
(04 type code sum), unlike the OX 3-byte XOR shape — both validate now
and route through the same opcode switch. The 1 Hz TX status frame 0x10
and any unknown/invalid frame log once per connection instead of
flooding the support log.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
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.
ERG (review findings on the ±5W change):
- New ErgPowerStepping extension is the single home for the 5W step and
500W manual cap, replacing 7 inline copies (physical buttons, hero-card
buttons/slider, three overlay controllers).
- Boundaries are guards, not clamps: up at >=500W is a no-op like the
disabled UI button (a 600W FTMS target is no longer slashed to 500),
down from >500W steps relative, and an unknown baseline (hub-commanded
ERG reports no target) is a no-op with a new localized message instead
of slamming the trainer to ~150W.
- ERG shift-up Success carries the button again so +5W presses show
activity feedback (missed conversion from 843f7985).
SRAM gesture:
- Same-lever repeats inside the 90ms combo window coalesce as duplicates:
a finger can't re-press in 90ms, but iOS re-delivers a colliding read
response of the 0xFF edge through the notify callback — it must not
actuate twice (nor break a combo when it misdecodes to the other lever).
- The §7 multishift guard only runs while shifting is enabled — the one
state where a held paddle actually bursts (per c94b87f0's --observe
capture). Bonded rapid tapping and both-lever combos are never
throttled. Timer-driven instead of DateTime.now() (deterministic under
fakeAsync) and cleared by _resetGesture on (re)connect.
- The "set up SRAM control" warning fires once per connection, not on
every undecoded press.
Harness:
- EmulationSession.notify drops notifications for removed peripherals so
delayed notifies (SRAM double-tap) can't land after teardown.
- The 0xFF press edge is SramAxsConstants.triggerEdge at all call sites;
the emulation test waits on the named TRIGGER_UUID constant.
- New coverage: guard behavior through processCharacteristic in both
states, burst suppression while unbonded, all-taps-delivered once
bonded, ERG boundary/game-set-target cases.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Gesture engine: a repeat of the SAME lever inside the 90ms combo window
can't be a combo, so flush the pending click instead of overwriting it —
rapid double-taps now deliver both shifts. The old press-swallowing was
accidentally doing multishift suppression, so bring back the explicit §7
guard (forward the first two rapid triggers, drop the 3rd+ within 350ms)
that the discrete-click rework removed.
Test fixes for the rest of the failing suite:
- review_prompt_service_test: derive seeds from sessionThreshold /
snoozeSessions instead of hardcoding the old threshold of 3
- controller_settings_signal_change_test: persist a session key and run
handleServices so the device is bonded and the Restore branch renders
- emulated SRAM AXS profile: send real 1-byte 0xFF edges (0x01 is now
filtered as a read-response echo), expect the generic 'SRAM Button'
name, and wait for the app's trigger subscription before tapping so
the press can't land mid-connect and get wiped by the gesture reset
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A SRAM press is a single 0xFF edge on d9050054 — no release event, and (with
shifting disabled) no multishift burst. An --observe capture confirmed a HELD
lever emits exactly one edge, so a hold is indistinguishable from a tap and
long-press cannot be reconstructed. Replace the old instant-down+up-per-edge
guard with a small assembler that treats every press as a discrete CLICK and
reconstructs the one thing the base device can't get from the raw edges — "both
levers at once":
- a press is buffered for a short combo window; if the other lever's press lands
inside it, both buttons are emitted together in ONE call so the base device's
_maybeHandleFrontShiftCombo fires frontShift ({shiftUp,shiftDown}) and
suppresses the rear shifts — the "left+right together" goal;
- otherwise the single button clicks (down+up). Single vs double click is left
to the base device (two discrete taps in its double-click window);
- supportsLongPress is set false — it's not achievable on this hardware.
Buffer/timer reset on (re)connect and cancelled on disconnect. Single clicks now
land ~_comboWindow (90ms) after the press instead of waiting on a release that
never comes. Combo detection still needs a two-lever hardware check.
Tests: fakeAsync coverage for a single discrete click, both-levers-together one
click, a held (single-edge) lever as a single click, and two spaced taps as two
clicks.