lägg till jämna varv-övning + v1.2.0
Ny guidad träningsövning i Open Practice: sätt måltid, tolerans och antal varv, se aktuell serie och dagens bästa live på Training-sidan. Ett missat varv startar en ny serie utan att radera bästa resultatet. Hittade och fixade två buggar under vägen: - syncTrainingLedger byggde om training-state vid varje sparning utan att föra vidare det nya evenLaps-fältet, så sparade konfigurationer försvann direkt - Training-sidan kraschade för alla förare med färre än 3 varv i varje stint (t.ex. de första varven i ett pass) eftersom en dedupe-funktion läste en egenskap på ett null-värde Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
29
ROADMAP.md
29
ROADMAP.md
@@ -73,6 +73,25 @@ Acceptance: a driver receives a short, encouraging summary based on their own cl
|
||||
- [ ] Include the summary in the personal mobile profile.
|
||||
- [ ] Add coach/parent reward follow-up without turning practice into a public ranking.
|
||||
|
||||
### Guided practice exercises
|
||||
|
||||
Acceptance: two structured, configurable exercises run inside an already-active Open Practice session, per driver and class, without stopping other drivers or creating a new session. Named for what they help a driver do, not for who supposedly likes them - "Jämna varv" ("Even laps", formerly "Konsistens-jakten") and "Stegträning" ("Step training", formerly "Pyramiden") - and focused on succeeding rather than performing perfectly.
|
||||
|
||||
**Jämna varv (even laps):** implemented 2026-09-09.
|
||||
- [x] Driver configures target lap time, tolerance and lap count; suggested default 5 laps / ±0.5s - 15 laps / 0.2s is frustrating for a beginner, but stays adjustable for anyone who wants it stricter.
|
||||
- [x] Offer a suggested target derived from the driver's own personal best (best lap × 1.05) when enough data exists, shown as the form's placeholder and a hint, never forced.
|
||||
- [x] Tolerance is ± around the target lap time: every lap in the streak must land within `target ± tolerance`, not a spread between the streak's fastest and slowest lap. Decided 2026-09-09 - simpler to understand and to show live ("hit the target"), and matches how a beginner already thinks about it.
|
||||
- [x] Show the current streak and today's best streak live, e.g. "4/5 even laps - Best streak today: 7".
|
||||
- [x] A lap outside tolerance (or one excluded from pace, e.g. a pit stop) ends the current streak but never erases prior progress; messaged as "New streak - try to beat your best", not as a failure.
|
||||
|
||||
Verified 2026-09-09: `buildEvenLapsProgress` in `src/training_logic.js` (unit-tested for streak tracking, tolerance, and exclusion handling) plus a manual browser check of the live card, config form and streak reset messaging inside an active Open Practice session. Found and fixed two real bugs in the process: `syncTrainingLedger` rebuilt `state.training` on every save without carrying the new `evenLaps` field through, silently discarding every saved configuration; and the Training page crashed for any driver with fewer than 3 laps in every stint (a very common state - e.g. anyone in their first couple of laps), because a dedup filter read `.id` on a `null` "best stint" entry.
|
||||
|
||||
**Stegträning (step training):**
|
||||
- [ ] Configurable steps: lap count plus an instruction per step (calm / controlled / fast).
|
||||
- [ ] Show the current step and remaining laps in that step.
|
||||
- [ ] Treat calm/controlled/fast as perceived effort shown to the driver, not an exact lap-time target the system enforces - there is no reliable way to measure how hard a driver is pushing.
|
||||
- [ ] Compare the two controlled-pace steps afterward without automatically labeling a slower second step as fatigue.
|
||||
|
||||
## 4. Results archive
|
||||
|
||||
- [ ] Search completed sessions by date, class and driver without Race Setup.
|
||||
@@ -101,12 +120,6 @@ Acceptance: a driver receives a short, encouraging summary based on their own cl
|
||||
|
||||
- [ ] Update the architecture's module/dependency inventory as modules change.
|
||||
- [ ] Complete state/settings/SQLite contracts and critical form-to-controller mappings.
|
||||
- [ ] Consolidate older future-work notes so this file remains the primary roadmap.
|
||||
- [x] Consolidate older future-work notes so this file remains the primary roadmap.
|
||||
|
||||
|
||||
# Träningsstat
|
||||
lägga till mera skoj utvecklande tränings format
|
||||
- [ ]
|
||||
2. "Pyramiden" (För extrem mental uthållighet)I racing tappar man ofta koncentrationen i mitten av ett lopp. Detta upplägg tvingar dig att hålla fokus när hjärnan börjar bli trött.Fas 1: 5 varv på 70% fart (Hitta linjerna och värm upp)Fas 2: 5 varv på 90% fart (Skruva upp tempot)Fas 3: 5 varv på 100% fart (Maxattack)Fas 4: 5 varv på 90% fart (Håll farten trots trötthet)Fas 5: 5 varv på 70% fart (Nedvarvning och analys av bilen)
|
||||
- [ ]
|
||||
3. "Konsistens-jakten" (F1-förarnas favorit)F1-team bryr sig ofta mer om konstanta varvtider än ett enda supersnabbt varv.Bestäm dig för en måltid (t.ex. 85% av din maxfart).Kör 15 varv på rad där målet är att alla varv ska ligga inom (konfigurerbart) 0,2 sekunder från varandra.Om du kör ett varv som är för snabbt eller för långsamt, "stryks" serien och du får börja om. Detta bygger ett otroligt muskelminne för bromspunkter och kurvhastighet.
|
||||
Consolidated 2026-09-09: the raw "Träningsstat" brainstorm notes (Pyramiden, Konsistens-jakten) were folded into section 3's "Guided practice exercises" as a proper specification and removed from here.
|
||||
Reference in New Issue
Block a user