Commit Graph

129 Commits

Author SHA1 Message Date
Jonas Bark
20788e46b6 fix(requirements): stop the permission sheet opening for a granted permission
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>
2026-08-21 08:55:04 +02:00
Jonas Bark
2a9ae6962b fix(onboarding): per-device contours under their rows, firmer pull-to-dismiss
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>
2026-08-10 10:50:33 +02:00
Jonas Bark
9f4f968b49 fix(onboarding): pull-down past scroll top dismisses the paywall sheet, X removed
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>
2026-08-10 10:42:43 +02:00
Jonas Bark
a1916387a0 feat(onboarding): design fade-up entrance per step, onboarding-scoped mobile toast lift
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>
2026-08-10 10:30:40 +02:00
Jonas Bark
6b49256d58 fix(onboarding): Local stays off when permissions denied, real paywall, mobile toasts above footer
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>
2026-08-10 10:21:19 +02:00
Jonas Bark
035ed9a9da feat(onboarding): overview-style animated buttons on the contour, toasts top-right
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>
2026-08-10 09:59:21 +02:00
Jonas Bark
7e4f67642d feat(connection): enableLocalControl helper for inline enabling
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRVXtrmcgtKKz46AVDyqQp
2026-07-02 08:51:41 +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
c682be43bc fix(ui): guard async setState/context against disposed widgets
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>
2026-06-25 08:16:08 +02:00
Jonas Bark
8bb86dce17 perf: open support chat instantly; gather diagnostics in background
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.
2026-06-22 17:00:17 +02:00
Jonas Bark
6e0861e556 Name the trainer app and show its transport in connection alerts
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>
2026-06-14 21:22:59 +02:00
Jonas Bark
60ba3121c6 animations 2026-05-25 20:13:08 +02:00
Jonas Bark
6f6d98a311 make new support replies more prominent
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>
2026-05-17 17:41:49 +02:00
Jonas Bark
f28c175a48 show toast when activity tab isn't opened 2026-05-13 19:57:21 +02:00
Jonas Bark
a335694f0a UI fixes 2026-05-13 09:45:09 +02:00
Jonas Bark
390d09b964 UI adjustments, add screenshot to support 2026-05-13 09:05:48 +02:00
Jonas Bark
1554ac0788 fix gear change buttons 2026-05-10 11:10:22 +02:00
Jonas Bark
3d9daad0a4 UI fix 2026-05-07 15:27:24 +02:00
Jonas Bark
9771d046fe show support chat indicator 2026-04-28 08:57:46 +02:00
Jonas Bark
e999795655 feat: surface unread support-chat replies on the HelpButton
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>
2026-04-28 08:44:01 +02:00
Jonas Bark
30c4ae420b Merge branch 'claude/integrate-support-chat-qlJRP' into feat/proxy-device-details-page
# Conflicts:
#	lib/i10n/intl_de.arb
#	lib/i10n/intl_en.arb
#	lib/i10n/intl_es.arb
#	lib/i10n/intl_fr.arb
#	lib/i10n/intl_it.arb
#	lib/i10n/intl_pl.arb
#	lib/pages/proxy_device_details.dart
#	lib/pages/trainer_feedback.dart
2026-04-27 19:26:52 +02:00
Jonas Bark
6dd0dd92a1 Support UI adjustments 2026-04-27 19:20:28 +02:00
Claude
14cbfb9b58 feat: replace trainer feedback and mail support with chat
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
2026-04-27 08:18:23 +00:00
Jonas Bark
e30389d53d i18n: extract miscellaneous hardcoded strings across pages
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>
2026-04-26 13:32:57 +02:00
Jonas Bark
2071719fbd UI adjustments 2026-04-26 09:44:56 +02:00
Jonas Bark
642fc754a1 UI adjustments, BLE advertisement fix 2026-04-26 09:14:00 +02:00
Jonas Bark
b36a07a142 chore: drop flow-row painters and Lottie assets 2026-04-25 21:09:42 +02:00
Jonas Bark
98b239c140 adjustments 2026-04-24 13:06:07 +02:00
Jonas Bark
2c41db14cc feat(controller): quick hover-grow animation on controller buttons 2026-04-24 13:02:59 +02:00
Jonas Bark
21ddf8ba47 feat(controller): elevate assigned buttons with a drop shadow 2026-04-24 11:42:27 +02:00
Jonas Bark
4457ccb6cf feat(controller): button.icon centred; action icon as top-right badge 2026-04-24 11:38:33 +02:00
Jonas Bark
243b4c0db4 fix(controller): contrast-aware icon/text color against button background 2026-04-24 11:29:59 +02:00
Jonas Bark
86653851ce feat(controller): tap-to-edit on AnimatedButtonWidget 2026-04-24 10:50:19 +02:00
Jonas Bark
4842ec90cb feat(controller): bigger button, initials label, action-icon overlay 2026-04-24 10:37:35 +02:00
Jonas Bark
924138d1aa ui adjustments 2026-04-23 12:02:18 +02:00
Jonas Bark
25268df00d refactor(setting-tile): add onTap field; use Button.card for hover feedback
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.
2026-04-21 09:14:53 +02:00
Jonas Bark
defc167446 UI adjustments 2026-04-16 13:22:07 +02:00
Jonas Bark
be4a911535 feat(ui): add StepperControl reusable widget 2026-04-15 21:07:07 +02:00
Jonas Bark
04d30ac556 resolve https://github.com/OpenBikeControl/bikecontrol/issues/337 2026-04-12 11:19:25 +02:00
Jonas Bark
aec6348939 connection method adjustments 2026-03-25 13:12:11 +01:00
Jonas Bark
cfcdb0203f UI adjustments 2026-03-25 11:28:03 +01:00
Jonas Bark
9dee28bcdd add blog posts to BikeControl 2026-03-25 10:17:08 +01:00
Jonas Bark
5ed2bce59b revise connection methods 2026-03-25 09:27:37 +01:00
Jonas Bark
dada80c188 refactor lane animation #3 2026-03-13 09:19:17 +01:00
Jonas Bark
7f3b01a53e refactor lane animation #2 2026-03-13 09:13:47 +01:00
Jonas Bark
76470117e4 refactor lane animation #1 2026-03-13 08:58:47 +01:00
Jonas Bark
135419e817 updated screenshots 2026-03-12 11:57:36 +01:00
Jonas Bark
6435be973f new ui #19 2026-03-12 10:11:17 +01:00
Jonas Bark
0e22d35076 new ui #16 2026-03-12 09:35:00 +01:00
Jonas Bark
0bb5f89457 new ui #17 2026-03-11 20:31:27 +01:00