Add Svelte GUI, FIT encoder and README

Standalone binary embeds the frontend, avoiding the dev-server dependency
that made the window fail to load.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-05 13:50:01 +02:00
co-authored by Claude Opus 5
parent 7c17ca6158
commit 3a2a787b7d
23 changed files with 3297 additions and 46 deletions
+24
View File
@@ -236,6 +236,30 @@ fn transmit(_app: &AppHandle, target: ControlTarget) {
tracing::debug!(?target, "control target (no trainer attached — mock backend)");
}
/// Load the bundled GPX and start riding it. Development only — see the
/// `BIKECONTROL_DEMO` check in `lib.rs`.
pub fn start_demo(app: &AppHandle) {
let Some(sample) = crate::samples::all().into_iter().find(|s| s.is_gpx) else {
return;
};
let profile = match bikecontrol_core::gpx::import(
&sample.text,
&sample.name,
&bikecontrol_core::gpx::SmoothingConfig::default(),
) {
Ok(p) => p,
Err(e) => {
tracing::warn!(%e, "demo profile failed to import");
return;
}
};
let (view, geom) = crate::profile_view::build(&profile, "demo");
let state = app.state::<AppState>();
let mut inner = state.lock();
inner.set_profile(profile, view, geom);
inner.inputs.status = RideStatus::Running;
}
/// SAF-2: never leave the trainer loaded. Called on ride end and on app exit.
pub fn release_trainer(app: &AppHandle) {
let state = app.state::<AppState>();