Commit Graph

1200 Commits

Author SHA1 Message Date
Jonas Bark
65d8579199 fix(home): Local control is a fallback, not proof the app is connected
The app link read connectedTrainerConnections, which includes Local.
Local reports connected the moment it is switched on — it types into
whatever window happens to be in front — so it says nothing about
whether the trainer app is reachable. With a network method also enabled
(the default for MyWhoosh) that painted the link green while the
connection the rider actually rides on sat unactivated, hiding the one
thing left to do.

The link now reads non-local connections whenever any non-local method
is enabled, and all of them when Local is all there is — because then
Local IS the answer. The summary uses the same list, so the card cannot
caption itself "Local" while the network method is down.

The rule already existed: InactivityDisconnector draws exactly this
distinction, and connectedNonLocalTrainerConnections was already there
for it. The home chain simply was not using it. So the getter lives in
core.logic beside its siblings rather than as a private method on the
page — the next screen that needs it should find it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 19:52:39 +02:00
Jonas Bark
6dc4136567 fix(click-v2): enabling the new unlock method lands on the right puck
Reported from a device: switching "use new unlock method" on from the
detail page connected only the LEFT puck — the one that needs unlocking
— which is the setup the switch exists to move the rider off.

Two causes, both needed fixing.

Nothing put the rider into a mode. The toggle only flipped the
representation, so with unlock-with-Zwift off and right-side-only off,
the left puck's gate let it connect while the right puck's gate — which
needs one of those two settings — kept it out. Enabling now routes
through chooseRightSideOnly(), so the toggle and the explainer leave
identical state. A rider who deliberately chose unlock-with-Zwift keeps
both sides; this only redirects the default.

And even with the mode set, the right puck could never appear. In the
legacy representation its advert IS scanned and cached, but
fromScanResult returns null for it — the advert is remembered while
resolving to no device, and the scanner then dedupes against that cache
forever. So the switch also restarts the scan, the same thing
restoreLeftSides already needed.

That meant widening what counts as a left puck. In the legacy
representation the unified ZwiftClickV2 IS the left puck, built from its
advert (the right one builds nothing), so ignoring only
ZwiftClickV2LeftSide missed the very case this bug is about.
_ignoreLeftSides now matches ZwiftClickV2 — which covers both classes
and cannot catch the right side, since that extends ZwiftRide — and
restoreLeftSides recognises both label constants, or a puck ignored as
the unified controller could never be restored.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 18:02:03 +02:00
Jonas Bark
65f4f22527 fix(home): restore the Click after switching off the split representation
Reported from a device: pick right-side-only, then turn "use new unlock
method" off, and you are left with no Click at all and a chain showing
its empty "Controller" placeholder.

One cause, not two. Right-side-only puts the left puck on the ignored
list — but in the legacy representation the LEFT puck is what becomes
the unified ZwiftClickV2, and the right puck builds nothing at all (see
BluetoothDevice.fromScanResult). Ignored left plus null right leaves
nothing to build, and the "Controller" entry was never an orphan: it is
chainControllerTitle, the placeholder the chain correctly falls back to
when no controller exists.

So the toggle now clears the mode and un-ignores the left side before
switching. That path was private to the onboarding policy on the
assumption that right-side-only was the only way out of it; it is not,
so it becomes restoreLeftSides().

Three UI fixes alongside it.

The error banner over the chain is gone, with the state that only fed it
— both animation controllers, the shake, the latest-error entry. The
activity log and its tab dot are untouched; the chain says what is wrong
now, and a card repeating it above was the older answer to the same
question.

Button-action errors no longer toast while the onboarding wizard is
open. The wizard asks the rider to press a button precisely while the
trainer app or the keymap is not set up yet, so those presses fail by
design, and "X could not be performed" over the step that asked for the
press reads as the wizard being broken. Still logged to the activity
list.

