diff --git a/CHANGELOG.md b/CHANGELOG.md
index c064b39..e24186d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,17 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
+## 1.87.0
+
+### Added
+
+- **Standard / Pro switch on the driver's own page:** **Pro** is a clean practice view without goals, challenges, exercises or settings - just the practice day at the top (laps, stints, drive time, best, average and personal best today) and the fold-out stint cards. **Standard** is the page as before. The phone remembers the choice, and a link with `?mode=pro` opens straight in Pro.
+- **Stint cards:** the fastest lap of the stint is green and the fastest lap of the day is purple; each stint also shows its total time and consistency (on Training too).
+
+### Fixed
+
+- Stint duration on the driver's page now reads "5:14" instead of a long race-clock format.
+
## 1.86.0
### Added
diff --git a/package-lock.json b/package-lock.json
index 4cdac6c..3d41088 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "rc-racecore",
- "version": "1.86.0",
+ "version": "1.87.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rc-racecore",
- "version": "1.86.0",
+ "version": "1.87.0",
"hasInstallScript": true,
"dependencies": {
"better-sqlite3": "^12.11.1",
diff --git a/package.json b/package.json
index 5be5bc1..103f88f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "rc-racecore",
- "version": "1.86.0",
+ "version": "1.87.0",
"private": true,
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
"engines": {
diff --git a/server/public_training_profile.js b/server/public_training_profile.js
index e3164d9..d6e78ba 100644
--- a/server/public_training_profile.js
+++ b/server/public_training_profile.js
@@ -678,6 +678,7 @@ function buildPublicTrainingStats(allLaps, layoutLaps = allLaps) {
number: index + 1, startedAt, lapCount: stint.laps.length,
bestLapMs: values.length ? Math.min(...values) : 0, averageLapMs: average(values),
durationMs: Math.max(0, endedAt - startedAt),
+ consistencyPct: values.length >= 3 ? Math.round(publicTrainingSpread(values) * 10) / 10 : null,
// Lap times only (no timestamps) for the fold-out list on the driver's page.
laps: stint.laps.slice(0, 300).map((lap) => ({ lapMs: lap.lapMs, excluded: Boolean(lap.excludedFromPace) })),
};
diff --git a/src/app.js b/src/app.js
index 907bb09..76dcacf 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1665,8 +1665,9 @@ const TRANSLATIONS = {
"training.stint_analysis": "Stintanalys",
"training.stint_average": "Snitt",
"training.stint_lap_times": "Varvtider per stint",
- "training.stint_lap_times_hint": "Tryck på en stint för att se alla varvtider. ★ = bästa varvet, röd = över 15 % långsammare än stintens median, startvarv = första varvet efter en paus.",
+ "training.stint_lap_times_hint": "Tryck på en stint för att se alla varvtider. grön = stintens snabbaste varv, lila = dagens snabbaste, röd = över 15 % långsammare än stintens median, startvarv = första varvet efter en paus.",
"training.stint_out_lap": "Startvarv",
+ "training.stint_total_time": "Totaltid",
"training.stint_analysis_hint": "En passering över inställd max varvtid, eller en paus över två minuter utan maxgräns, startar en ny stint. Övergångsvarvet räknas i race men inte i pace. 5-min resultat visar 300 sekunder plus sista påbörjade varvet.",
"training.best_stint": "Bästa stint {stint}: {laps} varv, {pace}",
"training.stint_five_minute": "5-min resultat",
@@ -3923,8 +3924,9 @@ const TRANSLATIONS = {
"training.stint_analysis": "Stint analysis",
"training.stint_average": "Average",
"training.stint_lap_times": "Lap times per stint",
- "training.stint_lap_times_hint": "Tap a stint to see every lap time. ★ = best lap, red = over 15% slower than the stint median, out lap = first lap after a break.",
+ "training.stint_lap_times_hint": "Tap a stint to see every lap time. green = fastest lap of the stint, purple = fastest of the day, red = over 15% slower than the stint median, out lap = first lap after a break.",
"training.stint_out_lap": "Out lap",
+ "training.stint_total_time": "Total time",
"training.stint_analysis_hint": "A passing over the configured maximum lap time, or a break over two minutes without a max limit, starts a new stint. The transition lap counts in the race but not in pace. The 5-minute result covers 300 seconds plus the final started lap.",
"training.best_stint": "Best stint {stint}: {laps} laps, {pace}",
"training.stint_five_minute": "5-minute result",
diff --git a/src/public_training.css b/src/public_training.css
index 9f96d1d..98c6f2d 100644
--- a/src/public_training.css
+++ b/src/public_training.css
@@ -1522,13 +1522,14 @@ button {
/* Fold-out practice stints with every lap (src/stint_laps_view.js) - same block in styles.css and public_training.css. */
.stint-laps { display: grid; gap: 8px; margin: 8px 0 14px; }
.stint-laps-card { border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--text) 3%, transparent); overflow: hidden; }
-.stint-laps-card > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px; cursor: pointer; list-style: none; }
+.stint-laps-card > summary { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 36px 10px 14px; cursor: pointer; list-style: none; }
.stint-laps-card > summary::-webkit-details-marker { display: none; }
-.stint-laps-card > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.15s; }
+.stint-laps-card > summary::after { content: "▾"; position: absolute; top: 12px; right: 14px; color: var(--muted); transition: transform 0.15s; }
.stint-laps-card[open] > summary::after { transform: rotate(180deg); }
.stint-laps-head { display: flex; flex-direction: column; min-width: 120px; }
.stint-laps-head small { color: var(--muted); font-size: 0.8rem; }
-.stint-laps-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; }
+.stint-laps-stats { display: grid; grid-template-columns: repeat(5, auto); gap: 6px 18px; }
+@media (max-width: 520px) { .stint-laps-stats { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stint-laps-stats > span { display: inline-flex; flex-direction: column; min-width: 4.5em; font-variant-numeric: tabular-nums; font-weight: 700; }
.stint-laps-stats small { color: var(--muted); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stint-lap-list { margin: 0; padding: 4px 14px 12px; list-style: none; border-top: 1px solid var(--line); columns: 2 260px; column-gap: 24px; }
@@ -1540,8 +1541,25 @@ button {
.stint-lap-delta { color: var(--muted); font-size: 0.82rem; text-align: right; }
.stint-lap.is-best .stint-lap-time, .stint-lap.is-best .stint-lap-delta { color: var(--green, var(--ok)); }
.stint-lap.is-best .stint-lap-bar i { background: var(--green, var(--ok)); }
+.stint-lap.is-day-best .stint-lap-time, .stint-lap.is-day-best .stint-lap-delta, .stint-laps-stats .is-day-best { color: #b67cff; }
+.stint-lap.is-day-best .stint-lap-bar i { background: #a259ff; }
+.stint-laps-stats .is-best { color: var(--green, var(--ok)); }
+.stint-laps-stats .is-best small, .stint-laps-stats .is-day-best small { color: var(--muted); }
.stint-lap.is-slow .stint-lap-time { color: var(--accent); }
.stint-lap.is-slow .stint-lap-bar i { background: var(--accent); }
.stint-lap.is-excluded { opacity: 0.55; }
.stint-laps-empty { color: var(--muted); }
.stint-laps-title { margin: 12px 0 2px; }
+
+/* Standard / Pro mode switch: Pro keeps the header, the name and today's stints only. */
+.profile-mode-switch { position: absolute; top: 14px; right: 14px; z-index: 1; display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
+.profile-mode-switch button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
+.profile-mode-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
+.public-training-root.is-pro > :not(.profile-header):not(.profile-hero):not(.profile-pro) { display: none !important; }
+.public-training-root.is-pro #profileSource, .public-training-root.is-pro #profileLayout { display: none; }
+.public-training-root.is-pro .profile-class-select:has(#profileSource), .public-training-root.is-pro .profile-class-select:has(#profileLayout) { display: none; }
+.profile-pro { display: grid; gap: 14px; margin-top: 14px; }
+.profile-pro .profile-stat-grid { margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
+@media (max-width: 520px) { .profile-pro .profile-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
+.profile-pro-stints .profile-card-body > p { margin: 0 0 6px; color: var(--muted); font-size: 0.86rem; }
+@media (max-width: 520px) { .profile-mode-switch { position: static; margin-bottom: 12px; } }
diff --git a/src/public_training.js b/src/public_training.js
index 33d3aac..7e66150 100644
--- a/src/public_training.js
+++ b/src/public_training.js
@@ -10,6 +10,14 @@ const DEFAULT_TIMER_CONFIG = Object.freeze({ pushMinutes: 10, controlMinutes: 10
const MAX_TIMER_BLOCK_MINUTES = 120;
let selectedClassId = new URLSearchParams(window.location.search).get("class") || "";
let selectedLayout = new URLSearchParams(window.location.search).get("layout") || "current";
+// "pro" = a clean practice view: today's numbers and the stint cards, nothing else.
+// From the link (?mode=pro) first, else what this phone chose last time.
+const MODE_STORAGE_KEY = "rcPublicTrainingMode";
+let profileMode = (() => {
+ const fromUrl = new URLSearchParams(window.location.search).get("mode");
+ if (fromUrl === "pro" || fromUrl === "standard") return fromUrl;
+ try { return localStorage.getItem(MODE_STORAGE_KEY) === "pro" ? "pro" : "standard"; } catch { return "standard"; }
+})();
let selectedSource = new URLSearchParams(window.location.search).get("source") || "practice";
const messages = {
@@ -25,6 +33,17 @@ const messages = {
loadError: "Kunde inte läsa träningsprofilen. Länken kan vara avstängd eller ersatt.",
development: "Förarutveckling",
class: "Klass",
+ modePro: "Pro",
+ modeStandard: "Standard",
+ stintTotal: "Totaltid",
+ stintConsistency: "Jämnhet",
+ todayAverage: "Snitt idag",
+ todayDriveTime: "Körtid idag",
+ modeLabel: "Visning",
+ todayLaps: "Varv idag",
+ todayBest: "Bästa idag",
+ personalBest: "Personbästa",
+ todayStints: "Stintar idag",
drivingOtherClass: "Dina senaste varv i dag är i {className}. Passet och övningarna räknar bara vald klass.",
switchClass: "Byt till {className}",
layoutStats: "Banlayout",
@@ -113,7 +132,7 @@ const messages = {
stintBest: "Bästa",
stintLapList: "Varvtider",
stintExcluded: "Startvarv",
- stintLapsHint: "Tryck på en stint för att se alla varvtider. ★ = bästa varvet, röd = över 15 % långsammare än stintens median.",
+ stintLapsHint: "Tryck på en stint för att se alla varvtider. Grön = stintens snabbaste varv, lila = dagens snabbaste, röd = över 15 % långsammare än stintens median.",
paceBlocks: "Tempo per aktivt 30-minutersblock",
paceBlocksHint: "Visar bara block där bilen har registrerat giltiga varv.",
markerTitle: "Markera en biländring",
@@ -206,6 +225,17 @@ const messages = {
loadError: "The training profile could not be loaded. The link may be disabled or replaced.",
development: "Driver development",
class: "Class",
+ modePro: "Pro",
+ modeStandard: "Standard",
+ stintTotal: "Total time",
+ stintConsistency: "Consistency",
+ todayAverage: "Average today",
+ todayDriveTime: "Drive time today",
+ modeLabel: "View",
+ todayLaps: "Laps today",
+ todayBest: "Best today",
+ personalBest: "Personal best",
+ todayStints: "Stints today",
drivingOtherClass: "Your latest laps today are in {className}. The pass and the exercises only count the selected class.",
switchClass: "Switch to {className}",
layoutStats: "Track layout",
@@ -294,7 +324,7 @@ const messages = {
stintBest: "Best",
stintLapList: "Lap times",
stintExcluded: "Out lap",
- stintLapsHint: "Tap a stint to see every lap time. ★ = best lap, red = over 15% slower than the stint median.",
+ stintLapsHint: "Tap a stint to see every lap time. Green = fastest lap of the stint, purple = fastest of the day, red = over 15% slower than the stint median.",
paceBlocks: "Pace per active 30-minute block",
paceBlocksHint: "Only blocks containing valid recorded laps are shown.",
markerTitle: "Mark a car change",
@@ -413,6 +443,12 @@ function formatRaceResultTime(ms) {
return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(centiseconds).padStart(2, "0")}:${String(millis).padStart(3, "0")}`;
}
+// "5:14" - how long a stint lasted.
+function formatStintDuration(ms) {
+ const seconds = Math.max(0, Math.round(Number(ms || 0) / 1000));
+ return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
+}
+
function formatTimer(ms) {
const seconds = Math.max(0, Math.ceil(ms / 1000));
return `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
@@ -654,9 +690,11 @@ function renderProfile(data) {
const paceBuckets = Array.isArray(stats.paceBuckets) ? stats.paceBuckets : [];
const paceBucketMarkup = paceBuckets.length ? paceBuckets.map((bucket) => `
-
`; // Practice: fold-out stint cards with every lap. Races/all keep the plain table. + const proMode = profileMode === "pro"; + root.classList.toggle("is-pro", proMode); const stintCards = (data.lapSource || "practice") === "practice" ? renderStintLapCards(stats.stintSummaries, { - formatLap, formatDuration: formatRaceResultTime, escapeHtml, locale: language, openIds: openStintLapCardIds(root), - labels: { stint: t("stintNumber"), laps: t("stintLaps"), best: t("stintBest"), average: t("average"), duration: t("duration"), lap: t("stintLapList"), excluded: t("stintExcluded"), empty: t("noStints") }, + formatLap, formatDuration: formatStintDuration, escapeHtml, locale: language, openIds: openStintLapCardIds(root), + labels: { stint: t("stintNumber"), laps: t("stintLaps"), best: t("stintBest"), average: t("average"), duration: t("stintTotal"), consistency: t("stintConsistency"), lap: t("stintLapList"), excluded: t("stintExcluded"), empty: t("noStints") }, }) : ""; const stintRows = stats.stintSummaries.length ? stats.stintSummaries.slice(0, 6).map((stint) => `