Commit Graph

38 Commits

Author SHA1 Message Date
Jonas Bark
8a2d83139b feat(trainer): cycle the bridge connection when the control protocol changes
Trainers latch their control session to the protocol live at connect
time, so a switch only takes real effect on a fresh connection (Jonas
verified on hardware via the manual Bridge disconnect/reconnect). Both
switch sites — the VS-options selector and the self-test verdict CTA —
now run ProxyDevice.reconnectUpstream(), which mirrors the
ConnectionCard cycle and waits for the reseeded definition. Inert picks
(same effective delivery) skip the cycle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 15:33:57 +02:00
Jonas Bark
eed0651cd8 test(self-test): drain FTMS control-grant timer in single-protocol selector test
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 15:17:09 +02:00
Jonas Bark
253cc0557b Merge self-test: resistance self-test + control-protocol delivery toggle
# Conflicts:
#	prop
2026-08-20 15:15:45 +02:00
Jonas Bark
1d1a0dbf72 feat(click v2): keep the right puck awake, and say when it can't
The right puck switches itself off after a minute of not being used.
BikeControl now prevents that on its own, with no button to press. The
sequence lives in prop; this side supplies what only it knows and shows
the rider the one case they can fix.

- the gate reads raw adverts, not the device list: the sibling only has
  to be nearby, and a left puck the rider ignored — every left puck in
  right-side-only mode — still counts. Discovery is also the retrigger,
  since an ignored puck never completes a handshake
- an optional step on the controller card, and a note on the right puck's
  own card, when no left puck is in range. An offer, never a blocker
- drops the D-pad line from "use the right side only"

Fixes a related bug: the controller link counted every undone step,
optional or not, so an optional offer alone turned a working controller
amber and held back "Ready to ride". The other two links already
excluded optional steps.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 14:55:15 +02:00
Jonas Bark
e1703b6f59 fix(self-test): surface precheck refusals on reruns; drop unused import
- self_test_card.dart: a precheck refusal on "Run again" now clears
  _engine inside the same setState. _body only renders _idle (where
  _refusal is shown) when _engine is null, so a refusal raised while a
  finished verdict engine was still attached rendered invisibly behind
  the verdict view — the rerun CTA silently no-opped.
- settings.dart: add missing static to _selfTestKey, matching its
  sibling key helpers.
- self_test_harness_test.dart: drop unused self_test_harness.dart import.

Adds a widget test: complete a run to a verdict, attach the trainer
app, tap "Run again" — the trainer-app refusal is now visible and no
new run starts.
2026-08-20 14:52:04 +02:00
Jonas Bark
e6407714a9 feat(self-test): offer switching the control protocol from the verdict
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 14:16:55 +02:00
Jonas Bark
0191fcc990 feat(trainer): control-protocol selector in VS options, persisted per trainer
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 13:38:32 +02:00
Jonas Bark
331b864e15 feat(self-test): verdict CTAs — overlay reveal, mode switch, support hand-off
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 13:11:42 +02:00
Jonas Bark
d53a063ab8 feat(self-test): SelfTestCard with guided run flow on the trainer page
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 12:32:03 +02:00
Jonas Bark
12b51447a3 fix: sending a screenshot without text no longer crashes
SupportComposer._submit caught the send failure to restore the text and
the staged attachment, then rethrew. The send button drops the returned
Future, so that rethrow escaped into the zone as an unhandled error and
was reported as "App crashed".

- _submit is terminal now, and the button invokes it via unawaited() so
  no Future is silently dropped. The page-level rethrows stay: they are
  how the composer learns it must restore.
- The page-level send catches forward through recordError
  ('support.chat.send') — this path had no crash reporting at all.
- Interim client mitigation for image-only messages: substitute a
  localized placeholder body when the body is empty but an attachment is
  present, since the send-support-message edge function still rejects an
  empty body.
- A failed send no longer orphans the uploaded blob: the successful
  upload is retained against the staged attachment the composer restores,
  so a retry re-uses it instead of uploading a second copy (there is no
  client-side delete for the attachment bucket).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 13:14:18 +02:00
Jonas Bark
dc715c9cf2 feat(home): offer local control too, and make the offers act rather than point
Three things a rider asked for, all on the same idea: an offer's button should
do the thing, and nothing should be labelled optional that is plainly working.