And the checklist's step rows sat 4px from the card edge, so the active
step's highlight read as a panel the card had failed to contain. At 10
it sits inside the card, with StepRow's own inset still letting the
highlight bleed slightly wider than the text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 17:00:05 +02:00
Jonas Bark
77596ffbe0 fix(click-v2): ignore the left puck in right-side-only, and name both pucks
Three things the first cut of right-side-only got wrong on a real phone.

The left puck was held back by a setting rather than ignored, so it kept
its entry in the device list and the active scan handed it straight back
— an orphan stuck on "connecting" that never could. Filtering it out of
controllerDevices fixed the onboarding list and missed the home chain,
which also draws from offlineControllers. That is the argument against
inventing a second mechanism: ignoring is the one the scan filter, the
remembered-device loader and the device list all already honour, so
using it takes the puck out of every list at once. The dedicated gate
and the isExcludedBySetup filter are gone with it.

Ignoring has to cover the remembered stand-in too, not just a live
device — the chain lists both side by side, and the card in the report
was a stand-in.

It also has to be undoable, or picking "unlock with Zwift" after
right-side-only silently still yields one controller. Removing the
ignored entry is not enough on its own: the scanner dedupes against its
cached advert, and performScanning() returns immediately while a scan is
already running, so the puck only came back on the next launch. It now
restarts the scan.

Both lists showed "Zwift Click" for both pucks: `name` is the raw BLE
advertised name, identical for the two. They use displayName, which
carries the translated left/right suffix.

Finally, the chain sat 24px in from each screen edge on mobile —
Overview's scroll view pads it by 12 and HomePage added 12 of its own,
before each card's padding on top. Desktop keeps its inset; there the
chain sits in a centred max-width box with no padding of its own.

Known sharp edge, left deliberately: un-ignoring the left puck by hand
while still in right-side-only mode brings both up live, and the right
side's handshake cancels the left's restart timer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 16:23:38 +02:00
Jonas Bark
aa0720b984 fix(click-v2): the no-unlock option is the right puck, not the left
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>
2026-08-11 15:40:00 +02:00
Jonas Bark
56a8e87f7d i18n(home): translate the setup chain, align its checklist, stop billing
undelivered shifts

Three things.

The chain's 68 strings existed only in English, so five locales fell back
to it on the app's main screen. Now translated, in each file's own register
— informal second person throughout, matching the copy already around
them. Polish needed a `few` plural category for the step and day counters:
it uses a distinct form for 2-4, so `other` would have rendered "Zostały 2
kroków" instead of "kroki". Two keys written speculatively and never wired
up are dropped rather than sent to five translators.

The checklist's summary row sat inside a Button whose own padding inset it
past the steps below, and the leading glyphs differed in both width (15px
icon, 17px tick) and gap, so matching the outer inset alone would not have
lined them up. One _rowInset / _leadingSize / _leadingGap now governs both,
with the glyphs centred in a box of equal width. Two tests pin the tick and
the label columns, because this is exactly what drifts back unnoticed.

Finally, shifting with a trainer connected but no app holding the bridge
was charged to the daily command budget. Those shifts reach nothing. The
existing exemption only covered the case where the 20-minute
virtual-shifting budget was already ticking — that avoids double-billing —
so it grows a second reason: a command that was never delivered anywhere is
not a command the rider spent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 14:39:07 +02:00
Jonas Bark
3f83351144 feat(home): connect trainers from the card, animate status changes
Three things the chain got wrong once a real trainer was in the room.

The trainer card offered "Edit" for a trainer that had never been
connected — an offer to edit nothing. It now offers Connect until the
trainer is actually bridged, and that opens the onboarding trainer picker
itself: connectTrainerFromPicker is extracted so onboarding and the home
card share one path, and "connect my trainer" behaves identically wherever
a rider reaches it. Extracting it also removed an empty `if
(device.isSmartTrainer) {}` that the consent removal had left behind.

The checklist is withheld until the rider has committed to bridging. A
trainer merely in range and one deliberately left on "let the app handle
shifting" are the same state underneath — not connected — and in both
cases a column of unticked boxes reads as work outstanding when there is
none. That surfaced a related bug: picking "No connection" sets
autoConnect false, but a trainer that had connected earlier in the session
was still classified as lost, so deliberately disconnecting it turned the
card red. An explicit "no connection" is now a resting state regardless of
what happened earlier.

