The setup/restore bottom sheet spans the full window width; on desktop
that stretched the content unpleasantly. Centre it and cap it at 480
(heightFactor: 1 keeps the sheet shrink-wrapped to its content height).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The panel duplicated the device card's own header and mappable-button
list. Reduce it to just the current status (intro + "Set up SRAM
control", or the "shifting off" strip + "Restore") since the card
already shows the device name and the discovered buttons. Removes the
now-dead _SramDeviceHeader/_SramStepChip/_SramControlRow widgets, the
debugSeedButton test hook, and 11 orphaned l10n keys. The guided bottom
sheet is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UI-only reskin of _buildSetupPanel + _runGuidedOperation (BLE/decode logic and
the _SramSetupStage machine untouched): a two-state device panel (header + tile,
3-step diagram / status strip + mappable-controls list) and the guided flow
re-presented as a bottom sheet with a step rail, icon badge, progress checklist,
and the AXS press-and-hold hero. +20 localized strings (en/de/es/fr/it/pl);
reduced-motion honored; snapshot test renders the real sheet stages via a
@visibleForTesting builder.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Externalize the panel + guided-dialog strings into intl_*.arb across all six
languages and wire sram_axs.dart to context.i18n. Button/log labels stay in
English (technical identifiers). Regenerated lib/gen is gitignored.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The real cause of the runaway: handleTrigger reads d9050054 to decrypt the
button event, and on iOS/CoreBluetooth a read response is also delivered via
the notify callback — so the multi-byte read value re-entered processCharacteristic
and triggered another read, looping at BLE-read cadence (~120-180ms) from a
single click. Ignore anything that isn't the 0xFF edge (§6.1). The §7 multishift
guard from the previous commit stays as defense against genuine held-paddle bursts.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the protocol §7 multishift/hold guard: a held paddle makes the derailleur
emit a rapid burst of triggers — forward the first two (so a real double-click
still reaches the base device) and drop the 3rd+ rapid one, fixing a runaway
press loop. Also make the guided setup/restore dialog try the operation first
and only ask the user to press-and-hold the AXS button if a fresh bond is
actually required — no re-authorize prompt when already bonded.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
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>
Restore now runs through the same staged dialog as setup, so when the session
key didn't survive a reconnect and a fresh bond is needed, it guides the
press-and-hold AXS authorize gesture and shows the error with a Retry instead
of only logging to the console. Remove the 'Re-run SRAM setup' button (a no-op
once shifting is disabled). Log once per connection when a press can't be
decoded, to make the key-not-active-this-session case visible.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the setup/restore panel onto the main device card (showAdditionalInformation)
and make setup a guided dialog: instructions to press-and-hold the AXS button →
progress → success, or the actual error (e.g. bond authorization failure) with a
Retry, instead of only logging to the console. Restore surfaces a toast.
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>
Addresses three final-review findings on the WHEELTOP EDS shifter branch:
subscribing to 6e400002 regardless of GATT properties silently killed
firmware that puts notifications on 6e400003; a missing `*` marker line
made the new TROUBLESHOOTING.md section render as one giant heading; and
never clearing per-connection button/subscription state let a mid-hold BLE
drop swallow the next press after reconnecting.
Co-Authored-By: Claude Fable 5 <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>
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>
Adds the last emulation profile batch and finalizes allEmulationProfiles
(controllers, then steering, then accessories). Test assertions deviate from
the brief where verified behavior required it: Cycplus/ThinkRider buttons
compare by name (allowMultiple: true makes BluetoothDevice copy the static
button with a per-session sourceDeviceId, which ControllerButton equality
includes); the Di2 test sets a CustomApp so getOrAddButton actually registers
its dynamically-created channel buttons; setUp seeds packageInfoValue so
OpenBikeControlDevice's app-info write doesn't null-check crash.
Adds three emulation profiles for Task 9: Kickr Bike Shift (3-byte
button frames with rolling dedupe sequence), Kickr Climb (request-
control on connect + incline writes decoded/logged), and Headwind
(manual-mode + speed writes logged, status echo keeps the app's mode
tracking consistent with real hardware).
Adds buildZwiftController + zwiftPlayNotification encoder plus five
new EmulationProfiles (Play L/R, Play FW2, Click V2 L/R) built on
Task 3's rideMaskInputs. Wires them into allEmulationProfiles.
TDD: emulation_zwift_profiles_test.dart written first (RED: profiles
undefined), then implemented to GREEN (5/5). The test's setUp also
initializes prop's global `propPrefs` directly — IntegrationEnv's
harness never wires it up (only production Settings.init() does),
and ZwiftClickV2's handleButtonsClicked reads it on every click, so
Click V2 side tests hit a LateInitializationError without it. This is
the first integration test to exercise a ZwiftClickV2 button press
end-to-end, which is why the gap wasn't hit before.
Replaces the hard-coded debug Continue menu item with a declarative submenu
listing every emulation profile. Uses core.emulation.start() and
core.connection.performScanning().
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the EmulationProfile/EmulatedInput model, EmulationManager +
EmulationSession, removePeripheral on the fake BLE platform, the first two
device profiles (Zwift Click + Ride) with an allEmulationProfiles registry,
core.emulation, and the debug-only RoutingBlePlatform install in main().
- 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>