- "Enable overlay" now enables the overlay and *then* opens the Overlay
  section. A button that only navigates to another switch is the toast
  problem again, one tap further along. The enable path moved into a shared
  enableTrainerOverlay(), run by both the section's switch and the step, so
  the two cannot drift; it persists the flag only when the platform actually
  put something on screen, so declining Android's draw-over prompt can't
  leave a setting claiming an invisible overlay. A refusal says why, and the
  page opens anyway — that is where the permission tile lives.

- New optional step on the app card: "Add keyboard and mouse actions",
  offered when Local is available on this device but switched off (target is
  This device, per CoreLogic.showLocalControl) and an app is chosen. Local is
  not a way to reach the app, it is a way to do more to it — keystrokes and
  clicks the button editor only offers once it is on — and a rider who never
  turns it on never learns those actions exist. Its button runs the existing
  enableLocalControl(), permission sheet and all.

- The card header drops its OPTIONAL tag once the link is off "off". The
  link stays optional underneath, which is what keeps a trainer nobody owns
  from blocking "Ready to ride", but the word is there to reassure someone
  looking at an empty slot — not to caption connected hardware.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 14:52:46 +02:00
Jonas Bark
510a85ac20 Merge branch '6.4' of github.com:OpenBikeControl/bikecontrol into 6.4 2026-08-16 14:35:31 +02:00
Jonas Bark
1a3fea5fa6 fix instructions 2026-08-16 14:35:27 +02:00
Jonas Bark
f0d2d1253b feat(home): make the gear overlay an optional checklist step, not a toast
Riders keep writing in about the wrong gear number in MyWhoosh and others.
The answer has always been the gear overlay, and the one-time toast that said
so was the wrong messenger: it fired once, mid-connect, and scrolled away
before anyone read it.

Move the offer onto the trainer card, where it stays until it is acted on.

- New SetupStepId.trainerGearOverlay, last in the trainer checklist and
  offered only once the bridge is up, the trainer app runs on this device
  (Target.thisDevice), the platform can draw an overlay, and a Virtual
  Shifting session is producing a gear to draw. Ticks off — and leaves the
  card — as soon as the overlay is enabled.
- Its button reads "Enable overlay" and deep-links to the trainer detail
  page's Overlay section, which owns the permission and PiP flows.
- SetupStep gains an `optional` flag so an offer stays an offer: it does not
  colour the card, does not count towards the banner's steps, and never
  stops "Ready to ride". Marked OPTIONAL on its own line, via the tag the
  card header already wore (now a shared OptionalTag).
- Drops OverlayConnectHint, its ProxyDevice listener and the
  overlay_connect_hint_shown flag. The two l10n strings it owned are reused
  as the step's hint and button label in all six locales.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 13:03:56 +02:00
Jonas Bark
c66cac4591 feat(home): the Click V2 setup step, status warning glyphs, and an unused trainer's pitch
Three chain-card changes. They arrived as one commit because the first
was still uncommitted when the others landed on top of it.

**A Click V2 waiting for its unlock-mode choice.** Reported edge case: a
brand-new install where the wizard was skipped or finished on another
controller leaves clickV2OnboardingDone false, so a Click V2 switched on
afterwards is discovered, in range, healthy — and deliberately not
connected. The chain had no way to say "we are choosing not to connect
this", fell back to presence, and told the rider their controller had
never been paired and should be brought back into range, about a device
switched on beside them.

That step now REPLACES the checklist rather than joining it. Putting it
first would have left the false steps sitting below it; every other step
is unknowable until the device is allowed to connect. Once the choice is
made the normal checklist returns. The card's action reads "Set up" and
opens the explainer, since the choice is what releases the controller
into the connect queue.

**Warning glyphs beside the status.** A flat battery, a pending firmware
update or a signal about to drop are qualifiers on "Connected" — it
works, but not for much longer, or not well — and the card said nothing.
They show only when something is actually wrong, so a glyph appearing
means something. Thresholds are the device page's own (20%, -70 dBm)
rather than new ones, so the two screens cannot disagree about "low".

**The bridging pitch on an unused trainer.** A trainer that is here but
has never been connected now shows what bridging it would buy instead of
an empty card; that list already existed on the device page, and this is
exactly the rider who has not seen it. Dropped once bridged, where live
numbers are the useful content, and dropped for one that broke
mid-session, where it would read as if nothing were wrong.

Not covered by tests: which badges get chosen, and when the feature list
appears — both are private methods on _HomePageState, which has no
widget test to hang a case on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 19:41:37 +02:00
Jonas Bark
37d01c734a fix(home): SRAM's setup outranks mapping — it is what makes the buttons
The guided setup sat after "assign an action to a button", so a fresh
derailleur told the rider to map buttons it does not yet send. Setting
up is what produces them.