Status changes animate. The checklist grows and shrinks through
AnimatedSize, so when the last step ticks the card folds to its one-line
summary as a movement the eye can follow rather than a jump; the card
border and the banner — colour, wash, and the badge resizing between its
calm and alarmed sizes — move on the same curve, so the screen resolves as
one gesture instead of several. The test asserts the collapse is genuinely
taller mid-flight than at rest, because "it animates" is otherwise not
something a test can hold onto.

Finally, the trainer-app instructions sheet was a thinner retelling of the
setup steps rather than the steps themselves. The onboarding guide block
is extracted as OnboardingAppGuideCard and both use it, so a rider who
loses the connection gets the same numbered steps, the same screenshots
and the same full-guide link that got them connected in the first place.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 12:27:35 +02:00
Jonas Bark
24f5da596d fix(home): device-testing fixes, and drop the VS takeover dialog
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>
2026-08-11 12:02:24 +02:00
Jonas Bark
0c91cc7465 feat(home): setup-chain model and remembered devices
The home screen is being rebuilt as the setup chain: one card per link,
each carrying the same status light and the same tick-off checklist. This
lands the parts that decide *what* the screen says, ahead of the widgets
that draw it.

chain_state.dart is pure data with no Flutter, no BLE and no `core`, and
steps carry ids rather than sentences, so "which step is done or pending"
is unit-testable without a locale or a radio. chain_builder.dart turns a
plain ChainInputs snapshot into cards; deriveBanner reads the cards back,
so the banner can never contradict what is under it.

Remembered devices fix a real gap: a controller that is switched off or
out of range disappeared from the app entirely, so riders could not see
what they owned or edit a mapping away from the bike. We now store the
advertisement a device connected with — exactly the fields
BluetoothDevice.fromScanResult reads — and rebuild it into a real device
object of the right subclass, kept out of the connect queue. Trainers are
remembered as data only, since their card needs a name, not a contour.

Tracking which ids connected this session is what separates a red "lost
connection" from an amber "out of range"; a fresh launch with the
controller in a drawer must not paint the screen red.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 10:38:19 +02:00
Jonas Bark
45b214b095 feat(iap): show the in-app paywall on iOS and Android too, with real store prices
Riders see the Flutter paywall on every platform now — RevenueCat's hosted
sheet is only a fallback when an offering has no matching package. Its
price loader was gated to macOS, so mobile would have shown the hardcoded
'About 2.25 $/mo' placeholders; it now fetches offerings wherever
RevenueCat is in use (the Windows Stripe build keeps the fallback, having
no offerings to read). Purchases still go straight to the store via the
paywall's own buttons (fromPaywall: true).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 07:32:32 +02:00
Jonas Bark
120a810628 feat(onboarding): mobile welcome screen, theme-aware accent, honest VS copy, platform-correct paywall
- Mobile opens on a welcome screen whose headline reveals word by word,
  then the subtitle, the three what-you'll-do rows and the actions.
  'I'll set this up later' records completion, so a rider who declines
  isn't asked again on every launch. Desktop keeps its rail-framed step 1.
- Dark mode: colorScheme.primary is only the brand blue in the LIGHT
  theme, so white-on-primary icons and check marks were invisible (the
  Network tile above all). New onboardingAccent()/onboardingOnAccent keep
  the brand accent in both themes, lightened for dark.
- Step 4's blocked state read as 'Virtual Shifting doesn't work here'; it
  now leads with 'Optional: connect your smart trainer' and says plainly
  that VS does work — just not with both apps on one phone. The normal
  step regains the design's 'Optional:' prefix too.
- 'See Pro & Base options' goes through IAPManager again, so iOS/Android
  get RevenueCat's hosted paywall instead of the desktop fallback with
  placeholder 'about x €' prices (_loadRevenueCatPricing is macOS-only).
  The desktop paywall keeps pull-to-dismiss, now for every caller.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 23:52:44 +02:00
