Commit Graph

48 Commits

Author SHA1 Message Date
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
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
f4c8aba982 feat: overlay hint when trainer app first connects
Nearly every MyWhoosh/Rouvy bridge rider pairs the virtual trainer, then
writes support asking why the gear shown in the trainer app doesn't sync
— trainer apps can't display BikeControl's virtual gears. Surface the
canonical answer (the gear overlay) exactly once, at the moment the
question would otherwise arise: the first time a trainer app connects to
the virtual trainer while the overlay is off.

- OverlayConnectHint fires an AlertNotification (toast + activity-log
  entry) whose button deep-links to the trainer detail page, scrolled to
  the Overlay section (new revealOverlaySection param).
- Hooked on ProxyDevice's device-level isConnected wrapper so it
  survives emulator/mode swaps; gated on an active VS session
  (fitnessBike != null), overlay disabled, and a persisted one-time
  flag (overlay_connect_hint_shown).
- New l10n strings in all six locales.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 14:06:24 +02:00
Jonas Bark
e34953cd32 get rid of vs onboarding 2026-08-11 19:25:41 +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
80cc44cce7 feat: attach full debugText (diagnostics + logs) to device feedback
Drops the standalone services block (debugText already emits it per-proxy)
and adds a mounted guard after the now-slower debugText await.
2026-06-22 10:35:09 +02:00
Jonas Bark
fb84ffbcf1 Merge remote-tracking branch 'origin/6.0.0' into custom-mdns-responder
# Conflicts:
#	lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart
2026-06-11 21:56:19 +02:00
Jonas Bark
22e09bc246 Add first-run Virtual Shifting beta intro on Smart Trainer page
Show a one-time, full-screen explainer the first time the Smart Trainer
page is opened: Virtual Shifting is in beta, works with dozens of trainers
(some not perfectly yet), links to the supported-trainers list, and invites
feedback. Gated by a global 'virtual_shifting_intro_seen' pref and skipped in
screenshot mode. Reuses existing icons only. Strings added in all 6 locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 20:35:36 +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
df18e4ff2f advertisement fix 2026-06-10 11:09:35 +02:00
Jonas Bark
e79edf4809 UI adjustments 2026-06-10 08:53:30 +02:00
Jonas Bark
6251bd0148 fix misleading warning 2026-06-02 07:55:21 +02:00
Jonas Bark
9fb8d63f9a refactor: collapse to a single shared DirconEmulator for VS mode
ftmsEmulator is now the single emulator for Virtual Shifting traffic
across all trainers and the Click V2. ProxyDevice keeps a per-instance
emulator only for proxy mode (each proxy trainer advertises its own
mDNS identity). ZwiftClickV2 attaches its def to ftmsEmulator directly.

ProxyDevice exposes its own state ValueListenables (isStartedListenable,
isConnectedListenable, retrofitMode, localAddress) that mirror the active
emulator, so UI bindings survive mode swaps. setRetrofitMode and
switchRetrofitMode live on ProxyDevice and migrate the FBD between
proxy/shared emulators.

Removes companionProvider, refreshCompanions, and the click-def
internal seeding in DirconEmulator.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 23:05:40 +02:00
Jonas Bark
a795b3c681 refactor: route FBD-specific callers through emulator.fitnessBike
activeDefinition now returns the CompositeBleDefinition; consumers
that need the FitnessBikeDefinition specifically use the fitnessBike
convenience getter. Bumps prop submodule to pick up the composite
machinery.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:55:53 +02:00
Jonas Bark
390d09b964 UI adjustments, add screenshot to support 2026-05-13 09:05:48 +02:00
Jonas Bark
5913a4746e feat(overlay): mount overlay settings section on proxy device details page 2026-05-09 09:30:23 +02:00
Jonas Bark
847a2962f5 UI, support adjustments 2026-05-05 15:27:28 +02:00
Jonas Bark
a7f0352c5f UI adjustment 2026-04-30 07:31:24 +02:00
Jonas Bark
e290b3e2df UI adjustments 2026-04-29 08:33:26 +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
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
39ad7b8b49 feat: add Workout Pause/Resume trainer action and inline feedback prompt
Workout: Pause/Resume action is a new InGameAction in the trainer-control
group. It toggles core.workoutRecorder between recording and paused
states without requiring a connected proxy trainer (handled in
base_actions.dart before the proxy dispatch). No-op when the recorder
is idle.

Inline feedback prompt replaces the standalone "Provide Feedback"
button on the proxy device details page. It shows "Does it work?"
with a 3-cell grid (Yes / No difference / No). Yes and No navigate
to TrainerFeedbackPage with the rating pre-filled (TrainerFeedbackPage
now accepts an optional initialRating). "No difference" dismisses
the prompt for the current page session.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 16:29:07 +02:00
Jonas Bark
3c0f181608 i18n: extract hardcoded strings on proxy device details page
Move user-facing literals (page titles, mode labels, hints, metric
labels, weight tile copy, unlock-confirm prompts) to the ARB files
so they go through AppLocalizations. Mirror new English copy into
de/es/fr/it/pl pending translation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 13:15:27 +02:00
Jonas Bark
c27c65e06e screenshot adjustments 2026-04-26 11:47:54 +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
863e785a68 feat(workout): surface mini workout card on smart trainer details
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
79480a4e9d support ERG mode 2026-04-23 12:47:39 +02:00
Jonas Bark
31ec5ad84d feat(trainer-feedback): warn on missing FTMS + dump non-standard services as freetext 2026-04-23 11:18:50 +02:00
Jonas Bark
ac39583bbe feat(proxy-details): show remaining Bridge minutes in Go Pro banner 2026-04-23 10:57:09 +02:00
Jonas Bark
944ca184e1 fix(iap): guard isProEnabledForCurrentDevice against uninitialised state 2026-04-23 10:06:56 +02:00
Jonas Bark
501daaebff fix(vs): use isProEnabledForCurrentDevice for virtual-shifting gating 2026-04-23 10:05:19 +02:00
Jonas Bark
8766a908e4 fix(proxy-details): gate Pro notice on FitnessBikeDefinition, move IAP safety to IAPManager 2026-04-23 09:47:40 +02:00
Jonas Bark
406e87be16 feat(proxy-details): show virtual-shifting Pro notice + Go Pro button 2026-04-23 09:41:39 +02:00
Jonas Bark
ddfc44ce24 feat(proxy): remember intent to connect; auto-start on next scan
Persist a per-trainer auto_connect_<trainerKey> flag via Settings. Set
to true whenever the user explicitly starts the emulator (tap in the
Trainer & Accessories list, or the Connect button on the disconnected
card). Clear to false when they tap Disconnect (or Disconnect & forget).