The test that was meant to cover this passed for the wrong reason: the
controller() helper defaults to hasMappedButtons: true, so the mapping
step was already ticked and never competed for the active slot. The
moment buttons are not mapped — every real fresh SRAM — mapping won. The
new case pins hasMappedButtons: false and fails on the old order with
exactly the reported symptom.

Also corrects the comment on that block, which described where the step
sat rather than why.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 19:07:02 +02:00
Jonas Bark
2254d016cb feat(home): SRAM's guided setup is a step, not an empty card
A SRAM derailleur whose own shifting is still enabled is connected and
sends nothing at all. The chain said so with a blank grey panel and no
step — the one thing standing between the rider and a working shifter
was the one thing the card did not mention.

It is a step now, carrying the same wording the device card's own button
uses ("Set up SRAM control"), and "Show me how" opens the same guided
sheet the device card and the onboarding wizard run. It sits BEFORE the
unlock step: a derailleur that sends nothing cannot be helped by
anything about what it sends.

The id and the input field are named for SRAM rather than generically.
A generic controllerGuidedSetup would carry SRAM's wording, and the next
device with its own guided setup would silently inherit a label that
does not describe it — better that it gets its own id.

Checked whether anything else needs one: onboardingDeviceNeedsSetup is
the complete list of guided setups in the app, and it has exactly two
branches. The Click V2's is already on the chain via the explainer and
today's unlock step. SRAM was the only gap.

The empty panel is gone too. A device with no contour and no buttons
discovered yet rendered as a bare grey box that looked like a failed
render; nothing to draw is not the same as an empty box to draw it in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 18:41:51 +02:00
Jonas Bark
b2e210e09d feat(onboarding): every step reveals in reading order, not all at once
The welcome screen already arrived a piece at a time while every other
step faded in as one block. What made the welcome screen feel considered
was never the fade — the other steps had one too — it was the stagger:
content arriving in the order it is meant to be read, so the eye is led
down the page instead of being handed everything and left to find the
starting point.

_Reveal was a private near-duplicate of OnboardingFadeUp (520ms/14px
against 300ms/12px). Rather than copy a third variant around the step
files, both are replaced by one OnboardingReveal, and the page-level
blanket fade gives way to a KeyedSubtree — it would only have competed
with the per-child reveals, while the re-key still re-mounts each screen
so it reveals again on every step change.

Eleven bodies across the six steps, including the controller step's four
phases and the trainer step's three states.

Two judgement calls: Gaps pass through unwrapped, because animating empty
space buys nothing and leaving it in place from the first frame means the
column's layout is settled before anything fades in — nothing shifts under
the rider's eye, and the cadence stays even. And the delay stops growing
after eight items: the controller step's list grows with every device in
the room, and uncapped the last entry on a busy screen would arrive a
second and a half after the first, which a rider reaching for it would
watch move.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 18:25:12 +02:00
Jonas Bark
c69c0819ab fix(home): show the unlock deadline, and fix "Unlock again" on the details page
Two things.

The unlock step now says when the unlock runs out rather than just
ticking. That makes it the one done step in the chain carrying detail,
deliberately: an unlock expires, so a bare tick would hide that this
comes back tomorrow.

It also has to distinguish two states the device page already drew
apart. BikeControl cannot read a Click V2's lock state back — after an
unlock it knows when the 24 hours ought to run out, but not whether the
unlock took — so SetupStep.uncertain carries that, and the step reads
"Likely unlocked until Friday, 14:30" instead of claiming more than is
known. The date is preformatted at the page: the chain model stays free
of locales and date formats, which is what keeps it testable without a
loaded locale.

ZwiftClickV2 grows an `unlockedUntil` getter rather than the page
reaching into propPrefs. The +24h arithmetic already existed twice in
that file, and widening its `prop` import is its own hazard — that
package exports a `Set` which shadows dart:core's.

Separately, "Unlock again" on the controller details page threw "No
DrawerOverlay found in the widget tree" and did nothing. The page wraps
itself in a DrawerOverlay, but _buildDeviceCard and _buildActions are
methods on the State, so the context they close over is State.context —
which sits ABOVE the overlay its own build creates. Two callers were
hitting it, "Unlock again" and the device-script drawer. Both now build
from the context under the overlay, the pattern onboarding_page already
documents for the same trap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 17:46:15 +02:00
Jonas Bark
f6ab5152ec feat(home): show unlocking as an actual step on the chain
A Zwift Click V2 on the legacy unlock method gave the rider nothing to
go on. Zwift locks it to their own app, so it stops sending button
presses about a minute after the last one — which from the chain looked
exactly like a flat battery or a controller out of range, because the
card said nothing at all.

