Saved routes overlay + per-activity road colors + reversible track de-jitter

Routes:
- routes table + CRUD helpers (db.js), GPX rtept/trkpt/wpt parser (gps.js)
- "Saved routes" screen (import/rename/recolor/delete, one active at a time)
- Route overlay on both the recording map and the past-track detail map,
  toggled by an "M" button; default ON at Start when a route is selected
- Draw after real map-load via async whenMapReady(), no setTimeout

Road colors:
- per-activity configurable colors (walk/bike/run); fix walk roads (atype "w")
- get_road_points maps run -> "r" (lib.rs)

De-jitter (Savitzky-Golay):
- GPS.smoothTrackSG (quadratic LS per window, iterated, endpoints anchored)
- reversible storage: lat_smoothed/lon_smoothed + session.smoothed flag
- detail-screen tuning panel (window/iters sliders, live preview,
  save smoothed / revert original, kcal recomputed on new points)
- accuracy_m column per point for later accuracy-gated recompute

Active map-button state restyled to inverted (dark glyph on translucent
white) for OLED; detail map safe-area handled in fullscreen.
This commit is contained in:
4aiman 2026-07-31 22:11:55 +03:00
commit 9d09b4c4a4
5 changed files with 454 additions and 12 deletions

View file

@ -1095,13 +1095,15 @@ select {
cursor: pointer;
}
.rec-map-btn.active {
background: rgba(187, 134, 252, 0.4);
border-color: var(--primary);
background: rgba(255, 255, 255, 0.5);
color: #1a1a1a;
border-color: rgba(255, 255, 255, 0.6);
}
.rec-rotate-btn { right: 8px; bottom: 48px; font-size: 18px; transition: transform 0.15s; }
.rec-freeze-btn { right: 8px; bottom: 86px; }
.rec-roads-toggle { right: 8px; bottom: 124px; }
.rec-mode-btn { right: 8px; bottom: 162px; font-size: 11px; }
.rec-route-toggle { right: 8px; bottom: 200px; }
/* Always-on compass needle: red half = North, grey = South. Rotates to point to real north.
Top-RIGHT (zoom controls are top-left), below the status-bar safe area. */
.rec-compass {
@ -1395,6 +1397,27 @@ select {
font-size: 18px;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.sd-map-fs-btn.active {
background: rgba(255, 255, 255, 0.5);
color: #1a1a1a;
border-color: rgba(255, 255, 255, 0.6);
}
.sd-smooth-panel {
position: fixed;
z-index: 10001;
left: 8px;
bottom: 8px;
width: 210px;
background: rgba(20, 20, 20, 0.93);
color: #eee;
font-size: 12px;
padding: 8px 10px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.sd-smooth-panel label { display: block; margin: 6px 0 2px; }
.sd-smooth-panel input[type=range] { width: 100%; }
.sd-smooth-panel .sm-stat { margin: 4px 0; color: #9be89b; }
.zoom-display {
background: rgba(0,0,0,0.6);