Commit Graph

88 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
65d8579199 fix(home): Local control is a fallback, not proof the app is connected
The app link read connectedTrainerConnections, which includes Local.
Local reports connected the moment it is switched on — it types into
whatever window happens to be in front — so it says nothing about
whether the trainer app is reachable. With a network method also enabled
(the default for MyWhoosh) that painted the link green while the
connection the rider actually rides on sat unactivated, hiding the one
thing left to do.

The link now reads non-local connections whenever any non-local method
is enabled, and all of them when Local is all there is — because then
Local IS the answer. The summary uses the same list, so the card cannot
caption itself "Local" while the network method is down.

The rule already existed: InactivityDisconnector draws exactly this
distinction, and connectedNonLocalTrainerConnections was already there
for it. The home chain simply was not using it. So the getter lives in
core.logic beside its siblings rather than as a private method on the
page — the next screen that needs it should find it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 19:52:39 +02:00
Jonas Bark
0c91cc7465 feat(home): setup-chain model and remembered devices
The home screen is being rebuilt as the setup chain: one card per link,
each carrying the same status light and the same tick-off checklist. This
lands the parts that decide *what* the screen says, ahead of the widgets
that draw it.

chain_state.dart is pure data with no Flutter, no BLE and no `core`, and
steps carry ids rather than sentences, so "which step is done or pending"
is unit-testable without a locale or a radio. chain_builder.dart turns a
plain ChainInputs snapshot into cards; deriveBanner reads the cards back,
so the banner can never contradict what is under it.

Remembered devices fix a real gap: a controller that is switched off or
out of range disappeared from the app entirely, so riders could not see
what they owned or edit a mapping away from the bike. We now store the
advertisement a device connected with — exactly the fields
BluetoothDevice.fromScanResult reads — and rebuild it into a real device
object of the right subclass, kept out of the connect queue. Trainers are
remembered as data only, since their card needs a name, not a contour.

Tracking which ids connected this session is what separates a red "lost
connection" from an amber "out of range"; a fresh launch with the
controller in a drawer must not paint the screen red.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 10:38:19 +02:00
Jonas Bark
18c282c698 demo mode 2026-07-10 13:01:38 +02:00
Jonas Bark
c95eb147c3 feat(emulation): EmulationManager, profiles model, Click/Ride profiles, debug platform install
Adds the EmulationProfile/EmulatedInput model, EmulationManager +
EmulationSession, removePeripheral on the fake BLE platform, the first two
device profiles (Zwift Click + Ride) with an allEmulationProfiles registry,
core.emulation, and the debug-only RoutingBlePlatform install in main().
2026-07-02 09:45:12 +02:00
Jonas Bark
c648705949 feat(core): showLocalKeyboardCard/showLocalTouchCard visibility getters
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRVXtrmcgtKKz46AVDyqQp
2026-07-02 08:51:00 +02:00
Jonas Bark
9185d71a92 feat(6.2): register core.screenRecording with platform backend factory 2026-06-24 16:30:54 +02:00
Jonas Bark
786621a11b Localize TrainerConnection titles (re-evaluate per locale)
The connection titles ("Connect using Bluetooth", "Connect directly over
Network", "Connect using MyWhoosh Link", ...) were captured once at object
construction in English, so they didn't follow the active locale. Back the
title with a builder (String Function()) and expose it via a getter so it
re-localizes — fixing the English titles in the localized store screenshots.
Updated all 10 subclasses and the fake connection in the bridge-transport test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:47:43 +02:00
Jonas Bark
a68b68a1b4 fix button mapping popup 2026-06-01 11:53:55 +02:00
Jonas Bark
afa5777e86 fixes 2026-05-21 22:25:28 +02:00
Jonas Bark
51f2455166 rouvy mode 2026-05-21 20:34:51 +02:00
Jonas Bark
75dd10371a show default OBP actions 2026-05-11 20:53:25 +02:00
Jonas Bark
3899c623a6 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
a880434709 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
996dfbd7a4 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
0dc041737a 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
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
c5c5d85b67 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
3859dcb55a 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
76b6a03cc7 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
c2646e41cb feat(proxy-device): auto-stop Bridge after 20 min for non-Pro users 2026-04-23 09:33:30 +02:00
Jonas Bark
12773b3fb8 feat(shifting): mount ShiftingConfigsController on core 2026-04-20 07:38:22 +02:00
Jonas Bark
04d30ac556 resolve https://github.com/OpenBikeControl/bikecontrol/issues/337 2026-04-12 11:19:25 +02:00
Jonas Bark
374499e669 resolve https://github.com/OpenBikeControl/bikecontrol/issues/338 2026-04-12 11:13:08 +02:00
Jonas Bark
83c7532bfb resolve https://github.com/OpenBikeControl/bikecontrol/issues/341 2026-04-12 09:20:44 +02:00
Jonas Bark
9c17ea0fc0 wording adjustments 2026-04-07 08:26:51 +02:00
Jonas Bark
b992f62a69 5.2.0 adjustments 2026-04-02 10:20:43 +02:00
Jonas Bark
cfcdb0203f UI adjustments 2026-03-25 11:28:03 +01:00
Jonas Bark
2f628c7345 revise connection methods 2026-03-25 09:27:48 +01:00
Jonas Bark
5ed2bce59b revise connection methods 2026-03-25 09:27:37 +01:00
Jonas Bark
2d0c47233d UI adjustments, TP adjustment 2026-03-19 13:25:40 +01:00
Jonas Bark
e955d81fce connection settings adjustments 2026-03-18 10:07:22 +01:00
Jonas Bark
6435be973f new ui #19 2026-03-12 10:11:17 +01:00
Jonas Bark
3706b1f9ef new ui #20 2026-03-12 08:51:21 +01:00
Jonas Bark
9a7727c996 new ui #12 2026-03-11 17:35:26 +01:00
Jonas Bark
91f693ec0d new ui #5 2026-03-10 21:02:41 +01:00
Jonas Bark
922c785df1 new ui #4 2026-03-10 19:04:51 +01:00
Jonas Bark
91501d2588 new ui #3 2026-03-10 15:06:13 +01:00
Jonas Bark
e7aeae1c29 subscription #1 2026-02-17 15:07:43 +01:00
Jonas Bark
a9f52dbbd0 sign in with google, apple 2026-02-16 16:26:22 +01:00
Jonas Bark
e007ed495c openbikecontrol via dircon 2026-02-08 11:28:48 +01:00
Jonas Bark
6686278457 add new remote keyboard connection method 2026-02-05 17:22:21 +01:00
Jonas Bark
8997b54a9a group buttons by device, add new unlock mechanism 2026-01-23 15:27:32 +01:00
Jonas Bark
7132784dc9 Windows & macOS: allow configuration of volume keys on Bluetooth HID devices 2026-01-22 14:29:57 +01:00
Jonas Bark
eca29b7de2 add OpenBikeControl protocol to onboarding 2026-01-19 08:23:30 +01:00
Jonas Bark
ad23d184d4 Android: simulate additional actions for local connection method (Left, Down, Right, Up, Down, Select, Back, Home, Recent Apps), allowing you to navigate in the trainer app, if supported 2026-01-17 13:52:27 +01:00
Jonas Bark
74aca6d100 Windows: fix media key detection 2026-01-17 12:11:14 +01:00
Jonas Bark
605d251970 optional notification permission on macOS 2026-01-11 11:28:29 +01:00
Jonas Bark
1d57c18dd9 onboarding for new users 2025-12-31 15:52:30 +01:00