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:
larssandandClaude Sonnet 5 committed 2026-09-09 15:05:49 +02:00
1 parent 3373f8dddd
commit 643902ff15
8 files changed
+242 -25

No files matched your search

+36
View File
@@ -531,6 +531,42 @@ button {
line-height: 1.55;
}
.profile-summary-card {
border-color: color-mix(in srgb, var(--gold) 45%, var(--line) 55%);
background:
radial-gradient(circle at 92% 8%, rgba(245, 200, 76, 0.16), transparent 42%),
color-mix(in srgb, var(--surface) 94%, transparent);
}
.profile-summary-card p {
margin: 8px 0;
line-height: 1.5;
}
.profile-summary-highlight {
color: var(--gold);
font-weight: 700;
}
.profile-summary-reward {
padding: 9px 11px;
border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line) 55%);
border-radius: 10px;
background: rgba(245, 200, 76, 0.08);
}
.profile-summary-next-goal {
margin-top: 14px;
padding-top: 14px;
border-top: 1px solid var(--line);
}
.profile-summary-next-goal h3 {
margin: 5px 0 0;
font-family: Orbitron, sans-serif;
font-size: 1.1rem;
}
.profile-timer-setup {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));