fix(houseofrc): link hand-added drivers who enter later; fix qualifying rounds hint in the race wizard (1.84.1)

This commit is contained in:
larssand committed 2026-11-08 21:11:23 +01:00
1 parent 0a4c017e44
commit f14cdb8c97
8 files changed
+27 -8

No files matched your search

+5
View File
@@ -8,6 +8,11 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
## 1.84.1
- **House of RC:** a driver you added to the race by hand who later enters on House of RC is now linked to that entry by **🔄 Fetch changes from House of RC** ("Already racing – linked to the entry"), so their results are sent too. Before, they were skipped and their results never reached House of RC.
- **Race wizard:** the field *Qualifying rounds* had the help text for the heat length ("Length of each qualifying heat in minutes"). It now says how many rounds are made; the length comes from the format and is changed under Manage → Format.
## 1.84.0
- **Create finals from Race Day:** when the last qualifying heat of a race has run (or its practice, when the finals are seeded from practice) and it has no finals yet, Race Day shows **🏁 All qualifying run – create finals** next to the heat controls. It does the same as Manage → Format → Create finals from qualifying and takes you to the first final.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "rc-racecore",
"version": "1.84.0",
"version": "1.84.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rc-racecore",
"version": "1.84.0",
"version": "1.84.1",
"hasInstallScript": true,
"dependencies": {
"better-sqlite3": "^12.11.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rc-racecore",
"version": "1.84.0",
"version": "1.84.1",
"private": true,
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
"engines": {
+4
View File
@@ -2222,6 +2222,7 @@ const TRANSLATIONS = {
"houseofrc.entries_class": "Klass hos oss",
"houseofrc.entries_hor_class": "Klass på House of RC",
"houseofrc.refresh_button": "Hämta ändringar från House of RC",
"houseofrc.refresh_link_only": "Kör redan – kopplas till anmälan",
"houseofrc.results_button": "Skicka resultat till House of RC",
"houseofrc.results_hint": "Förhandsgranska och skicka resultatet till {name}",
"houseofrc.results_title": "Skicka resultat till House of RC",
@@ -2336,6 +2337,7 @@ const TRANSLATIONS = {
"events.qualifying_scoring_best": "Bästa runda / rank",
"events.qualifying_rounds": "Antal kvalrundor",
"events.qualifying_rounds_hint": "Hur många kvalomgångar som ska skapas totalt.",
"events.wizard_use_qualifying_hint": "Kvalet ger placeringen in i finalerna. Längd och startsätt kommer från formatet och kan ändras i Hantera → Format.",
"events.cars_per_heat": "Förare per kvalheat",
"events.cars_per_heat_hint": "Hur många förare som placeras i varje kvalheat.",
"events.qual_duration": "Kvaltid (min)",
@@ -4463,6 +4465,7 @@ const TRANSLATIONS = {
"houseofrc.entries_class": "Our class",
"houseofrc.entries_hor_class": "Class on House of RC",
"houseofrc.refresh_button": "Fetch changes from House of RC",
"houseofrc.refresh_link_only": "Already racing – linked to the entry",
"houseofrc.results_button": "Send results to House of RC",
"houseofrc.results_hint": "Preview and send the results to {name}",
"houseofrc.results_title": "Send results to House of RC",
@@ -4577,6 +4580,7 @@ const TRANSLATIONS = {
"events.qualifying_scoring_best": "Best round / rank",
"events.qualifying_rounds": "Qualifying rounds",
"events.qualifying_rounds_hint": "How many qualifying rounds should be generated in total.",
"events.wizard_use_qualifying_hint": "Qualifying decides who goes into which final. Length and start mode come from the format and can be changed in Manage → Format.",
"events.cars_per_heat": "Drivers per qualifying heat",
"events.cars_per_heat_hint": "How many drivers go into each qualifying heat.",
"events.qual_duration": "Qualifying duration (min)",
+5 -2
View File
@@ -141,7 +141,7 @@ export function rememberHouseOfRcClass(classes = [], classId = "", name = "") {
// Re-fetch for a race made from House of RC: which entries of its class are new, and which of
// our participants' entries are gone (withdrawn or moved to the waiting list - the server
// leaves those out). Participants added by hand (no entry id) are never touched.
// leaves those out). Participants added by hand (no entry id) are never taken out.
export function diffHouseOfRcEntries(event, entries = [], drivers = []) {
const link = event?.houseOfRc || {};
const entryIds = link.entryIds || {};
@@ -149,7 +149,10 @@ export function diffHouseOfRcEntries(event, entries = [], drivers = []) {
const classEntries = entries.filter((entry) => link.classId == null || entry.classId === link.classId);
const known = new Set(Object.entries(entryIds).filter(([driverId]) => participants.has(driverId)).map(([, entryId]) => entryId));
const plan = planHouseOfRcEntries(classEntries, drivers, event?.classId || "");
const added = plan.filter((row) => !known.has(row.entry.entryId) && !(row.driverId && participants.has(row.driverId) && entryIds[row.driverId] == null));
// A participant added by hand who has now entered on House of RC is linked to the entry
// (linkOnly: already racing, so only the entry id is recorded, for the results).
const added = plan.filter((row) => !known.has(row.entry.entryId))
.map((row) => (row.driverId && participants.has(row.driverId) ? { ...row, linkOnly: true } : row));
const current = new Set(classEntries.map((entry) => entry.entryId));
const withdrawn = Object.entries(entryIds)
.filter(([driverId, entryId]) => participants.has(driverId) && !current.has(entryId))
+1 -1
View File
@@ -330,7 +330,7 @@ export async function openHouseOfRcEntryRefresh({ event, state, t, escapeHtml, m
<div class="table-wrap"><table class="hor-import-table"><tbody>${diff.added.map((row, index) => `<tr>
<td><input type="checkbox" data-hor-add="${index}" checked /></td>
<td>${escapeHtml(row.entry.name)}</td><td>${escapeHtml(row.entry.club || "–")}</td><td>${escapeHtml(row.entry.car || "–")}</td><td>${escapeHtml(row.transponder || "–")}</td>
<td><span class="pill ${row.status === "new" ? "pill-warn" : "pill-green"}">${escapeHtml(t(`houseofrc.entry_${row.status}`))}</span></td>
<td><span class="pill ${row.status === "new" ? "pill-warn" : "pill-green"}">${escapeHtml(t(row.linkOnly ? "houseofrc.refresh_link_only" : `houseofrc.entry_${row.status}`))}</span></td>
</tr>`).join("")}</tbody></table></div>` : ""}
${diff.withdrawn.length ? `<h4 class="mt-16">➖ ${escapeHtml(t("houseofrc.refresh_withdrawn", { count: diff.withdrawn.length }))}</h4>
<div class="table-wrap"><table class="hor-import-table"><tbody>${diff.withdrawn.map((driver) => `<tr>
+2 -2
View File
@@ -154,12 +154,12 @@ export function renderRaceWizardContent(draft, classOptions, wizardDrivers, pres
${!isEndurance ? `
<label class="field-card">
<span class="field-label">${t("events.wizard_use_qualifying")}</span>
<span class="field-hint">${t("events.qualifying_rounds_hint")}</span>
<span class="field-hint">${t("events.wizard_use_qualifying_hint")}</span>
<label class="toggle"><input type="checkbox" name="createQualifying" ${draft.createQualifying ? "checked" : ""} /><span>${t("events.wizard_use_qualifying")}</span></label>
</label>
<label class="field-card">
<span class="field-label">${t("events.wizard_qualifying_rounds")}</span>
<span class="field-hint">${t("events.qual_duration_hint")}</span>
<span class="field-hint">${t("events.qualifying_rounds_hint")}</span>
<input type="number" min="0" step="1" name="qualifyingRounds" value="${draft.qualifyingRounds}" ${draft.createQualifying ? "" : "disabled"} />
</label>
` : `
+7
View File
@@ -104,6 +104,13 @@ test("House of RC re-fetch: late entries are added, withdrawn ones offered for r
assert.deepEqual(event.houseOfRc.entryIds, { a: 11, late: 14 });
assert.equal(drivers.find((driver) => driver.id === "late").transponder, "9");
assert.deepEqual(diffHouseOfRcEntries({ ...event, raceConfig: { driverIds: ids } }, entries, drivers), { added: [], withdrawn: [] }, "fetching again finds nothing new");
// The hand-added driver enters on House of RC later: linked, not added twice.
event.raceConfig.driverIds = ids;
const later = diffHouseOfRcEntries(event, [...entries, { entryId: 17, classId: 555, houseOfRcId: 10, name: "Hand Added", transponders: ["3"] }], drivers);
assert.deepEqual(later.added.map((row) => [row.entry.name, Boolean(row.linkOnly)]), [["Hand Added", true]]);
const linkedIds = applyHouseOfRcEntryChanges(event, drivers, later, { addIndexes: new Set([0]), removeIds: new Set(), makeDriver: () => { throw new Error("no new driver"); } });
assert.deepEqual(linkedIds, ["a", "h", "late"], "same participants, same order");
assert.equal(event.houseOfRc.entryIds.h, 17, "now gets its results sent");
});
test("House of RC results: heats and qualifying without placings, then final placings by main", async () => {