Jonas Bark
6a8f75b100 feat(onboarding): controller contour, skip-VS tears down bridges, correct help articles
Step 3's connected state renders the controller's contour via the same
ControllerCanvas the home screen uses, with human-readable button chips, so
riders see the buttons they just gained. 'Let {app} handle Virtual
Shifting' (footer and header Skip) now disconnects every smart-trainer
bridge — started, connected or still connecting — with auto-connect
cleared and keepInList so going back re-offers them. helpArticleFor covers
ZwiftPlayFw2 (a fw-2.x Play spoke the Ride protocol and got the Zwift Ride
article) and ZwiftClickV2RightSide; a test locks the slugs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 09:49:34 +02:00
Jonas Bark
49d0f134d4 refactor: extract trainer app/target selection side-effects for reuse
Move applyTrainerAppSelection and applyTargetSelection functions to a new
shared lib/utils/trainer_setup.dart file so they can be reused by both
ConfigurationPage and the onboarding wizard.

- applyTrainerAppSelection: stops unsupported emulators, initializes action
  handler, starts enabled connection method
- applyTargetSelection: sets last target, enables OBP/local methods as needed

Configuration page delegates to these shared functions while maintaining
call-site behavior via onUpdate() callback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
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
3693f1b1d0 feat(click-v2): apply the chosen unlock mode and connect 2026-08-03 09:32:17 +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
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
18c282c698 demo mode 2026-07-10 13:01:38 +02:00
Jonas Bark
c4ebf432ee BLE permission 2026-07-10 12:17:40 +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
0723272455 prepare release 2026-07-09 15:17:51 +02:00
Jonas Bark
bdfbe4395c fix(sram): differentiate left/right shifters and default one lever to shift down
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
2026-07-09 09:12:41 +02:00
Jonas Bark
e310adbceb Merge branch '6.2' into 6.3
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>
2026-07-08 12:04:00 +02:00
Jonas Bark
df1cebd326 fix(sram): exclude non-button components from pre-registration; stabilize names
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>
2026-07-07 17:34:52 +02:00
Jonas Bark
8204a41a8b fix(sram): never overwrite the saved backup on re-run; re-bond stale keys
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>
2026-07-07 15:09:13 +02:00
Jonas Bark
200ee36e1b refactor(sram): use BikeControl's built-in double-click, drop custom gesture layer
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>
2026-07-07 14:47:13 +02:00
Jonas Bark
da2c0f6001 feat(sram): persist session key, config backup, disabled flag, buttons
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 13:33:32 +02:00
Jonas Bark
db751c80e8 feat(wheeltop): recognize EDS shifters from their advertisement
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:05:05 +02:00
Jonas Bark
2f5373cc60 feat: add beta_access entitlement flag and Shorebird track mapping
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 11:02:23 +02:00
Jonas Bark
c95eb147c3 feat(emulation): EmulationManager, profiles model, Click/Ride profiles, debug platform install
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().
2026-07-02 09:45:12 +02:00
Jonas Bark
c648705949 feat(core): showLocalKeyboardCard/showLocalTouchCard visibility getters
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRVXtrmcgtKKz46AVDyqQp
2026-07-02 08:51:00 +02:00
Jonas Bark
fc83374306 refactor(incline): drive dispatch/sink-selection/UI off any incline device
- 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>
2026-07-01 23:40:41 +02:00
Jonas Bark
1b10dee7f1 refactor(incline): generic incline in-game actions + labels
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 23:34:57 +02:00
Jonas Bark
7e03a96741 feat(climb): surface Climb actions in the keymap editor
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:49:53 +02:00
Jonas Bark
8d99bf418b feat(climb): register KICKR Climb, generalize accessory exclusion, dispatch actions
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:28:50 +02:00
Jonas Bark
199d6d2be2 feat(climb): Climb in-game actions + localizations
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:04:15 +02:00
Jonas Bark
b1fff33480 feat(phone-steering): dispatch calibratePhoneSteering action to recalibrate device
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 10:48:13 +02:00
Jonas Bark
7e1bdaa7c9 feat(phone-steering): add calibratePhoneSteering action + steering l10n 2026-06-30 10:44:45 +02:00
Jonas Bark
50d9eea27d feat(iap): exempt internal trainer commands from daily limit during free testing
When the active FitnessBikeDefinition handles a trainer action internally
(gear shift, front shift, mode switch, intensity), don't count it against
the daily command limit for a free tester whose bridge session is still
counting down — no Pro on this device, no full version, and the 20-minute
budget not yet exhausted. All other counting paths are unchanged.

