add more train stats per driver
This commit is contained in:
@@ -476,6 +476,9 @@ Owns:
|
||||
- daily summaries, controlled-lap streak, and recent personal-best gain
|
||||
- signed personal pace and consistency trends from the latest 30 laps versus the preceding 30, with a minimum of 10 laps in each window
|
||||
- derived automatic achievements for sessions, lap totals, training days, controlled streaks, and a completed five-minute result
|
||||
- active 30-minute pace buckets using a trimmed average and omitting empty clock periods
|
||||
- persisted class-specific setup markers and 30-minute before/after comparisons
|
||||
- extended stint analysis with normal pace, best 10-lap race pace, mistake count, consistency, and start/end change
|
||||
- rule-based practice recommendation selection
|
||||
- automatic and custom milestone progress calculation
|
||||
|
||||
@@ -500,6 +503,9 @@ Rules:
|
||||
- a boundary lap whose `lapMs` contains the full break is excluded from pace metrics
|
||||
- duration-result ranking compares lap count first and elapsed result time second
|
||||
- a duration result is valid only after crossing the target and includes a final lap whose start is before the target cutoff
|
||||
- a stint needs at least 3 valid pace laps for consistency/ranking and at least 10 for Race pace 10
|
||||
- a stint mistake is a lap more than 15 percent slower than that stint's median
|
||||
- setup comparisons need at least 3 valid laps in each 30-minute side of the marker
|
||||
|
||||
### `src/training_views.js`
|
||||
Type:
|
||||
@@ -514,10 +520,12 @@ Owns:
|
||||
- compact live-practice card and primary personal-profile action for the selected driver
|
||||
- personal trend and achievement cards that never combine classes
|
||||
- recent club progress feed ordered by latest activity, without position numbers or cross-driver performance scoring
|
||||
- collapsed Extra statistics with pace heatmap, setup-marker actions, weekday pace, featured stints, and an expandable full stint table
|
||||
|
||||
Mutations:
|
||||
- replaces or appends entries in `state.training.goals`
|
||||
- creates, rotates, enables, or disables entries in `state.training.shares`
|
||||
- creates and removes entries in `state.training.markers`
|
||||
- always calls injected `saveState()` before rerender
|
||||
|
||||
Route behavior:
|
||||
@@ -1758,7 +1766,8 @@ This bucket is the most dynamic part of state and is mutated heavily during live
|
||||
{
|
||||
goals: TrainingGoal[],
|
||||
ledger: TrainingLap[],
|
||||
shares: TrainingShare[]
|
||||
shares: TrainingShare[],
|
||||
markers: TrainingMarker[]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1812,6 +1821,21 @@ Share rules:
|
||||
}
|
||||
```
|
||||
|
||||
`TrainingMarker`:
|
||||
|
||||
```js
|
||||
{
|
||||
id: string,
|
||||
driverId: string, // exact driver entry; profile resolution happens on read
|
||||
classId: string,
|
||||
sessionId: string,
|
||||
timestamp: number,
|
||||
type: "setup" | "tires" | "suspension" | "car" | "note",
|
||||
note: string,
|
||||
createdAt: string
|
||||
}
|
||||
```
|
||||
|
||||
Normalized by:
|
||||
- `normalizeTrainingState()` wrapper in `src/app.js`
|
||||
- `normalizeTrainingState()` implementation in `src/training_logic.js`
|
||||
@@ -1831,6 +1855,7 @@ Migration behavior:
|
||||
- older state without `training.ledger` normalizes to an empty ledger
|
||||
- the next `saveState()` imports valid registered-driver laps from all current session results
|
||||
- invalid laps, anonymous transponders, and laps at or below `500 ms` are excluded
|
||||
- older state without `training.markers` normalizes to an empty marker list
|
||||
|
||||
## 15.9 `Settings`
|
||||
|
||||
@@ -2334,6 +2359,9 @@ npm test
|
||||
- selected-profile/class active-practice isolation, current-start filtering, and non-practice rejection
|
||||
- two-minute stint boundaries, cross-session isolation, and boundary-lap exclusion
|
||||
- best-three consecutive calculation and five-minute final-lap/average-pace behavior
|
||||
- trimmed 30-minute pace buckets and weekday aggregation
|
||||
- class-isolated setup-marker before/after comparison
|
||||
- short-stint suppression, 10-lap race pace, and mistake detection
|
||||
|
||||
`tests/public_training_profile.test.js` covers:
|
||||
- enabled/disabled/unknown share-token handling
|
||||
|
||||
Reference in New Issue
Block a user