Commit Graph

521 Commits

Author SHA1 Message Date
Jonas Bark
5c44ca43f2 UI adjustments 2026-07-09 15:48:34 +02:00
Jonas Bark
1ba08d0527 refactor(sram): split setup-sheet UI out of the device file
sram_axs.dart had grown to ~990 lines by carrying the whole guided
setup/restore sheet. Extract it in two layers:

- lib/widgets/guided_operation_sheet.dart — reusable, feature-agnostic
  building blocks (StepRail, StageBadge, ProgressChecklist) any staged
  setup flow can compose.
- sram_setup_sheet.dart — the SRAM-specific composition, copy, palette
  and the AXS "press & hold" hero.

The device file (446 lines now) keeps only device/BLE logic and the
trimmed panel. No behaviour or pixels change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 15:15:28 +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
69fbcf607e feat: check Shorebird beta track for beta_access users
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 11:07:42 +02:00
Jonas Bark
48e80d2925 feat(emulation): Emulation card on controller settings page 2026-07-02 10:11:49 +02:00
Jonas Bark
7f3af28bf7 feat(emulation): replace debug Continue button with Emulate device menu
Replaces the hard-coded debug Continue menu item with a declarative submenu
listing every emulation profile. Uses core.emulation.start() and
core.connection.performScanning().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:03:27 +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
8b19b2ad3f refactor(phone-steering): replace steering-wheel gauge with compact horizontal gauge
Renames SteeringWheelGauge → SteeringGauge and rewrites the painter as a
horizontal bar with a sliding knob and glowing end zones, saving vertical space
on the device card footer. Updates the overview.dart usage and snapshot tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 11:25:42 +02:00
Jonas Bark
8f1cdaf899 fix(phone-steering): place gauge readout below the wheel; faithful calibrating snapshot
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 11:08:40 +02:00
Jonas Bark
7e1bdaa7c9 feat(phone-steering): add calibratePhoneSteering action + steering l10n 2026-06-30 10:44:45 +02:00
Jonas Bark
fb18bfa829 feat(phone-steering): add SteeringWheelGauge widget + steerSideFor helper 2026-06-30 10:38:58 +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
82917c3c9d fix(overlay): widen drag hit area; fix PiP show/hide race; orientation-safe DI detection
- The floating overlay's drag handle now fills the full 24px trailing slot
  instead of only the 14px icon.
- iOS overlay: arm PiP only while still showing and tear it down if a hide
  lands mid-start(), so a show/hide race can't orphan a frozen PiP window.
- Detect Dynamic Island via the max safe-area inset instead of the top inset,
  which collapsed in landscape and could auto-start an unwanted PiP.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 19:58:26 +02:00
Jonas Bark
32bfe2add7 fix(overlay): centre the gear value and even out padding
Equal-width leading/trailing slots keep the primary readout centred
whether or not the app icon / drag handle is shown; the container's
horizontal padding is now symmetric and the bottom row no longer carries
an extra inset — so the value lines up over the metrics row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 15:57:49 +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
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
16ab318877 feat: show diagnostics block above the Logs page with refresh + share 2026-06-22 10:38:10 +02:00
Jonas Bark
788bdc5436 feat: embed diagnostics block in debugText; skip discovery on crash path 2026-06-22 10:32:40 +02:00
Jonas Bark
843f798537 cleanup 2026-06-18 16:30:01 +02:00
Jonas Bark
6778c1e45b feat: optimize Zwift Click V2 left/right experience
- Make the split left/right controllers available to everyone: replace the
  isPro gate in the device factory with a "Use new unlock method" setting
  (default on); off falls back to the legacy unified ZwiftClickV2.
- Add the "Use new unlock method" toggle to all three Click V2 settings panels;
  flipping it reconnects the Click as the new/legacy representation.
- Fix the "Unlock again" button placement: on narrow side-by-side cards the
  action now drops below the status text instead of squeezing it.
- Add "Use the right side only" to the right side when a left side is connected:
  ignores the left side (reversible via Ignored Devices) and remaps the active
  keymap so + shifts up and B shifts down.
- Localize new strings (de/es/fr/it/pl; en already present) and add
  factory/settings unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-17 19:50:08 +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
