mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-11-29 09:11:17 +01:00
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>