Commit Graph

585 Commits

Author SHA1 Message Date
Jonas Bark
c847a10ed1 some fixes 2026-05-09 10:26:52 +02:00
Jonas Bark
e36458e469 feat(review): suppress rate banner during trial period
Trial users haven't yet decided whether the app is worth paying for, so
prompting them to rate it produces noisy reviews. Hide the banner while
the trial is active; it returns once the user buys or the trial ends.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 09:19:20 +02:00
Jonas Bark
0259bc68e6 fix(overlay): use Set<OverlayField> typing in Settings accessors
The prop package re-exports protocol/zp.pb.dart which defines a protobuf
`class Set`, shadowing the built-in Set type. Added `hide Set` to the
prop import so Dart's Set is visible and the overlay accessors can use
proper Set<OverlayField> types instead of dynamic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 22:57:14 +02:00
Jonas Bark
1ecf71cae1 feat(overlay): persist overlay enabled, fields, and desktop position 2026-05-08 22:55:13 +02:00
Jonas Bark
72d26000e1 warn when connecting smart trainer 2026-05-07 15:57:02 +02:00
Jonas Bark
aa1b9b5125 fix trainer connection logic 2026-05-06 06:27:21 +02:00
Jonas Bark
f7843f67e0 UI, support adjustments 2026-05-05 15:27:28 +02:00
Jonas Bark
f91333b2d2 support imperial / metric 2026-05-05 14:15:27 +02:00
Jonas Bark
f3d473b820 adjustments 2026-04-28 20:15:38 +02:00
Jonas Bark
0c55cc5085 fix: include Di2 BLE in hasRecommendedConnectionMethods so the off-target warning doesn't fire for Wahoo ELEMNT 2026-04-28 19:39:45 +02:00
Jonas Bark
d19eea9eb4 feat: treat dFly channel actions as active when Di2 BLE is enabled 2026-04-28 19:23:05 +02:00
Jonas Bark
3003bf63c8 feat: wire Di2Emulator into Core connection-method registries
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 19:08:00 +02:00
Jonas Bark
5fa96ddb8c feat: persist Di2 BLE enabled flag in settings 2026-04-28 19:03:46 +02:00
Jonas Bark
6a88e11863 feat: add Wahoo ELEMNT SupportedApp with di2Ble connection method 2026-04-28 18:49:03 +02:00
Jonas Bark
ed2853c2aa improve HID device logic 2026-04-28 18:48:32 +02:00
Jonas Bark
d10c586456 feat: add dFlyChannel1..4 InGameActions for Wahoo ELEMNT target 2026-04-28 18:45:30 +02:00
Jonas Bark
d8116eb118 fix reported issues 2026-04-28 10:38:04 +02:00
Jonas Bark
5e4093107a fix: stop reconstructing IconData on keymap decode (tree-shake fix)
The IconData(...) call in KeyPair.decodeButton — added to round-trip
ControllerButton.icon through SharedPreferences — is a non-const
constructor that defeats Flutter's icon-font tree-shaker, breaking
the release build:

    This application cannot tree shake icons fonts. It has non-constant
    instances of IconData at the following locations:
      - lib/utils/keymap/keymap.dart:511:18

In practice the round-trip was redundant: known buttons in
ControllerButton.values already carry their const icon in the static
definition, so they get the same icon back via copyWith on decode
just from the matched name. Unknown buttons never had a custom icon
in the first place, so dropping the encode side too is a no-op for
saved profiles.

Encode now emits only name (+ deviceId when set); decode never
constructs an IconData. Comment in both halves explains the
constraint so this doesn't regress.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 09:25:01 +02:00
Jonas Bark
92756f1147 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
864e1a7e72 feat: persist ControllerButton.icon in encoded keymaps
Extends KeyPair.encode/decode to round-trip the optional ControllerButton
icon alongside the existing name + sourceDeviceId fields. Encoded as a
{codePoint, fontFamily, fontPackage} sub-map only when present, so a
button without an icon still serialises as the legacy plain-string
shape — backward compatible with profiles already saved to
SharedPreferences.