5dbd091f27 Fix crash in Go Pro dialog when opener is unmounted
The dialog builder captured the caller's BuildContext for l10n lookups
and the purchase flow. When the widget that opened the dialog was
removed from the tree while the dialog was still showing (e.g. a
ConnectionCard remount), any rebuild of the dialog hit
AppLocalizations.of on the defunct context and crashed the isolate
with "Null check operator used on a null value" (l10n.dart:50 via
go_pro_dialog.dart:43, seen on Windows 6.0.0).

Use the dialog's own builder context instead, and guard the
post-purchase pop with a mounted check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 21:41:23 +02:00
Jonas Bark
365893256d UX 2026-06-07 08:32:14 +02:00
Jonas Bark
27919882b4 Fix UX, translation 2026-06-06 20:20:29 +02:00
Jonas Bark
8f221245cc new unlock method 2026-06-06 19:54:00 +02:00
Jonas Bark
e518c47a28 animations 2026-05-31 10:40:28 +02:00
Jonas Bark
60ba3121c6 animations 2026-05-25 20:13:08 +02:00
Jonas Bark
218a7e2e98 zwift adjustments 2026-05-21 22:01:14 +02:00
Jonas Bark
51f2455166 rouvy mode 2026-05-21 20:34:51 +02:00
Jonas Bark
0a76de870a refactor: ProxyDevice owns trainer identity and def construction
handleServices builds both ProxyBikeDefinition and
FitnessBikeDefinition up front and attaches to the right emulator
based on retrofit mode. ProxyDevice provides advertisementName +
mdnsTxt to ftmsEmulator/_proxyEmulator via the new startServer
parameters. Drops DirconEmulator state mirroring that's no longer
needed. ZwiftClickV2 no longer calls startServer (click-alone
path removed per prop strip). UI consumers route through
ProxyDevice.advertisementName and device.retrofitMode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 00:08:33 +02:00
Jonas Bark
d30c685665 fix(menu): show real FBD type in debug menu after activeDefinition refactor
After Task 5, activeDefinition returns the composite, so the debug
menu's def.runtimeType always showed 'CompositeBleDefinition' and the
FBD gear/trainer-mode info was hidden (the is-check failed). Route
through emulator.fitnessBike to restore the prior display.
2026-05-20 18:00:12 +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
7b9296d616 UI fix 2026-05-14 08:37:33 +02:00
Jonas Bark
f28c175a48 show toast when activity tab isn't opened 2026-05-13 19:57:21 +02:00
Jonas Bark
353a1f98ba MyWhoosh Windows workaround 2026-05-13 13:24:50 +02:00
Jonas Bark
39a6265b20 changelog, paywall adjustment 2026-05-13 11:56:12 +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
75dd10371a show default OBP actions 2026-05-11 20:53:25 +02:00
Jonas Bark
c771329f79 fix dynamic island 2026-05-11 14:13:19 +02:00
Jonas Bark
9f4e038df3 fix multi window macOS 2026-05-11 10:02:09 +02:00
Jonas Bark
1554ac0788 fix gear change buttons 2026-05-10 11:10:22 +02:00
Jonas Bark
bbbc0d763a overlay: remove TrainerOverlayHost widget
The host was only needed to swap the main window's UI into compact
overlay mode. With a real second window, the main window tree is
unchanged. Remove TrainerOverlayHost from _Starter's child in main.dart
and delete the file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:12:41 +02:00
Jonas Bark
277cbd4e7e feat(overlay): mount TrainerOverlayHost at app root for desktop compact mode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:07:35 +02:00
Jonas Bark
4444196175 refactor(overlay): rename OverlayState -> TrainerOverlayState to avoid Flutter collision
Removes the need to `hide OverlayState` on shadcn_flutter imports in
trainer_overlay_view.dart and its widget test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 23:06:24 +02:00
Jonas Bark
d967c4f84c feat(overlay): TrainerOverlayView shared widget
Adds TrainerOverlayView — a self-contained, platform-agnostic widget that
renders gear N/M, mode pill (ERG/SIM), and optional power/cadence metrics.
Wired via ValueListenable<OverlayState>; onModeToggle/onDragStart are nullable
for Android isolate compatibility. Covered by 3 widget tests (TDD).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 23:04:21 +02:00
Jonas Bark
4cf347580d warn when connecting smart trainer 2026-05-07 15:57:02 +02:00
Jonas Bark
3d9daad0a4 UI fix 2026-05-07 15:27:24 +02:00
Jonas Bark
6c9e2d9fe8 cleanup 2026-05-04 12:06:56 +02:00