It is a step now, so it ticks like the rest of the checklist and the
card sits amber rather than green while it is outstanding. Last in the
list, since unlocking needs the controller present.

`ControllerInput.unlocked` is nullable rather than a bool: null means
unlocking is not a concept for this controller and the card omits the
line entirely, the same way requiresBluetooth already omits a Bluetooth
step that would never mean anything. That distinction is the whole
design of the field — the step must appear for the legacy unified
controller and for the left puck on unlock-with-Zwift, but not for the
left puck on the restart workaround (it reboots itself; "open Zwift"
would be wrong advice) and not for the right puck, which Zwift never
locked.

The instructions button routes on the active step: a locked Click opens
the unlock flow for that exact device rather than the generic "can't
find your controller" help, which is the answer to a different question.

The hint says why, not just what — riders who do not know Zwift locks
the hardware read "unlock" as a paywall.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 17:22:39 +02:00
Jonas Bark
1b72284c41 feat(home): show only the steps still to do
A ticked step has said everything it can the moment it ticks. Keeping it
on screen buries the one line that still matters under a list of things
that don't — and a card whose work is finished was spending a whole row on
telling the rider so.

Cards now render their outstanding steps and nothing else, and the
accordion goes with them: no summary row, no "N of M steps done", no
chevron, no tap to unfold a list of completed work. A finished card is
just its header. The banner already carries the count across the whole
chain, so the per-card tally was saying it twice.

startsExpanded gives way to pendingSteps in the model — the card had no
open/closed state left to remember. The first outstanding step is still
the active one and still carries the sole instructions button. The
AnimatedSize stays: when the last step ticks the card folds to its header
as a movement rather than a jump.

chainStepsDone and chainAllStepsDone were the accordion's only copy, so
they come out of all six locales rather than linger as strings nothing
renders.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 15:33:22 +02:00
Jonas Bark
70f0532da1 feat(home): show the trainer's live values whenever it is connected
Watts and cadence come off the trainer, not off the bridge, so they are
just as real — and just as worth showing — before BikeControl starts
bridging it. Two gates were hiding them: the readout itself required
isBridged, and the builder only passed metrics through on a fully ready
link, so relaxing either alone would have changed nothing.

The readout moves onto ProxyDevice as liveReadout rather than being
reimplemented on the home page, because the home page's version only read
fitnessBike — in proxy mode the numbers live on ProxyBikeDefinition, so it
would have shown an empty line exactly where a proxied trainer's values
belong. It now mirrors showMetaInformation: proxy definition first, then
the fitness bike, plus the gear or ERG target when BikeControl computes
one.

Showing the numbers exposed a contradiction in the status line: "Not
connected · 250 W · 90 rpm" asks the rider to resolve something the app
should have resolved for them. A trainer whose Bluetooth link is up but
which isn't bridged now reads "Connected", which is true, and the Connect
action carries the rest. "Not connected" is left to mean a trainer that
genuinely isn't there. The bridged states keep onboarding's wording.

The metrics ticker was gated on isBridged too, so the numbers would have
been frozen in precisely the state this change exists to show.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 13:50:26 +02:00
Jonas Bark
16ad75336d fix(home): pair-as-trainer instructions, and finish the onboarding audit
"Waiting for MyWhoosh to pick it up" opened the trainer picker, whose
bridged branch renders "Trainer connected" — an answer to a question the
rider wasn't asking. The trainer IS connected; the app hasn't picked the
bridge up. The connection step's pairing block is extracted as
OnboardingPairAsTrainerCard — bridge entry, the power/controllable/cadence
slot rows, the warning about pairing the bare trainer — and both the
wizard and the sheet render it. Routing is on the card's active step, so
the three trainer problems get three answers: not bridged opens the
picker, bridged-but-unclaimed opens the pairing instructions, ready opens
troubleshooting.

Auditing the rest against onboarding turned up two more.

isBridged now lives on ProxyDevice as a single getter that onboarding and
the home screen both call, so the definition cannot drift again. Three
places here were still keyed on the Bluetooth link rather than the bridge:
choosing which trainer the card shows, gating the metrics ticker, and
deciding whether the trial's virtual-shifting meter applies. Each was
measuring or picking the wrong thing.

