diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4a7894c..b751784 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,12 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
+## 1.42.3 - 2026-10-25
+
+### Fixed
+
+- **Mobile profile with several classes showed no laps in a pass.** A driver with one car per class (e.g. 2WD, 4WD, Truck) got the profile opened on the first registered class, while a practice pass, Even laps and Step training only count the selected class - so laps driven with the 4WD never showed up. The profile now opens on the class driven last, and when today's latest laps are in another class than the selected one it says so with a **Switch to …** button.
+
## 1.42.2 - 2026-10-23
### Fixed
diff --git a/package-lock.json b/package-lock.json
index 0c6eb1c..41a6cff 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "rc-racecore",
- "version": "1.42.2",
+ "version": "1.42.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rc-racecore",
- "version": "1.42.2",
+ "version": "1.42.3",
"hasInstallScript": true,
"dependencies": {
"better-sqlite3": "^12.11.1",
diff --git a/package.json b/package.json
index 7aea0ba..a6fa885 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "rc-racecore",
- "version": "1.42.2",
+ "version": "1.42.3",
"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 c7a8573..cbb260f 100644
--- a/server/public_training_profile.js
+++ b/server/public_training_profile.js
@@ -161,6 +161,8 @@ function buildPublicTrainingProfile(state, shareToken, updatedAt, sinceTimestamp
return {
classId,
className: String(classes.find((item) => String(item?.id || "") === classId)?.name || "").trim(),
+ // The phone opens on the class driven last and points out a switch (see public_training.js).
+ lastLapAt: classLaps.length ? classLaps[classLaps.length - 1].timestamp : 0,
brand: brands.join(" / "),
stats: filterPublicTrainingStats(stats, visibility),
channelStats: visibility.performance ? channelStats : {},
diff --git a/src/public_training.css b/src/public_training.css
index deff879..09c496f 100644
--- a/src/public_training.css
+++ b/src/public_training.css
@@ -1505,3 +1505,16 @@ button {
.public-training-connection[data-state="failed"], .public-training-connection[data-state="stale"] { color: var(--gold); }
.public-training-connection button { flex-shrink: 0; padding: 6px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.public-training-connection button[hidden] { display: none; }
+
+/* "Your latest laps today are in 4WD" - the pass and exercises only count the selected class. */
+.profile-class-switch {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 8px 12px;
+ margin: 12px 0 0;
+ padding: 10px 12px;
+ border-radius: 10px;
+ border: 1px solid rgba(245, 166, 35, 0.6);
+ background: rgba(245, 166, 35, 0.12);
+}
diff --git a/src/public_training.js b/src/public_training.js
index 732c814..073b4a6 100644
--- a/src/public_training.js
+++ b/src/public_training.js
@@ -23,6 +23,8 @@ const messages = {
loadError: "Kunde inte läsa träningsprofilen. Länken kan vara avstängd eller ersatt.",
development: "Förarutveckling",
class: "Klass",
+ drivingOtherClass: "Dina senaste varv i dag är i {className}. Passet och övningarna räknar bara vald klass.",
+ switchClass: "Byt till {className}",
layoutStats: "Banlayout",
lapSource: "Underlag",
lapSourcePractice: "Träning",
@@ -197,6 +199,8 @@ const messages = {
loadError: "The training profile could not be loaded. The link may be disabled or replaced.",
development: "Driver development",
class: "Class",
+ 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",
lapSource: "Based on",
lapSourcePractice: "Practice",
@@ -530,8 +534,14 @@ function renderProfile(data) {
const { profile, branding } = data;
const visibility = { progress: true, achievements: true, performance: true, goals: true, history: true, ...(data.visibility || {}) };
const classProfiles = Array.isArray(data.classProfiles) ? data.classProfiles : [];
- let activeClass = classProfiles.find((item) => String(item.classId || "") === selectedClassId) || classProfiles[0] || null;
+ // A driver with several classes (one car each): open on the class driven last, not the first
+ // registered one - a practice pass, Even laps and Step training only count the selected class,
+ // so the wrong one showed no laps at all.
+ const lastDrivenClass = classProfiles.reduce((latest, item) => (Number(item.lastLapAt || 0) > Number(latest?.lastLapAt || 0) ? item : latest), null);
+ let activeClass = classProfiles.find((item) => String(item.classId || "") === selectedClassId) || lastDrivenClass || classProfiles[0] || null;
if (activeClass && selectedClassId !== activeClass.classId) selectedClassId = activeClass.classId;
+ const drivingOtherClass = lastDrivenClass && activeClass && lastDrivenClass.classId !== activeClass.classId
+ && getLocalDayKey(lastDrivenClass.lastLapAt) === getLocalDayKey(Date.now()) ? lastDrivenClass : null;
const stats = { dailySummaries: [], paceHistory: [], achievements: [], stintSummaries: [], ...(activeClass?.stats || data.stats || {}) };
const channelStats = activeClass?.channelStats || data.channelStats || {};
const nextMilestone = activeClass?.nextMilestone || data.nextMilestone;
@@ -658,6 +668,7 @@ function renderProfile(data) {
${renderLayoutSelect(data.trackLayouts)}
${renderSourceSelect(data.lapSource)}
+ ${drivingOtherClass ? `