Add end-of-practice summary to the driver's mobile profile

When a driver's personal 5-minute practice timer finishes, a "Pass
avslutat" card now appears immediately: how this pass's pace and
consistency compared to their recent sessions, any goal or lap-count
milestone crossed during the pass with its reward text made prominent,
and one suggested next goal (reusing the existing pace recommendation,
falling back to the next milestone when there isn't enough data yet).
Scoped to the driver's current class, and explicit about insufficient
sample sizes instead of showing a misleading number.

Adds a per-session consistency calculation to
buildPublicTrainingWindowStats server-side; everything else needed
(stats, goals, recommendation, milestone) was already sent to the
client, so the summary itself is computed there from data already in
hand - no raw laps or driver IDs added to what the public endpoint
exposes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-09-09 15:05:49 +02:00
parent 3373f8dddd
commit 643902ff15
8 changed files with 242 additions and 25 deletions

View File

@@ -8,6 +8,12 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
## 1.5.0 - 2026-09-09
### Added
- A "Pass avslutat" (practice complete) summary now appears on the driver's personal mobile profile the moment their 5-minute practice timer finishes: how their pace and consistency compared to their recent sessions, any goal or lap-count milestone reached during that pass with its reward shown prominently, and one suggested next goal - scoped to their current class, with a plain explanation whenever there isn't enough data yet to judge pace or consistency.
## 1.4.3 - 2026-09-09
### Fixed