The increment now runs after handleTrainerAction so the decision can key
off whether the FBD actually handled the action. Gating lives in the pure,
testable BaseActions.isExemptInternalTrainerAction and is applied in both
the performAction trainer branch and the both-shifters combo path. Bumps
the prop submodule to its 6.3 branch for the new isCountingDown getter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRVXtrmcgtKKz46AVDyqQp
2026-06-30 10:17:02 +02:00
Jonas Bark
08914aff7e feat(config): link to each trainer app's official site from the chooser
The trainer-app picker now shows an external-link button next to every app
that has an official site, opening it in the browser. Adds an officialUrl to
SupportedApp with per-app overrides (Strappo, MyWhoosh, Rouvy, Zwift,
TrainingPeaks Virtual, Biketerra, BikeControl, OpenBikeControl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 12:52:23 +02:00
Jonas Bark
7e1de77bdd feat(apps): add Strappo as an officially supported trainer app
Strappo (getstrappo.com) integrates the open OpenBikeControl protocol, so it
joins the supported-apps list as an official network/BLE partner (obpMdns +
obpBle) — button events arrive over the protocol, so no keyboard keymap is
needed. Adds the SupportedApp definition, registry entry, partner logo asset,
and a registration test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 12:38:30 +02:00
Jonas Bark
ebe038e1e2 feat(help): link to the bikecontrol.app setup guide for the controller + app
Adds a "Use {controller} with {app}" link that opens the matching
bikecontrol.app/use-<controller>-with-<app>/ how-to page:
- as the first entry in the Help & Support dropdown (above Instruction
  Videos), using the connected controller + selected trainer app;
- on the controller detail page, for that controller + the selected app.

Each controller device and trainer app maps to its website slug
(SupportedApp.helpSlug + a controller lookup in help_article.dart), with a
generic "other-training-app" fallback when a combination has no dedicated
page and no entry when the controller type has none. New localized string
useControllerWithApp across all 6 languages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 20:31:23 +02:00
Jonas Bark
9116688d63 fix(shifting): apply front-derailleur settings live; bound chainrings; handle combo errors
- FrontShiftCard now applies its toggle/chainring changes to the live
  FitnessBikeDefinition (not just the persisted config), so enabling the
  virtual front derailleur takes effect immediately instead of only after a
  reconnect/mode-switch — the combo gate read the config while the action
  checked the def, so the just-enabled feature reported itself disabled.
- Bound the small-ring stepper to the large ring so small can't exceed large
  (which inverted the ratio and made the shift a no-op).
- Error-handle the fire-and-forget front-shift combo so a throw is recorded
  instead of becoming an unobserved async error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 19:58:26 +02:00
Jonas Bark
ff57b005d5 feat(shifting): show 2×N gear position when the front derailleur is active
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>
2026-06-26 15:02:40 +02:00
Jonas Bark
c68ef13971 feat(6.2): make Record Screen a Pro-only action (proGuard + editor badge) 2026-06-24 20:28:38 +02:00
Jonas Bark
59467b5a56 refactor: remove dead supportsNativeFrontShift getter
Re-introduced by a merge; the forward path emits the both-shifters combo
regardless of app, so the capability flag is unused.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 20:27:36 +02:00
Jonas Bark
42c246799d Merge feat/screen-recording into 6.2: screen recording action (Android + macOS) + changelog 2026-06-24 20:21:47 +02:00