Toggling the "Direct connection" card could wedge: the sheet opened for a
permission that was already granted, and then sat there, because PermissionList
only re-probes on app resume.
ConnectionMethod probed one requirement list, awaited, then re-read
`widget.requirements` on the far side of the gap:
Future.wait(widget.requirements.map((e) => e.getStatus())).then((_) async {
final notDone = widget.requirements.filter((e) => !e.status).toList();
The tiles build that list inside `build()`, so any rebuild in that window hands
back fresh objects whose mutable `status` is still false — and these tiles
rebuild on every isConnected/isStarted tick, plus onChange's own setState. The
probe result was read off objects that were never probed.
Capture the list once per operation instead. This was pre-existing and not
specific to Local Network: di2_ble_tile and openbikecontrol_ble_tile pass
getRemoteControlRequirements() the same way, so they had the same latent race.
Also hoist the requirement lists out of build() into State fields across the
five tiles, so a probed `status` is not discarded every frame.
Separately: LocalNetworkRequirement was only wired into the network tiles, so
onboarding, app start and scanning never checked it at all — every one of those
reads getScanRequirements(). Add it there for iOS and macOS. The list is
filtered to unsatisfied requirements, so it surfaces only on an actual denial.
Note for macOS: keyboard-control-only users will now see a Local Network prompt
they do not need. Accepted deliberately in favour of one list over a
platform-split.
The regression test drives the real race — gate the probe, force a rebuild
mid-flight, release — and fails with "Found 1 widget with type PermissionList"
without the capture fix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every connected controller with a layout renders its contour directly
below its own entry card (not just the first one). Sheet pull-to-dismiss
now requires ~90px of accumulated pull past the scroll top (was: any
single overscroll pixel on clamping physics), resetting when the drag
ends or the list scrolls.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
shadcn's drawer dismiss is a raw vertical-drag GestureDetector, so inner
scrollables always win the gesture arena — the package has no scroll-aware
handoff. New SheetPullToDismiss bridges it: at the scrollable's top, a
continued downward drag (clamping overscroll or bouncing negative pixels)
closes the sheet. Reusable for any scrollable bottom sheet.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every step body slides in with the design's bk-fade-up (300ms fade +
12px rise), re-keyed per step and controller phase; static under reduced
motion and screenshotMode so snapshots stay deterministic. Mobile toasts
return to normal bottom placement and are lifted (72px, bottom-center)
only while the wizard is on screen, tracked via an onboardingActive flag
next to screenshotMode.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Enabling Local now re-checks LIVE permission state after the sheet closes
and refuses to enable (and a throwing status check counts as not granted);
the walk test denies the permission via a stubbed channel and asserts the
toggle stays off. 'See Pro & Base options' opens the actual paywall
(showGoProDialog) instead of the subscription/login drawer. Toasts on
mobile (<600px) render bottom-center padded above the sticky footer;
desktop keeps top-right.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Press-a-button-to-continue is gone: presses now flash the matching button
on the controller contour via the same AnimatedButtonWidget the home
screen uses (keymap-aware), and the footer is a plain Continue. Toasts
default to top-right so 'Connecting to…' popups can never cover footer
actions on desktop.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
Symbolicating a Rouvy user's 6.1 crashes (Shorebird patch build_id
4b7026f5fbf44e52452ba9e557c2c5a0) surfaced two "Null check operator used
on a null value" crashes: async UI callbacks running after their widget
was disposed (the user rapidly re-toggled the Zwift BLE option as
advertising kept failing).
- ZwiftTile.onChange: setState() ran after `await stopAllBleConnections`
on an unmounted state -> guard with `mounted`.
- ConnectionMethod: openPermissionSheet(context, ...) and setState() ran
after `await Future.wait(requirements)` on a defunct context -> guard
both async gaps with `context.mounted` (matching the existing guard at
line 315).
The underlying trigger (Zwift emulator "Data too large" advertise failure
on Rouvy) is tracked separately for the 6.2 branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
debugText now runs a multi-second mDNS scan. Stop awaiting it before
navigating — kick it off as a future, open the chat immediately, and let
SupportChatPage await it lazily for the diagnostic preview and at send time.
The "connected"/"disconnected" activity alerts fired when a trainer app
attaches to one of our emulators now name the app ("Connected to Zwift",
"Disconnected from Zwift") and tag the alert with the transport, so the
activity log shows a WiFi or Bluetooth icon depending on how the app is
connected instead of always Bluetooth.
- AlertNotification gains a connectionType field + a connection() factory
that builds the localized, app-named message and tags the transport.
- All 6 emulator call sites (Zwift BLE, FTMS/Rouvy mDNS) route through it,
passing their own type and core.settings.getTrainerApp()?.name.
- ConnectionMethodType.activityIcon maps network -> wifi, else -> bluetooth;
overview threads connectionType through and uses it for the leading icon.
- Reuse existing connectedTo string; add disconnectedFrom (en/de/es/fr/it/pl).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pulsing halo badge, destructive-color icon and border, and a bolded
"Chat with support" menu item when an unread admin reply is detected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a sticky 'support_chat_active' bool to Settings, flipped to true
the first time SupportChatService.openChat succeeds. HelpButton becomes
a StatefulWidget; if the flag is set in initState it kicks off a
background fetchChat() and counts admin-side messages whose createdAt
is later than the chat's lastSeenAt. When at least one is found, a
small destructive-coloured dot appears both on the button's leading
icon (top-right corner) and as the trailing slot of the inline 'Chat
with Support' menu entry.
Opening the chat clears the dot locally and re-runs the unread check
on return so the indicator stays in sync with what the user has now
seen. All checks are best-effort: missing auth, network errors, and
edge-function failures are swallowed and the dot just stays off.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a Supabase-backed support chat that replaces the existing trainer
feedback page and the mail support entry in the help dropdown. The chat
captures the same telemetry snapshot (extracted into a shared
TelemetrySnapshot module) and supports threaded replies and attachments.
- New SupportChatService wrapping the four edge functions plus a signed
URL helper for support-attachments storage.
- New SupportChatPage / SupportThreadPage with composer, attachment chips,
optimistic send, sign-in gate, and pull-to-refresh.
- Help dropdown's Mail entry replaced with "Chat with Support" that
pre-fills debugText() as freetext on the first message.
- Trainer device details "Provide Feedback" button now opens the chat
with TelemetrySnapshot.fromDevice telemetry.
- Login screen gets a subordinate "Don't want to sign in? Write a mail
instead" ghost button (mobile only) that opens the existing mailto.
- Telemetry helpers moved out of the deleted trainer feedback files into
lib/services/telemetry_snapshot.dart; test rewritten for the new class.
https://claude.ai/code/session_0155Bb4kCYaxKh7zQfoQHZET
Pulls 'Open connection settings' (×2 in customize.dart), 'No target
selected' / 'Stay' / 'Leave' / 'Show experimental' /
'Connection Settings' / 'this trainer app' fallback in
trainer_connection_settings.dart, 'Not Supported on Web' toast and
'Recommended' badge in connection_method.dart, and the workout share
text in workout_summary_dialog.dart into the ARB.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the site-specific GestureDetector wrapping the Gear Settings
tile with an onTap on SettingTile itself. When set, the tile renders
via Button.card — giving the user proper hover feedback — instead of
the static Container. Other (non-tappable) tiles keep the existing
Container look.