The worse one: a remembered trainer mapped to amber, and on an optional
card amber blocks "Ready to ride" — so a trainer that was not in the room
would have held the banner hostage. Because the card inferred "bridged"
back out of its own status instead of asking the device, it would also
have claimed to be bridged and offered Edit. An uncommitted trainer now
rests at off, and bridged comes from the device.

Verified equivalent while in there: connectedTrainerConnections.isNotEmpty
is exactly onboarding's .any((c) => c.isConnected.value), since the list is
already filtered, and appHoldsBridge is the same isConnectedListenable the
onboarding summary uses to choose between "Bridged" and "Waiting for {app}".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 13:26:14 +02:00
Jonas Bark
5f4ce5bee9 fix(home): trainer card follows onboarding's definition of connected
The trainer card read ProxyDevice.isConnected — the Bluetooth link to the
trainer — and called that "connected". Onboarding doesn't: a trainer is
bridged when isStartedListenable || isConnectedListenable, and the app
holds it when isConnectedListenable. So a trainer that was genuinely
connected, with a bridge the app hadn't picked up, fell through to the
catch-all label and reported "Not connected" about the one thing that was
working. Onboarding is the source of truth and the card now mirrors it:
Bridged / Waiting for {app}… / not connected, in onboarding's own words.

"Gears set up" is gone. Gear ratios are a preference with a working
default (ShiftingConfig.defaults), so no rider is ever blocked waiting to
set them up, and presenting them as an unticked box invented work that did
not exist. The two steps are now onboarding's two facts — the bridge is
running, and the trainer app picked it up — and the second names the exact
entry to look for ("KICKR CORE - BikeControl"), which is what riders miss.

Whether the bridge is running and whether the app holds it are
ValueNotifiers on ProxyDevice rather than events on the connection stream,
and nothing here listened to them: the card would have held a stale status
until something else forced a rebuild. HomePage now subscribes per proxy
and re-subscribes as trainers appear.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 12:57:56 +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
acea58806a fix info button 2026-07-09 20:48:18 +02:00
Jonas Bark
120f80b9bb cleanup 2026-06-10 15:19:35 +02:00
Jonas Bark
60817dabee Smart Trainer card: stable keys, reconnect rebinding, awaited mDNS stop, No-connection UX
- ConnectionCard: "No connection" shows "Not connected" instead of the
  bridge connect instruction; switching modes keeps the bridge accordion
  mounted with inline progress (drops the "Connecting in ... mode"
  placeholder card).
- proxy_device_details: stable keys on ConnectionCard / LiveMetricsSection
  / MiniWorkoutCard. On (dis)connect, conditional siblings toggle both
  above (FTMS warning) and below (gear/settings/VS-notice) these widgets,
  trapping the unkeyed ones in Flutter's reconciliation middle and
  remounting them — which collapsed the accordion and rebuilt the page.
- ProxyDevice: re-establish the emulator-state bindings on every
  (re)connect (_rebindEmulatorState in startProxy). The in-place
  "No connection" disconnect detaches them on a reused ProxyDevice, so
  reconnecting Virtual Shifting left the UI stuck on "connecting" while
  the emulator was actually connected.
- ProxyDevice.disconnect/switchRetrofitMode/handleServices: await the
  emulator stops so mDNS/TCP is torn down before reporting disconnected,
  and log the previously swallowed detach errors.
- connection.dart: log the discovered device name instead of its runtime
  type.
- Bump prop for the awaited mDNS teardown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 14:06:12 +02:00
Jonas Bark
e79edf4809 UI adjustments 2026-06-10 08:53:30 +02:00
Jonas Bark
e8d978b7e1 UI adjustments 2026-04-29 08:33:26 +02:00
Jonas Bark
a519df280f test: cover consolidated proxy/VS connection picker 2026-04-25 20:46:07 +02:00
Jonas Bark
f49ccfa42c feat(proxy-details): show remaining Bridge minutes in Go Pro banner 2026-04-23 10:57:09 +02:00
Jonas Bark
2b4211f0cd fix(proxy-details): gate Pro notice on FitnessBikeDefinition, move IAP safety to IAPManager 2026-04-23 09:47:40 +02:00
Jonas Bark
47f9c75acc feat(proxy-details): show virtual-shifting Pro notice + Go Pro button 2026-04-23 09:41:39 +02:00
Jonas Bark
860c9b9090 feat(connection-card): disable unsupported connection modes per trainer app 2026-04-23 09:17:09 +02:00
Jonas Bark
33c28ce55a test(proxy-details): add smoke widget test 2026-04-15 22:03:04 +02:00