Commit Graph

14 Commits

Author SHA1 Message Date
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
8a4d2d6bb0 feat: front-shift config fields on ShiftingConfig
Add frontShiftEnabled, smallChainringTeeth, and largeChainringTeeth fields
to ShiftingConfig with defaults (false, 34, 50) and proper serialization.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 15:37:56 +02:00
Jonas Bark
f44111f02a config: surface cadenceFilterEnabled on ShiftingConfig
Default off; forwarded to FitnessBikeDefinition in the proxy seed path.
The UI affordance is intentionally not added here — observe in-the-wild
behaviour before exposing a knob most users won't need.
2026-05-13 08:35:32 +02:00
Jonas Bark
d8116eb118 fix reported issues 2026-04-28 10:38:04 +02:00
Jonas Bark
f9f61a3d83 feat(shifting): add maxGear field on ShiftingConfig (default 24, clamped 1..30) 2026-04-20 10:06:17 +02:00
Jonas Bark
6ef8fe49fc refactor(shifting): accept any 1..30 gear-ratios list per config 2026-04-20 09:36:10 +02:00
Jonas Bark
3b2212cc4b feat(shifting): sync ShiftingConfigs via new top-level user_settings column 2026-04-20 07:52:05 +02:00
Jonas Bark
4e179c1de8 refactor(shifting): use foundation.listEquals; test clearGearRatios sentinel 2026-04-20 07:31:09 +02:00
Jonas Bark
4ce516ca26 fix(shifting): restore 24-entry guard on gearRatios fromJson
Round-trip test updated to use a full 24-entry ratio list; added a
separate test asserting that wrong-length lists are dropped during
deserialisation so downstream callers (setGearRatios) never see
malformed data.
2026-04-20 07:28:33 +02:00
Jonas Bark
66272c99b0 feat(shifting): add ShiftingConfig model with JSON round-trip 2026-04-20 07:25:52 +02:00
Jonas Bark
782dc235ce add login with github 2026-03-06 11:21:09 +01:00
Jonas Bark
0c9d45815e user settings sync implementation 2026-02-22 09:17:45 +01:00
Jonas Bark
1815448ff7 device registration logic 2026-02-19 12:19:54 +01:00
Jonas Bark
b54e14f695 subscription #1 2026-02-17 15:07:43 +01:00