In Connection._handleConnectionQueue's proxy branch, after the shared
listener setup finishes, check the flag for the scanned ProxyDevice —
if set and nothing else is in flight, pick up the saved retrofit mode
and fire startProxy() so the emulator is ready by the time the user
opens the details page (or without opening it at all).
2026-04-21 10:55:33 +02:00
Jonas Bark
99af72c10e fix(proxy-details): rebuild when retrofit mode changes
The details page's _gearSection and _settingsSection gate on
`def is FitnessBikeDefinition`, which flips to false in Proxy mode
(activeDefinition becomes ProxyBikeDefinition). Without a listener on
emulator.retrofitMode, switching to Proxy left the VS cards stale on
screen. Hook the notifier into _onEmulatorStateChanged so setState
fires on every mode swap.
2026-04-21 09:59:53 +02:00
Jonas Bark
47a8832913 refactor(proxy-details): drop status banner; move ShiftingConfigPicker into Trainer Settings
ConnectionCard's connected-state view is now just the mode picker —
the large coloured "Proxy/WiFi/Bluetooth active" banner (and the bridge
row with device-name / IP) is removed. Dead _bridgeRow and _dot helpers
dropped.

ShiftingConfigPicker no longer sits between the connection card and the
gear section; it's now the first entry inside TrainerSettingsSection,
grouping config-scoped controls (picker, VS mode, gear settings, bike
weight, rider weight).
2026-04-21 09:57:43 +02:00
Jonas Bark
2c49f0a15d feat(shifting): add ShiftingConfigPicker on ProxyDeviceDetailsPage 2026-04-20 07:49:51 +02:00
Jonas Bark
140d0e9ae6 feat(shifting): TrainerSettingsSection reads/writes active ShiftingConfig 2026-04-20 07:41:56 +02:00
Jonas Bark
c873d24187 feedback adjustments 2026-04-19 10:16:29 +02:00
Jonas Bark
d17d860308 refactor(feedback): move entry from Trainer page to ProxyDeviceDetails actions
Feedback is naturally scoped to a specific connected trainer, so its
entry point belongs on the device details page next to Disconnect,
not on the generic Trainer page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 10:00:41 +02:00
Jonas Bark
0fa9d10dd5 UI adjustments 2026-04-17 10:12:55 +02:00
Jonas Bark
3db4c61a4c fix(proxy-details): subscribe to connectionStream for BLE state changes
The page already listened to emulator.isStarted/isConnected, but not
to the BLE device's own connection state (BaseDevice.isConnected is a
plain bool set by the connection framework). Subscribe to
core.connection.connectionStream — matching ProxyPage's pattern — so
the page rebuilds when the BLE device connects or disconnects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 09:19:11 +02:00
Jonas Bark
8453e1e0a7 fix(proxy-details): three UX fixes
1. Show gear hero + live metrics + settings before bridge is live by
   listening to emulator.isStarted/isConnected and rebuilding the page
   when the connection state changes.

2. Replace all GestureDetector fake-buttons with proper Button.ghost /
   Button / ButtonStyle.destructive in gear_hero_card, gear_ratios_card,
   gear_ratios_editor_page, and trainer_settings_section.

3. Enforce monotonic gear-ratio ordering: when a per-gear ratio changes,
   all lower gears are pulled down and all higher gears are pushed up
   so the table stays non-decreasing (prop submodule bumped).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 08:40:54 +02:00
Jonas Bark
7e0db713ec fix(proxy-details): restore stretch on page Column to fix layout assertion
The page Column's default (center) cross-axis alignment left its
stretch-using children (_actions, _settingsSection, inner columns in
LiveMetricsSection and TrainerSettingsSection) without a bounded
cross-axis width to propagate, triggering a RenderBox-not-laid-out
assertion during performLayout. Restoring crossAxisAlignment: stretch
gives every child a tight 800-wide constraint from the outer
ConstrainedBox and cascades cleanly to the stretch-inner columns.

Also swap Container(constraints: …) for ConstrainedBox since we no
longer need the Container's padding/decoration affordances here.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 22:25:35 +02:00
Jonas Bark
a38d786979 fix(proxy-details): give card Containers explicit width
The _card helpers in ConnectionCard and TrainerSettingsSection, plus the
_deviceCard helper in the page root, wrap a Container without an
explicit width. When the outer max-width Container gives loose (0..800)
constraints — which it does because Container(constraints:) does not
tighten min — these cards tried to shrink-wrap a stretching Column,
producing a RenderPadding-without-size assertion at layout time.

Setting width: double.infinity on the card Containers forces them to
take the full available width, matching the existing pattern in
GearHeroCard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 22:21:44 +02:00
Jonas Bark
f43ce66944 feat(proxy-details): add ProxyDeviceDetailsPage root 2026-04-15 22:00:09 +02:00