feat(series): rookie rounds can pick drivers from other classes, with a guide section (1.75.0)
This commit is contained in:
1 parent
bea4283130
commit
d5337e2cf3
11 files changed
+103
-9
No files matched your search
@@ -8,6 +8,12 @@ The application version is maintained in `package.json` and displayed in the adm
|
||||
|
||||
No changes recorded yet.
|
||||
|
||||
## 1.75.0
|
||||
|
||||
### Added
|
||||
- Series: a round's driver list offers **Drivers from other classes** (folded, open when the class has none), like Race Setup. A Rookie round can take 2WD and 4WD drivers with their existing driver and transponder, without registering them again; the ticked ones stay on the round's list and Copy from previous carries them on.
|
||||
- Guide (Series / cup tab) and README: how to set up a Rookie class, for a single race, a new series and a series already running.
|
||||
|
||||
## 1.74.1
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -210,6 +210,17 @@ Menu **Series / cup** runs a championship over any number of rounds, with freely
|
||||
- Ties go to most wins, then 2nd places, then the latest common round.
|
||||
- Print, or export as PDF (wide tables switch to landscape).
|
||||
|
||||
#### Rookie class (2WD/4WD drivers in their own race)
|
||||
|
||||
Rookies are not registered again: they race with the driver and transponder they already have in 2WD or 4WD, and 2WD and 4WD can be mixed.
|
||||
|
||||
1. **Classes:** create a class called Rookie, with no drivers of its own.
|
||||
2. **Single race:** in Race Setup, create the race with class Rookie and tick the rookies under Participants → **Drivers from other classes**.
|
||||
3. **Series:** tick Rookie under the series' classes. For a series already running, paste the same dates again and press Create rounds: only the missing Rookie rounds are made.
|
||||
4. **Each round:** open the driver list on the Rookie row, then tick the rookies under **Drivers from other classes**. Copy from previous takes the same rookies next time.
|
||||
|
||||
Rookie gets its own standings with the series' points table, count rule and club rule; points never mix with the driver's 2WD/4WD standings. Race format, open practice and lap time limits are not affected.
|
||||
|
||||
### Practice and training statistics
|
||||
|
||||
**Practice sessions:**
|
||||
|
||||
@@ -223,6 +223,17 @@ Menyn **Serier / cup** kör ett mästerskap över valfritt antal deltävlingar,
|
||||
- Lika poäng avgörs av flest segrar, sedan andraplatser, sedan senaste gemensamma deltävling.
|
||||
- Skriv ut eller exportera som PDF (breda tabeller blir liggande A4).
|
||||
|
||||
#### Rookie-klass (förare från 2WD/4WD i eget race)
|
||||
|
||||
Rookies läggs inte upp igen: de kör med samma förare och transponder som de redan har i 2WD eller 4WD, och 2WD och 4WD kan blandas.
|
||||
|
||||
1. **Klasser:** skapa en klass som heter Rookie, utan egna förare.
|
||||
2. **Eget race:** i Race Setup, skapa racet med klass Rookie och bocka i rookies under Deltagare → **Förare från andra klasser**.
|
||||
3. **Serie:** bocka i Rookie bland seriens klasser. Är serien redan igång: klistra in samma datum igen och tryck Skapa deltävlingar, bara de saknade Rookie-deltävlingarna skapas.
|
||||
4. **Varje deltävling:** öppna förarlistan på Rookie-raden och bocka i rookies under **Förare från andra klasser**. Kopiera från förra tar samma rookies nästa gång.
|
||||
|
||||
Rookie får en egen ställning med seriens poängtabell, räkneregel och klubbregel; poängen blandas aldrig med förarens 2WD/4WD-ställning. Racets format, open practice och varvtidsgränser påverkas inte.
|
||||
|
||||
### Träning och träningsstatistik
|
||||
|
||||
**Träningspass:**
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "rc-racecore",
|
||||
"version": "1.74.1",
|
||||
"version": "1.75.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "rc-racecore",
|
||||
"version": "1.74.1",
|
||||
"version": "1.75.0",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^12.11.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rc-racecore",
|
||||
"version": "1.74.1",
|
||||
"version": "1.75.0",
|
||||
"private": true,
|
||||
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
|
||||
"engines": {
|
||||
|
||||
+31
-4
@@ -895,8 +895,19 @@ const getSeriesRounds = (series) => state.events
|
||||
return {
|
||||
event,
|
||||
className: getClassName(event.classId),
|
||||
classDrivers: state.drivers.filter((driver) => driver.classId === event.classId).sort(byDriverName),
|
||||
participantIds: getEventDrivers(event).map((driver) => driver.id),
|
||||
// The class's own drivers plus anyone ticked from another class (a Rookie round mixes
|
||||
// 2WD and 4WD drivers without registering them again); the rest of the club is offered
|
||||
// folded away as otherDrivers.
|
||||
...(() => {
|
||||
const participantIds = getEventDrivers(event).map((driver) => driver.id);
|
||||
const club = state.drivers.filter((driver) => !driver.guestEventId);
|
||||
const roster = club.filter((driver) => driver.classId === event.classId || participantIds.includes(driver.id)).sort(byDriverName);
|
||||
return {
|
||||
participantIds,
|
||||
classDrivers: roster,
|
||||
otherDrivers: club.filter((driver) => !roster.includes(driver)).sort(byDriverName).map((driver) => ({ ...driver, className: getClassName(driver.classId) })),
|
||||
};
|
||||
})(),
|
||||
status: getSeriesRoundStatus(sessions),
|
||||
nextStep: getSeriesRoundNextStep(sessions, event.sessionOrder),
|
||||
qualHeatCount: new Set(qualSessions.map((session) => String(session.name || "").split(" ").pop())).size,
|
||||
@@ -1298,7 +1309,15 @@ const TRANSLATIONS = {
|
||||
"series.round_participants": "Deltagare: {count} av {total} i klassen",
|
||||
"series.copy_previous": "Kopiera från förra",
|
||||
"series.no_previous_round": "Ingen tidigare deltävling i samma klass.",
|
||||
"series.no_class_drivers": "Inga förare i klassen ännu - lägg till nedan.",
|
||||
"series.no_class_drivers": "Inga förare i klassen ännu - välj bland förare från andra klasser eller lägg till en ny nedan.",
|
||||
"series.other_class_hint": "Samma förare och transponder som i sin vanliga klass - inget behöver läggas upp igen. Poängen räknas i den här klassens tabell.",
|
||||
"guide.rookie_title": "Rookie-klass (förare från 2WD/4WD kör eget race)",
|
||||
"guide.rookie_1": "Rookies behöver inte läggas upp igen. De finns redan som förare i t.ex. 2WD eller 4WD och kör rookie-racet med samma förare och transponder. 2WD och 4WD kan blandas i samma rookie-race.",
|
||||
"guide.rookie_2": "1. Klasser: skapa en klass som heter Rookie. Den behöver inga egna förare.",
|
||||
"guide.rookie_3": "2. Eget race (Race Setup): skapa racet med klass Rookie. Under Deltagare fäller du ut Förare från andra klasser och bockar i rookie-förarna.",
|
||||
"guide.rookie_4": "3. Serie/cup: bocka i Rookie under klasser i steg 1 (sparas direkt). Finns serien redan: klistra in samma datum i steg 3 och tryck Skapa deltävlingar - bara de saknade Rookie-deltävlingarna skapas, de som finns rörs inte.",
|
||||
"guide.rookie_5": "4. Varje deltävling: klicka på antalet förare på Rookie-raden, fäll ut Förare från andra klasser och bocka i rookie-förarna. Nästa gång tar Kopiera från förra samma rookies.",
|
||||
"guide.rookie_6": "Rookie får en egen ställning i serien med samma poängtabell, räkneregel (bästa N) och klubbregel som resten av serien. Poängen blandas aldrig med föraren i 2WD/4WD. Racets format, kval, finaler, open practice och min/max varvtid påverkas inte. Rookie-racets varv syns i förarens träningsstatistik.",
|
||||
"series.new_driver_name": "Ny förare - namn",
|
||||
"series.add_driver": "Lägg till",
|
||||
"series.no_rounds": "Inga deltävlingar ännu - skapa dem ovan.",
|
||||
@@ -3425,7 +3444,15 @@ const TRANSLATIONS = {
|
||||
"series.round_participants": "Drivers: {count} of {total} in the class",
|
||||
"series.copy_previous": "Copy from previous",
|
||||
"series.no_previous_round": "No earlier round in the same class.",
|
||||
"series.no_class_drivers": "No drivers in the class yet - add one below.",
|
||||
"series.no_class_drivers": "No drivers in the class yet - pick from drivers in other classes or add a new one below.",
|
||||
"series.other_class_hint": "Same driver and transponder as in their usual class - nothing is registered again. Points count in this class's table.",
|
||||
"guide.rookie_title": "Rookie class (2WD/4WD drivers run their own race)",
|
||||
"guide.rookie_1": "Rookies are not registered again. They already exist as drivers in e.g. 2WD or 4WD and run the rookie race with the same driver and transponder. 2WD and 4WD can be mixed in one rookie race.",
|
||||
"guide.rookie_2": "1. Classes: create a class called Rookie. It needs no drivers of its own.",
|
||||
"guide.rookie_3": "2. A single race (Race Setup): create the race with class Rookie. Under Participants, open Drivers from other classes and tick the rookies.",
|
||||
"guide.rookie_4": "3. Series/cup: tick Rookie under classes in step 1 (saved at once). Series already running: paste the same dates in step 3 and press Create rounds - only the missing Rookie rounds are created, existing ones are left alone.",
|
||||
"guide.rookie_5": "4. Each round: click the driver count on the Rookie row, open Drivers from other classes and tick the rookies. Next time Copy from previous takes the same rookies.",
|
||||
"guide.rookie_6": "Rookie gets its own standings in the series with the same points table, count rule (best N) and club rule as the rest of the series. Points never mix with the driver's 2WD/4WD standings. The race format, qualifying, finals, open practice and min/max lap time are not affected. The rookie race's laps show in the driver's training stats.",
|
||||
"series.new_driver_name": "New driver - name",
|
||||
"series.add_driver": "Add",
|
||||
"series.no_rounds": "No rounds yet - create them above.",
|
||||
|
||||
@@ -114,6 +114,7 @@ export function renderGuideView({ dom, t }) {
|
||||
${renderGuidePanel("guide.series_day_title", ["guide.series_day_1", "guide.series_day_2", "guide.series_day_3", "guide.series_day_4", "guide.series_day_5", "guide.series_day_6"], "", { t })}
|
||||
${renderGuidePanel("guide.series_points_title", ["guide.series_points_1", "guide.series_points_2", "guide.series_points_3", "guide.series_points_4", "guide.series_points_5", "guide.series_points_6"], "", { t })}
|
||||
${renderGuidePanel("guide.series_example_title", ["guide.series_example_1", "guide.series_example_2", "guide.series_example_3", "guide.series_example_4"], "", { t })}
|
||||
${renderGuidePanel("guide.rookie_title", ["guide.rookie_1", "guide.rookie_2", "guide.rookie_3", "guide.rookie_4", "guide.rookie_5", "guide.rookie_6"], "", { t })}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
+6
-1
@@ -104,6 +104,10 @@ function renderRoundParticipants(round, { t, escapeHtml }) {
|
||||
${round.classDrivers.length ? `<div class="series-class-list">${round.classDrivers.map((driver) => `
|
||||
<label class="series-class-row ${round.participantIds.includes(driver.id) ? "is-selected" : ""}"><input type="checkbox" data-round-driver="${escapeHtml(driver.id)}" ${round.participantIds.includes(driver.id) ? "checked" : ""} /><span>${escapeHtml(driver.name)}${driver.transponder ? ` <small>${escapeHtml(driver.transponder)}</small>` : ""}</span></label>`).join("")}</div>`
|
||||
: `<p class="hint">${t("series.no_class_drivers")}</p>`}
|
||||
${(round.otherDrivers || []).length ? `<details class="series-other-drivers" ${round.classDrivers.length ? "" : "open"}><summary>${t("events.other_class_participants", { count: round.otherDrivers.length })}</summary>
|
||||
<p class="hint">${t("series.other_class_hint")}</p>
|
||||
<div class="series-class-list">${round.otherDrivers.map((driver) => `
|
||||
<label class="series-class-row"><input type="checkbox" data-round-driver="${escapeHtml(driver.id)}" /><span>${escapeHtml(driver.name)} <small>${escapeHtml(driver.className || "")}${driver.transponder ? ` · ${escapeHtml(driver.transponder)}` : ""}</small></span></label>`).join("")}</div></details>` : ""}
|
||||
<form class="series-add-driver" data-round-add-driver>
|
||||
<input name="name" required placeholder="${escapeHtml(t("series.new_driver_name"))}" />
|
||||
<input name="transponder" placeholder="${escapeHtml(t("drivers.transponder_placeholder"))}" inputmode="numeric" />
|
||||
@@ -397,7 +401,8 @@ export function renderSeriesView(deps) {
|
||||
detail.querySelectorAll("[data-round-driver]").forEach((box) => box.addEventListener("change", () => { setSeriesRoundParticipants(eventId, ticked()); renderView(); }));
|
||||
detail.querySelectorAll("[data-round-action]").forEach((button) => button.addEventListener("click", () => {
|
||||
const action = button.dataset.roundAction;
|
||||
if (action === "all") setSeriesRoundParticipants(eventId, [...detail.querySelectorAll("[data-round-driver]")].map((box) => box.dataset.roundDriver));
|
||||
// "All" means the class's own list, not the folded drivers from other classes.
|
||||
if (action === "all") setSeriesRoundParticipants(eventId, [...detail.querySelectorAll(".series-class-list:not(.series-other-drivers *) [data-round-driver]")].map((box) => box.dataset.roundDriver));
|
||||
if (action === "none") setSeriesRoundParticipants(eventId, []);
|
||||
if (action === "copy" && !copySeriesRoundParticipants(series, eventId)) window.alert(t("series.no_previous_round"));
|
||||
renderView();
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function runGuideTabsSmoke({ evaluate, navigate }) {
|
||||
// The series tab explains the whole series workflow, step by step.
|
||||
await evaluate(`document.querySelector('[data-guide-tab="series"]').click()`);
|
||||
const seriesText = await evaluate(`document.querySelector('[data-guide-panel="series"]').innerText`);
|
||||
assert.equal(await evaluate(`document.querySelectorAll('[data-guide-panel="series"] .guide-list li').length`), 21, "four sections, 21 steps");
|
||||
assert.equal(await evaluate(`document.querySelectorAll('[data-guide-panel="series"] .guide-list li').length`), 27, "five sections (with Rookie), 27 steps");
|
||||
assert.ok(!/guide\.series_/.test(seriesText), "every guide text is translated");
|
||||
assert.equal(await evaluate(`[...document.querySelectorAll("#guideOverview .guide-overview-card strong")].some((node) => /Serie|Series/.test(node.textContent))`), true, "the overview has a series card");
|
||||
console.log("PASS the guide has a Series / cup tab with the whole workflow");
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
// Rookie class in a series: the Rookie round offers drivers from other classes (2WD and 4WD
|
||||
// mixed) without registering them again, and a ticked rookie stays on the round's list.
|
||||
export async function runSeriesRookieSmoke({ evaluate, navigate, savedState, waitFor, base }) {
|
||||
const seeded = await savedState();
|
||||
const round = { id: "rk_round", name: "RK Cup #1 Rookie", date: "2026-03-01", classId: "rk_rookie", mode: "race", raceConfig: {} };
|
||||
await fetch(base + "/api/state", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({
|
||||
...seeded,
|
||||
classes: [...seeded.classes, { id: "rk_rookie", name: "RK Rookie" }, { id: "rk_2wd", name: "RK 2WD" }, { id: "rk_4wd", name: "RK 4WD" }],
|
||||
drivers: [...seeded.drivers, { id: "rk_ada", name: "RK Ada", classId: "rk_2wd", transponder: "8670001" }, { id: "rk_ben", name: "RK Ben", classId: "rk_4wd", transponder: "8670002" }],
|
||||
events: [...seeded.events, round],
|
||||
series: [...(seeded.series || []), { id: "rk_series", name: "RK Cup", classIds: ["rk_rookie"], eventIds: [round.id] }],
|
||||
}) });
|
||||
const driverIds = async () => (await savedState()).events.find((event) => event.id === round.id).raceConfig.driverIds || [];
|
||||
|
||||
await navigate("series", "seriesNew");
|
||||
await evaluate(`document.querySelector('[data-series-select="rk_series"]')?.click()`);
|
||||
await waitFor(async () => evaluate(`Boolean(document.querySelector('tr[data-round="rk_round"]'))`), "the Rookie round is listed");
|
||||
await evaluate(`document.querySelector('tr[data-round="rk_round"] [data-round-action="toggle"]').click()`);
|
||||
await waitFor(async () => evaluate(`Boolean(document.querySelector(".series-other-drivers[open]"))`), "drivers from other classes are offered (open, the class has none)");
|
||||
assert.match(await evaluate(`document.querySelector(".series-other-drivers").textContent`), /RK Ada[\s\S]*RK 2WD[\s\S]*RK Ben[\s\S]*RK 4WD/, "each with their own class");
|
||||
for (const id of ["rk_ada", "rk_ben"]) {
|
||||
await evaluate(`(() => { const box = document.querySelector('.series-other-drivers [data-round-driver="${id}"]'); box.checked = true; box.dispatchEvent(new Event("change")); })()`);
|
||||
await waitFor(async () => (await driverIds()).includes(id), `${id} ticked for the Rookie round`);
|
||||
}
|
||||
const state = await savedState();
|
||||
assert.deepEqual(state.drivers.filter((driver) => /^RK (Ada|Ben)$/.test(driver.name)).map((driver) => driver.id).sort(), ["rk_ada", "rk_ben"], "no driver registered again");
|
||||
await waitFor(async () => evaluate(`Boolean(document.querySelector('.series-round-participants > .series-class-list [data-round-driver="rk_ben"]:checked'))`), "a ticked rookie moves to the round's own list");
|
||||
console.log("PASS a Rookie round in a series takes 2WD and 4WD drivers from their own classes without registering them again");
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import { runPracticeResetSmoke } from "./browser_practice_reset.js";
|
||||
import { runPracticeRankingSmoke, runSpeakerPanelSmoke } from "./browser_practice_ranking.js";
|
||||
import { runJudgingAfterRaceSmoke } from "./browser_judging_after.js";
|
||||
import { runArchiveQualifyingSmoke } from "./browser_archive_qual.js";
|
||||
import { runSeriesRookieSmoke } from "./browser_series_rookie.js";
|
||||
import { runSuspectLapsSmoke } from "./browser_suspect_laps.js";
|
||||
import { runOverlayDriverLinkSmoke } from "./browser_overlay_driver_link.js";
|
||||
import { runProfileClassSmoke } from "./browser_profile_class.js";
|
||||
@@ -173,6 +174,7 @@ try {
|
||||
await runSpeakerPanelSmoke({ evaluate, navigate, savedState, waitFor });
|
||||
await runJudgingAfterRaceSmoke({ evaluate, navigate, savedState, waitFor, base, dialogs });
|
||||
await runArchiveQualifyingSmoke({ evaluate, navigate, savedState, waitFor, base });
|
||||
await runSeriesRookieSmoke({ evaluate, navigate, savedState, waitFor, base });
|
||||
await runSuspectLapsSmoke({ evaluate, navigate, savedState, waitFor, base, dialogs });
|
||||
await runOverlayDriverLinkSmoke({ evaluate, navigate, savedState, waitFor, base, send });
|
||||
await runDecoderClockSmoke({ evaluate, navigate, savedState, waitFor, base });
|
||||
|
||||
Reference in new issue
Block a user