feat(train): workouts written to Health Connect (ADR 0030, D31)

A Health Connect row in the account sheet opens its screen: Write my
workouts, off until turned on, Health Connect asking as it is. Then
every workout this phone holds is written there (its session with its
pauses and route, heart rate, speed and the rower's watts as samples,
distance and elevation gained), and written again or deleted as it
changes, here or through a sync, and as the app opens. Client IDs come
from the workout's ID, a version counts up with each change; what was
written is kept in the person's health_connect.json, never synced. A
permission taken back in Health Connect turns writing off and says so;
Health Connect's link to Train's rationale opens a screen of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-28 17:06:31 +01:00
commit 09f61c3b0a
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -518,6 +518,19 @@ Strava. What was found, 27 Oct:
- No migration: an imported workout is a workout, its origin one more field of the
sealed, versioned payload.
Writing built so (28 Oct), with choices of mine for the developer to look at: turning
writing off leaves what was written there; a session's title is the workout's name
only where the person gave one (Health Connect names it by the app otherwise); the
route is the track as the page draws it (the precise fixes while moving), the speed
a sample at each of its fixes after a piece's first; steps aren't written, as Train
keeps none (the step detector only decides auto-pause); a workout is written again
only where its payload's fingerprint changed; a write Health Connect refuses later
(the permission taken back there) turns writing off and the screen says so; Android
names only the apps the manifest lists (Gadgetbridge, Christopeit Connect,
OpenTracks), any other shows by its package; the rationale opens only while someone
is signed in. Train needs Android 8 (API 26) now, as `connect-client` 1.1.0 does.
Not yet tried on a phone.
## Consequences
- Train's sensors are one pattern: open profiles read by the app itself, on the phone;