Commit Graph

422 Commits

Author SHA1 Message Date
Jonas Bark
967a123786 feat(onboarding): refresh existing copy from the design, changelog entry
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>
2026-08-09 22:16:50 +02:00
Jonas Bark
c3aeca17a6 feat(onboarding): step 6 success, test mode and completion 2026-08-09 22:16:23 +02:00
Jonas Bark
7a77fd7d9c feat(onboarding): step 5 connection methods and in-app setup guide 2026-08-09 22:16:23 +02:00
Jonas Bark
d16afaac2f feat(onboarding): step 4 virtual shifting with nearby trainers 2026-08-09 22:16:23 +02:00
Jonas Bark
866c0164e7 feat(onboarding): device sub-flows and press-a-button-to-continue 2026-08-09 22:16:23 +02:00
Jonas Bark
49aee96968 feat(onboarding): step 3 controller permission/scan/list/empty phases 2026-08-09 22:16:23 +02:00
Jonas Bark
b9775bad84 feat(onboarding): step 2 where-does-the-app-run cards
- 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>
2026-08-09 22:16:23 +02:00
Jonas Bark
a5e64bac7b feat(onboarding): step 1 trainer app picker grid 2026-08-09 22:16:22 +02:00
Jonas Bark
e6eb9e68a2 feat(onboarding): per-step help sheet and permission-denied sheet
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.
2026-08-09 22:16:22 +02:00
Jonas Bark
f7cd11057f feat(onboarding): responsive wizard shell with step rail and progress bar 2026-08-09 22:16:22 +02:00
Jonas Bark
194a90ae4a feat(onboarding): trigger wizard on fresh installs, add Setup guide menu entry
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 22:16:22 +02:00
Jonas Bark
2e63bf580a fix(dircon): derive a real mDNS serial-number for WiFi trainers
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>
2026-08-07 11:30:12 +02:00
Jonas Bark
4f1db04b77 fix(click-v2): drop lock badge animation from the decision page
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.
2026-08-03 20:30:23 +02:00
Jonas Bark
54e718b2ee fix(click-v2): apply three product-owner UI corrections to onboarding
- 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
2026-08-03 18:30:30 +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
074955d92d feat(click-v2): make the unlock-mode choice its own pager step
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.
2026-08-03 17:31:32 +02:00
Jonas Bark
aec4760e76 feat(click-v2): animate the unlock trade-offs in the onboarding
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.
2026-08-03 17:06:30 +02:00
Jonas Bark
e74c5920fb fix(test): unblock Click V2 handshake in emulation profile integration tests
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.
2026-08-03 16:26:31 +02:00
Jonas Bark
37152aafbe feat(click-v2): reopen the onboarding explainer from the unlock-mode selector
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.
2026-08-03 16:20:11 +02:00
Jonas Bark
3752701455 test(click-v2): cover the pending-sides-collapse behaviour on DevicePage
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.
2026-08-03 16:04:13 +02:00
Jonas Bark
b484b1069a feat(click-v2): show a pending-setup card for undiscovered-mode controllers 2026-08-03 15:26:10 +02:00
Jonas Bark
3a2d26378e feat(click-v2): add the fullscreen unlock-mode onboarding flow 2026-08-03 15:14:20 +02:00
Jonas Bark
d559bd0a28 fix(click-v2): scale contour hero constants to the given box, add coverage
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.
2026-08-03 10:16:06 +02:00
Jonas Bark
b0d7af8f48 feat(click-v2): add animated contour hero for the onboarding
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.
2026-08-03 09:58:19 +02:00
Jonas Bark
5d5081c037 test(click-v2): verify onboarding key-set parity in arb files
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
2026-08-03 09:52:02 +02:00
Jonas Bark
70bf4cc771 i18n(click-v2): add onboarding strings in all six languages
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GcRAUvS3gwjmfi2qJipcc
2026-08-03 09:43:01 +02:00
Jonas Bark
3693f1b1d0 feat(click-v2): apply the chosen unlock mode and connect 2026-08-03 09:32:17 +02:00
Jonas Bark
653dfbf461 feat(click-v2): hold discovered controllers for unlock-mode onboarding 2026-08-03 09:21:02 +02:00
Jonas Bark
8634db7dbc refactor(bluetooth): lift shouldAutoConnect onto BaseDevice 2026-08-03 09:15:13 +02:00
Jonas Bark
e005a1e136 feat(click-v2): add onboarding trigger policy 2026-08-03 09:09:04 +02:00
Jonas Bark
4c0184bcd6 feat(click-v2): add onboarding-completion setting 2026-08-03 09:04:49 +02:00
Jonas Bark
8b36722e43 feat(trainer): add "Help me decide" link to the connect mode picker
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>
2026-07-31 23:52:09 +02:00
Jonas Bark
274a6ba634 diag: show repeat counts in the mDNS query log; bump prop submodule
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
2026-07-30 21:52:25 +02:00
Jonas Bark
8b8b94b0af fix(diagnostics): surface received mDNS queries; bump prop submodule
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
2026-07-30 13:11:24 +02:00
Jonas Bark
be56055587 refactor(sram): route advert-filter coverage through prop fixtures
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>
2026-07-27 19:57:00 +02:00
Jonas Bark
426a3b2200 refactor(sram): drive the integration test from prop's fake derailleur
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>
2026-07-27 19:55:53 +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
1fed2971e5 fix: subscribe to all WHEELTOP notify slots; log reply slot + length
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>
2026-07-16 08:26:49 +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
4a7a301043 feat: WHEELTOP keepalive-reply prober (opt-in beta experiment)
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>
2026-07-13 09:38:50 +02:00
Jonas Bark
1c5cb640b8 feat: accept WHEELTOP TX 4-byte frames (additive checksum), dedupe frame logs
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>
2026-07-13 08:55:08 +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
d9ee333648 test: fake-platform connect failures + Wheeltop EDS fixture
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 16:39:27 +02:00
Jonas Bark
1a40888c31 feat: connect-backoff seams on BluetoothDevice, Wheeltop opts in
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 16:34:23 +02:00
Jonas Bark
acea58806a fix info button 2026-07-09 20:48:18 +02:00
Jonas Bark
db5cc74a12 fix(erg,sram): shared ERG stepping with boundary guards; scope §7 guard to shifting-enabled; coalesce iOS echo presses
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>
2026-07-09 17:51:35 +02:00
Jonas Bark
39e9082e53 fix(sram): don't swallow same-lever repeats; restore §7 burst guard; fix failing tests
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>
2026-07-09 16:24:01 +02:00
Jonas Bark
ff2a2aace7 Merge branch '6.2-beta' into 6.3
# Conflicts:
#	lib/bluetooth/devices/sram/sram_axs.dart
#	lib/pages/controller_settings.dart
2026-07-09 15:07:49 +02:00
Jonas Bark
c94b87f08a feat(sram): discrete-click gesture + "both levers" front-shift combo
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.
2026-07-09 14:49:28 +02:00