Decoding rebuilds the IconData via its codePoint + font family/package,
then applies it via copyWith on the matched ControllerButton or as a
constructor arg for unknown-button fallback. Buttons that previously
had a default icon from their static definition are preserved on
decode (the decoded value overrides only when serialised).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 08:25:08 +02:00
Jonas Bark
8dca2d9454 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
7bd39748bc fix 2026-04-26 13:02:06 +02:00
Jonas Bark
46152f2521 feat: wire ReviewPromptService into app startup
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 12:09:56 +02:00
Jonas Bark
e6191a2f31 feat: add settings keys for in-app review prompt tracking
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 12:06:16 +02:00
Jonas Bark
5df12f908d UI adjustments 2026-04-26 09:44:56 +02:00
Jonas Bark
c47667af94 UI adjustments, BLE advertisement fix 2026-04-26 09:14:00 +02:00
Jonas Bark
112d24d0d5 feat: default smart trainers to Virtual Shifting on first connect
Adds ProxyDevice.defaultRetrofitMode that returns RetrofitMode.bluetooth or
RetrofitMode.wifi when the device advertises FTMS and the user has a
matching Trainer Connection enabled (resolved via preferredBridgeTransport).
Power-meter-only and HRM-only devices, plus smart trainers with no enabled
Bridge transport, fall back to RetrofitMode.proxy.

Threads the device default through Settings.getRetrofitMode as a `fallback`
parameter so the auto-connect path, the tap-to-connect handler in
ProxyPage, and the picker's initState all surface VS first.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 22:40:36 +02:00
Jonas Bark
db937d30a6 feat: add CoreLogic.preferredBridgeTransport resolver
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 20:31:57 +02:00
Jonas Bark
d4a41b02b3 compatibility changes 2026-04-25 19:23:34 +02:00
Jonas Bark
f0233a3677 direct control refactoring 2026-04-25 13:45:14 +02:00
Jonas Bark
b6442d6937 ui adjustments, DRY fixes 2026-04-24 14:13:05 +02:00
Jonas Bark
3a5e3835f4 ui fixes 2026-04-24 13:42:45 +02:00
Jonas Bark
7e0512145c feat(apps): add BikeControl as a supported trainer app 2026-04-24 13:26:31 +02:00
Jonas Bark
18379628d7 Merge branch 'feat/proxy-device-details-page' into feat/mini-workout 2026-04-24 13:07:16 +02:00
Jonas Bark
b07ceb388b adjustments 2026-04-24 13:06:07 +02:00
Jonas Bark
f793a2b3f7 feat(workout): WorkoutRepository for local .fit file storage
Adds PastWorkout model, WorkoutRepository (save/list/delete) with UTC-stamped filenames, and wires it into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
838e97cdcf feat(workout): WorkoutRecorder with idle/recording/paused state machine
Implements WorkoutRecorder with start/pause/resume/stop transitions, 1 Hz
sampling loop via configurable tick timer, active duration tracking that
excludes pause time, and WorkoutResult with summary. Wires recorder into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
256a0bc2c3 feat(controller): add ControllerButton.initials getter 2026-04-24 10:33:38 +02:00
Jonas Bark
c96aed3585 ui adjustments 2026-04-23 12:02:18 +02:00
Jonas Bark
325c5ae464 feat(trainer-actions): consolidate shift/erg into mode-aware up/down + switchMode 2026-04-23 10:18:40 +02:00
Jonas Bark
4b72b74dd3 fix(iap): guard isProEnabledForCurrentDevice against uninitialised state 2026-04-23 10:06:56 +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
8ced9275ce feat(proxy-device): auto-stop Bridge after 20 min for non-Pro users 2026-04-23 09:33:30 +02:00
Jonas Bark
a3ee458a07 feat(supported-app): add per-app trainer connection types 2026-04-23 08:52:09 +02:00
Jonas Bark
d48808827b Android: broadcast a custom Intent on button press - connect your controller to automation apps like MacroDroid or Tasker to turn your phone into a ringbell, trigger Shortcuts, toggle lights, and more (Pro) 2026-04-22 10:48:42 +02:00
Jonas Bark
bef6c33fea 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
dc39c4fdf5 feat(settings): per-trainer retrofit-mode persistence 2026-04-21 09:32:39 +02:00
Jonas Bark
3554cacb73 feat(settings): re-apply trainer settings on connected proxies when keymap changes 2026-04-20 09:43:38 +02:00
Jonas Bark
e80c0234bf feat(keymap): add virtualGearAmount on SupportedApp (MyWhoosh=30, default=24) 2026-04-20 09:14:06 +02:00
Jonas Bark
04330e5584 refactor(settings): drop legacy proxy_* accessors
All call sites now go through core.shiftingConfigs and the active
ShiftingConfig. Remove the global getProxy*/setProxy*/clear helpers
and the associated clamp constants; these lived at lib/utils/settings/settings.dart:488-568.
The unused fitness_bike_definition import it pulled in drops with
them.
2026-04-20 07:46:27 +02:00