docs(videos): re-record video guides and add sponsor, team race, practice ranking, race overview and judging clips (1.70.2)
Also fix team race length chosen in Manage being dropped before the race is created.
This commit is contained in:
1 parent
eb69764e9e
commit
8f748d21df
23 files changed
+312
-8
No files matched your search
@@ -164,6 +164,9 @@ async function recordClip(name, { prepare, seedState, setup, steps }) {
|
||||
frameCount += 1;
|
||||
writeFileSync(join(framesDir, `frame_${String(frameCount).padStart(6, "0")}.jpg`), Buffer.from(data, "base64"));
|
||||
send("Page.screencastFrameAck", { sessionId });
|
||||
} else if (message.method === "Page.javascriptDialogOpening") {
|
||||
// A confirm (e.g. "Disqualify ...?") would block headless Chrome: answer yes, as the clip shows.
|
||||
send("Page.handleJavaScriptDialog", { accept: true });
|
||||
}
|
||||
});
|
||||
function send(method, params = {}) {
|
||||
@@ -286,21 +289,21 @@ const clips = {
|
||||
await scrollTo(".manage-tabs");
|
||||
},
|
||||
steps: [
|
||||
{ text: "Opening Manage on a race event splits the page into four tabs: Setup, Format, Live, and Schedule." },
|
||||
{ text: "Opening Manage on a race event splits the page into four tabs: Participants and teams, Format, Live and results, and Schedule and print." },
|
||||
{
|
||||
text: "Format is where you configure practice, qualifying, and finals, and generate the session plan.",
|
||||
async action({ click, scrollTo }) { await click('[data-manage-tab="format"]'); await scrollTo('[data-manage-panel="format"]'); },
|
||||
},
|
||||
{
|
||||
text: "Live shows the grid editor and every standings table while the race is running.",
|
||||
text: "Live and results shows the grid editor and every standings table while the race is running.",
|
||||
async action({ click, scrollTo }) { await click('[data-manage-tab="live"]'); await scrollTo('[data-manage-panel="live"]'); },
|
||||
},
|
||||
{
|
||||
text: "Schedule lets you set a start time and see the whole day's running order.",
|
||||
text: "Schedule and print lets you set a start time, see the whole day's running order and print start lists.",
|
||||
async action({ click, scrollTo }) { await click('[data-manage-tab="schedule"]'); await scrollTo('[data-manage-panel="schedule"]'); },
|
||||
},
|
||||
{
|
||||
text: "And Setup, where we started, is for managing participants and teams.",
|
||||
text: "And Participants and teams, where we started, is for choosing who races.",
|
||||
async action({ click, scrollTo }) { await click('[data-manage-tab="setup"]'); await scrollTo('[data-manage-panel="setup"]'); },
|
||||
},
|
||||
{
|
||||
@@ -552,6 +555,273 @@ const clips = {
|
||||
},
|
||||
],
|
||||
},
|
||||
"sponsor-event": {
|
||||
seedState(state) {
|
||||
state.cars.push(
|
||||
{ id: "vid_sp_car1", name: "Rental 1", transponder: "7960001" },
|
||||
{ id: "vid_sp_car2", name: "Rental 2", transponder: "7960002" },
|
||||
);
|
||||
state.events.push({ id: "vid_sp_event", name: "Company Day", date: "2026-09-19", mode: "track", sponsor: {}, raceConfig: {} });
|
||||
},
|
||||
async setup({ navigate, click, evaluate, scrollTo }) {
|
||||
await navigate("events", "eventForm");
|
||||
await click("#event-manage-vid_sp_event");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("sponsorSetupForm")`)), "sponsor setup");
|
||||
await scrollTo("#sponsorSetupForm", "center");
|
||||
},
|
||||
steps: [
|
||||
{ text: "A sponsor event is set up in three steps, at the top of Manage: guests, cars and format." },
|
||||
{
|
||||
text: "Paste the guests' names, one per line. They are not added to the club's driver list.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`(() => { const area = document.querySelector("#sponsorSetupForm textarea[name=guests]"); area.value = "Anna\\nBosse\\nCissi\\nDavid\\nEmma\\nFilip"; area.dispatchEvent(new Event("input", { bubbles: true })); })()`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Tick the rental cars, or add a new one with its transponder.",
|
||||
async action({ evaluate, fill, click }) {
|
||||
await evaluate(`document.querySelectorAll("#sponsorSetupForm input[name=car]").forEach((box) => { if (!box.checked) box.click(); })`);
|
||||
await fill("sponsorSetupForm", { newCarName: "Rental 3", newCarTp: "7960003" });
|
||||
await click("#sponsorAddCar");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Create the heats: practice and qualifying in groups, and the drivers swap cars between rounds.",
|
||||
async action({ evaluate, scrollTo, pause: pauseFn }) {
|
||||
await waitFor(async () => (await evaluate(`document.querySelectorAll("#sponsorSetupForm input[name=car]:checked").length`)) === 3, "three cars ticked");
|
||||
await evaluate(`(() => { const area = document.querySelector("#sponsorSetupForm textarea[name=guests]"); if (!area.value.trim()) area.value = "Anna\\nBosse\\nCissi\\nDavid\\nEmma\\nFilip"; document.getElementById("sponsorSetupForm").requestSubmit(); })()`);
|
||||
await pauseFn(700);
|
||||
await scrollTo("#manage-session-plan");
|
||||
},
|
||||
},
|
||||
{ text: "When qualifying is done, one click creates the finals. Everything is then run from Race Day." },
|
||||
],
|
||||
},
|
||||
|
||||
"team-race": {
|
||||
seedState(state) {
|
||||
const classId = "vid_team_class";
|
||||
state.classes.push({ id: classId, name: "1:10 Touring" });
|
||||
const names = ["Alex Karlsson", "Sam Nilsson", "Jamie Lee", "Robin Berg", "Kim Ek", "Charlie Lund"];
|
||||
names.forEach((name, index) => state.drivers.push({ id: `vid_team_driver_${index}`, name, classId, transponder: `797000${index}` }));
|
||||
["Team car red", "Team car blue", "Team car green"].forEach((name, index) => state.cars.push({ id: `vid_team_car_${index}`, name, transponder: `797100${index}` }));
|
||||
state.events.push({
|
||||
id: "vid_team_event", name: "Endurance Night", classId, mode: "race",
|
||||
raceConfig: { presetId: "endurance", participantsConfigured: true, driverIds: names.map((_, index) => `vid_team_driver_${index}`), teams: [] },
|
||||
});
|
||||
},
|
||||
async setup({ navigate, click, evaluate, scrollTo }) {
|
||||
await navigate("race_setup", "raceWizardStepForm");
|
||||
await click("#event-manage-vid_team_event");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("teamSetupSplit")`)), "team setup");
|
||||
await scrollTo("#manage-setup-teams");
|
||||
},
|
||||
steps: [
|
||||
{ text: "A team race is set up in three steps: teams, cars, and the length of the race." },
|
||||
{
|
||||
text: "Choose how many teams, and split the drivers. Names and drivers can be changed by hand.",
|
||||
async action({ evaluate, click }) {
|
||||
await evaluate(`document.getElementById("teamSetupCount").value = "3"`);
|
||||
await click("#teamSetupSplit");
|
||||
await waitFor(async () => (await evaluate(`document.querySelectorAll(".team-setup-card").length`)) === 3, "three teams");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Give each team its car. The car's transponder counts for every driver on the team.",
|
||||
async action({ evaluate, pause: pauseFn }) {
|
||||
for (let index = 0; index < 3; index += 1) {
|
||||
await evaluate(`(() => { const select = document.querySelectorAll("[data-team-car]")[${index}]; select.value = "vid_team_car_${index}"; select.dispatchEvent(new Event("change")); })()`);
|
||||
await pauseFn(500);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Pick the length, here four hours. The checks below show anything that would stop the start.",
|
||||
async action({ click, scrollTo }) {
|
||||
await click('[data-team-length="240"]');
|
||||
await scrollTo("#teamSetupCreate", "center");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Create the team race. Teams can still be changed while it runs, if a transponder or a car has to be swapped.",
|
||||
async action({ click, scrollTo }) { await click("#teamSetupCreate"); await pause(400); await scrollTo("#teamSetupLength", "center"); },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
"practice-ranking": {
|
||||
seedState(state) {
|
||||
const startedAt = Date.now() - 600000;
|
||||
const event = { id: "vid_rank_event", name: "Thursday Practice", date: new Date().toISOString().slice(0, 10), classId: "", mode: "race", raceConfig: { practiceOnly: true } };
|
||||
const practice = { id: "vid_rank_practice", eventId: event.id, name: "Open Practice", type: "open_practice", durationMin: 600, status: "running", startedAt };
|
||||
const drivers = [["Alex Karlsson", [16900, 24500, 23800, 24100]], ["Sam Nilsson", [17600, 17700, 17650, 17800]], ["Jamie Lee", [18200, 18100, 18300, 18000]], ["Robin Berg", [17300, 21000, 19500, 22000]]];
|
||||
const passings = [];
|
||||
const competitors = {};
|
||||
drivers.forEach(([name, lapTimes], index) => {
|
||||
const id = `vid_rank_driver_${index}`;
|
||||
const tp = `798000${index}`;
|
||||
state.drivers.push({ id, name, classId: "", transponder: tp });
|
||||
let ts = startedAt + 4000 + index * 900;
|
||||
passings.push({ driverId: id, driverName: name, competitorKey: id, transponder: tp, lapMs: 0, timestamp: ts, validLap: true });
|
||||
lapTimes.forEach((lapMs) => { ts += lapMs; passings.push({ driverId: id, driverName: name, competitorKey: id, transponder: tp, lapMs, timestamp: ts, validLap: true }); });
|
||||
competitors[id] = { key: id, driverId: id, driverName: name, transponder: tp, laps: lapTimes.length, bestLapMs: Math.min(...lapTimes), lastLapMs: lapTimes.at(-1), startTimestamp: startedAt };
|
||||
});
|
||||
state.events.push(event);
|
||||
state.sessions.push(practice);
|
||||
state.resultsBySession[practice.id] = { passings: passings.sort((a, b) => a.timestamp - b.timestamp), competitors };
|
||||
state.activeSessionId = practice.id;
|
||||
},
|
||||
async setup({ navigate }) {
|
||||
await navigate("overlay", "overlayFullscreen");
|
||||
},
|
||||
steps: [
|
||||
{ text: "Open practice ranks drivers by their single best lap. One lucky lap puts you on top." },
|
||||
{
|
||||
text: "In Race Setup, the practice's Settings button lets you change that.",
|
||||
async action({ navigate, evaluate, scrollTo }) {
|
||||
await navigate("race_setup", "raceWizardStepForm");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("event-edit-vid_rank_event")`)), "practice in the list");
|
||||
await scrollTo("#event-edit-vid_rank_event", "center");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Rank by the best three laps in a row, or the most laps in a set number of minutes. The lap time window is here too.",
|
||||
async action({ click, evaluate }) {
|
||||
await click("#event-edit-vid_rank_event");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector('#eventEditForm [name="practiceRanking"]')`)), "settings window");
|
||||
await evaluate(`(() => { const form = document.getElementById("eventEditForm"); form.elements.practiceRanking.value = "consecutive"; form.elements.practiceRanking.dispatchEvent(new Event("change", { bubbles: true })); form.elements.practiceRankLaps.value = "3"; })()`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Save, and the results and the overlay follow at once. Now the steadiest driver leads.",
|
||||
async action({ evaluate, clickNav }) {
|
||||
await evaluate(`(() => { const form = document.getElementById("eventEditForm"); if (!form.elements.date.value) form.elements.date.value = "2026-09-17"; form.requestSubmit(); })()`);
|
||||
await pause(600);
|
||||
await clickNav("Overlay");
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
"race-overview": {
|
||||
seedState(state) {
|
||||
const classId = "vid_ov_class";
|
||||
state.classes.push({ id: classId, name: "2WD Buggy" });
|
||||
const names = ["Alex Karlsson", "Sam Nilsson", "Jamie Lee", "Robin Berg"];
|
||||
const ids = names.map((name, index) => { const id = `vid_ov_driver_${index}`; state.drivers.push({ id, name, classId, transponder: `799000${index}` }); return id; });
|
||||
const event = { id: "vid_ov_event", name: "Club Race Night", date: "2026-09-18", classId, mode: "race", raceConfig: { participantsConfigured: true, driverIds: ids } };
|
||||
state.events.push(event);
|
||||
// Each heat: who finished where (laps, best lap) - ends a few minutes apart.
|
||||
const heats = [
|
||||
["vid_ov_p1", "Practice 1", "practice", [2, 0, 1, 3]],
|
||||
["vid_ov_q1", "Q1 H1", "qualification", [0, 2, 1, 3]],
|
||||
["vid_ov_q2", "Q2 H1", "qualification", [0, 1, 2, 3]],
|
||||
["vid_ov_a", "A Final", "final", [1, 0, 2, 3]],
|
||||
];
|
||||
const dayStart = Date.now() - 4 * 3600000;
|
||||
heats.forEach(([id, name, type, order], heatIndex) => {
|
||||
const startedAt = dayStart + heatIndex * 1800000;
|
||||
state.sessions.push({ id, eventId: event.id, name, type, durationMin: 5, status: "finished", startedAt, endedAt: startedAt + 310000, driverIds: ids });
|
||||
const competitors = {};
|
||||
order.forEach((driverIndex, place) => {
|
||||
const key = ids[driverIndex];
|
||||
competitors[key] = { key, driverId: key, driverName: names[driverIndex], displayName: names[driverIndex], transponder: `799000${driverIndex}`, laps: 17 - place, bestLapMs: 17100 + place * 230 + heatIndex * 40, lastLapMs: 18000, startTimestamp: startedAt, lastTimestamp: startedAt + 300000 + place * 1200 };
|
||||
});
|
||||
state.resultsBySession[id] = { passings: [], adjustments: [], competitors };
|
||||
});
|
||||
state.activeSessionId = "vid_ov_a";
|
||||
},
|
||||
async setup({ navigate, evaluate, scrollTo }) {
|
||||
await navigate("race_day", "raceDayOverview");
|
||||
await scrollTo("#raceDayOverview");
|
||||
},
|
||||
steps: [
|
||||
{ text: "When a race is run, Race Day shows the whole race in one place: the podium, then practice, qualifying and finals." },
|
||||
{
|
||||
text: "Open a part to see its standings, and every heat with laps, result and best lap.",
|
||||
async action({ evaluate }) { await evaluate(`document.querySelector('.race-overview-phase[data-phase="qualification"]')?.setAttribute("open", "")`); },
|
||||
},
|
||||
{
|
||||
text: "Print it, or export the whole race as PDF or CSV.",
|
||||
async action({ evaluate, scrollTo }) {
|
||||
await evaluate(`document.querySelector('.race-overview-phase[data-phase="qualification"]')?.removeAttribute("open"); document.querySelector('.race-overview-phase[data-phase="final"]')?.setAttribute("open", "")`);
|
||||
await scrollTo("#raceDayOverview");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "The results archive is sorted by race. Pick one, and the same overview and export are there.",
|
||||
async action({ clickNav, evaluate, click, scrollTo }) {
|
||||
await clickNav("Results archive");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector('[data-archive-event="vid_ov_event"]')`)), "race in the archive");
|
||||
await click('[data-archive-event="vid_ov_event"]');
|
||||
await pause(500);
|
||||
await scrollTo("#archiveEventClose", "center");
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
judging: {
|
||||
seedState(state) {
|
||||
const classId = "vid_judge_class";
|
||||
state.classes.push({ id: classId, name: "2WD Buggy" });
|
||||
const names = ["Alex Karlsson", "Sam Nilsson", "Jamie Lee"];
|
||||
const ids = names.map((name, index) => { const id = `vid_judge_driver_${index}`; state.drivers.push({ id, name, classId, transponder: `796100${index}` }); return id; });
|
||||
const event = { id: "vid_judge_event", name: "Club Race Night", classId, mode: "race", raceConfig: { participantsConfigured: true, driverIds: ids } };
|
||||
state.events.push(event);
|
||||
const now = Date.now();
|
||||
const qualiStart = now - 1800000;
|
||||
const heatStart = now - 90000;
|
||||
state.sessions.push(
|
||||
{ id: "vid_judge_q1", eventId: event.id, name: "Q1 H1", type: "qualification", durationMin: 5, status: "finished", startedAt: qualiStart, endedAt: qualiStart + 305000, driverIds: ids },
|
||||
{ id: "vid_judge_q2", eventId: event.id, name: "Q2 H1", type: "qualification", durationMin: 5, status: "running", startedAt: heatStart, driverIds: ids },
|
||||
);
|
||||
const competitors = (startedAt, laps) => Object.fromEntries(ids.map((key, index) => [key, { key, driverId: key, driverName: names[index], displayName: names[index], transponder: `796100${index}`, laps: laps - index, bestLapMs: 17200 + index * 300, lastLapMs: 18000, startTimestamp: startedAt, lastTimestamp: startedAt + laps * 17800 + index * 900 }]));
|
||||
state.resultsBySession.vid_judge_q1 = { passings: [], adjustments: [], competitors: competitors(qualiStart, 17) };
|
||||
state.resultsBySession.vid_judge_q2 = { passings: [], adjustments: [], competitors: competitors(heatStart, 5) };
|
||||
state.activeSessionId = "vid_judge_q2";
|
||||
state.settings.raceAudio = { ...state.settings.raceAudio, events: SILENCED_EVENTS };
|
||||
},
|
||||
async setup({ navigate }) {
|
||||
await navigate("judging", "speakerPanel");
|
||||
},
|
||||
steps: [
|
||||
{ text: "Judging is the race controller's page. The speaker panel has the track calls, marshal warning and quick sound switches." },
|
||||
{
|
||||
text: "Pick a driver to see the penalties, and write the reason. It is saved in the judging log.",
|
||||
async action({ click, evaluate, scrollTo }) {
|
||||
await click("#judge-select-vid_judge_driver_1");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("judgeReason")`)), "driver selected");
|
||||
await evaluate(`document.getElementById("judgeReason").value = "Pushed another car off"`);
|
||||
await scrollTo("#judgeReason", "center");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "During the heat, call the driver: attention, an official warning, a stop and go, or a drive through. The speaker reads out the driver's name.",
|
||||
async action({ click, scrollTo }) { await scrollTo('[data-judge-call="stop_and_go"]', "center"); await click('[data-judge-call="stop_and_go"]'); },
|
||||
},
|
||||
{
|
||||
text: "Finished heats can be judged afterwards too, after a protest or a car check. Pick the heat here.",
|
||||
async action({ evaluate, scrollTo }) {
|
||||
await evaluate(`(() => { const select = document.getElementById("judgingSessionSelect"); select.value = "vid_judge_q1"; select.dispatchEvent(new Event("change")); })()`);
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("judge-select-vid_judge_driver_0")`)), "finished heat");
|
||||
await scrollTo("#judgingSessionSelect", "center");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Give a time penalty with a reason, or disqualify. Following the EFRA rules, a disqualified driver goes last.",
|
||||
async action({ click, evaluate, scrollTo }) {
|
||||
await click("#judge-select-vid_judge_driver_0");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("judgeDsq")`)), "penalty buttons");
|
||||
await evaluate(`document.getElementById("judgeReason").value = "Car under weight"`);
|
||||
await click("#judgeDsq");
|
||||
await pause(600);
|
||||
await scrollTo("#judgingCompetitorFilter", "center");
|
||||
},
|
||||
},
|
||||
{ text: "Everything follows straight away: results, standings, the race overview and the archive. And every change can be undone from the log." },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const requested = process.argv.slice(2);
|
||||
|
||||
Reference in new issue
Block a user