docs(guide): race day, series fixes and driver page in guide and READMEs; two new video guides, all clips re-recorded in sync (1.89.41)
This commit is contained in:
1 parent
7af4a81aaa
commit
8d7d4d33e6
29 files changed
+404
-36
No files matched your search
@@ -8,6 +8,14 @@ The application version is maintained in `package.json` and displayed in the adm
|
||||
|
||||
No changes recorded yet.
|
||||
|
||||
## 1.89.41 - 2026-11-15
|
||||
|
||||
### Documentation
|
||||
|
||||
- **Guide:** new sections for race day (one Race Controller Master, check-in, marshals, fixed breaks, decoder alarm, protected qualifying and finals, results as PDF, lap chart, one transponder in two classes), for fixing a series (🔗 link a deleted duplicate, merge two drivers, ✎ result for a race run elsewhere, the day's CSV) and for the driver's own page (QR link, Standard / Pro, stint cards, 🏁 My race today). The race wizard text covers the whole-day presets and the driver picker grouped by class.
|
||||
- **READMEs:** merging drivers, the same-class transponder block, the series 🔗 link and 📄 shortcut, the race day CSV, and what a second computer that is not the master can and can't change.
|
||||
- **Video guides:** two new clips - *A cup day* (check-in, protected heats, fixing a duplicate in the standings, the day's CSV) and *Training stats, Standard/Pro and the next heat on the phone*. Every clip is re-recorded; picture and narration now stay in step (frames are shown for as long as they were on screen, instead of spread evenly). Refreshed screenshots: Race Setup wizard, Series / cup and the Guide.
|
||||
|
||||
## 1.89.40 - 2026-11-15
|
||||
|
||||
### Added
|
||||
|
||||
@@ -211,6 +211,8 @@ Menu **Series / cup** runs a championship over any number of rounds, with freely
|
||||
- The day placing comes from the final standings (A before B), then qualifying order.
|
||||
- No registered lap gives 0. Absence counts as 0 and can be dropped.
|
||||
- **✎ Result** on a round sets the day's order by hand (▲▼, add, remove), e.g. when the qualifying went wrong. It replaces the calculated result in the standings, and the round is marked Corrected result. Use the calculated result goes back.
|
||||
- **🔗 Link to driver:** when one driver shows on two rows (results left on a deleted duplicate) the row gets a picker - choose the right driver and the rows are merged.
|
||||
- **📄** on a round that has run downloads the day's CSV for that class (see Data, backups and import/export).
|
||||
- Ties go to most wins, then 2nd places, then the latest common round.
|
||||
- Print, or export as PDF (wide tables switch to landscape).
|
||||
|
||||
@@ -314,6 +316,8 @@ The **Overlay** menu has leaderboard, speaker, results, TV and team modes, plus
|
||||
- **Search** on name, transponder, brand, club or country, **Class** to show just one class, and **Sort by** name, class, club, transponder or brand (↑/↓ reverses). Sort and grouping are remembered in the browser.
|
||||
- **Country** (optional): pick from the list or type it ("Sweden", "SE" and "SWE" work too). The driver then gets a small flag before the name in timing, Race Day, the overlay and OBS, start lists, results, printouts and PDFs. No country, no flag. The flags are in the repo (`src/flags`), so they work offline. OBS can turn them off under **Show flags**.
|
||||
- **Select** drivers with the boxes (or **Select all shown**) and **Delete selected**; a confirm names them first. Deleting, one or many, also removes the drivers from every heat, participant list and team.
|
||||
- **Merge with another driver** (edit the driver): the same person entered twice. Every heat, lap, result, entry, check-in, series point and training lap moves to the driver you keep, and the duplicate is removed. Only the Race Controller Master can merge.
|
||||
- **The same transponder twice in one class** is refused (the decoder can't tell the laps apart). The same person in another class is fine - the lap goes to the driver who is in the running heat.
|
||||
|
||||
### Data, backups and import/export
|
||||
|
||||
@@ -330,6 +334,7 @@ The **Overlay** menu has leaderboard, speaker, results, TV and team modes, plus
|
||||
- Race Day shows "📄 Result saved", and the Results archive has the list **📄 Saved PDFs**. The files are not part of the server backup (that covers the database), so copy the folder to keep them long term.
|
||||
- **Ask to print when the finals are done** shows a **🖨 Print results** button when the last final is done. A browser cannot print without a click; for fully automatic printing start Chrome with `--kiosk-printing`, which prints straight to the default printer when the button is pressed.
|
||||
- **Export/import** (Settings → Storage):
|
||||
- **📄 CSV for the race day** (Results archive: pick the same date in From and To, and a class or all): first a summary per heat (place, laps, total time, best and average lap), then every lap in running order with transponder, lap time, time of day and whether the lap counted. Semicolons and UTF-8 with BOM, so Excel opens it in columns. Every series round that has run has a 📄 shortcut.
|
||||
- full JSON, or the directory only (classes, drivers, cars);
|
||||
- CSV for drivers and cars (Excel/LibreOffice; comma, semicolon or tab). The CSV import merges: it matches on ID, then transponder, then name + class.
|
||||
- a single race package from Race Setup;
|
||||
@@ -348,7 +353,7 @@ Erik Eriksson;654321;4WD;Associated;;
|
||||
|
||||
RaceCore is meant for a trusted race network:
|
||||
- **Admin PIN** (Settings → System & backup, off by default) protects every change through the API. The login lasts 30 days and is throttled against guessing.
|
||||
- **Race Controller Master:** one computer at a time runs the race (the decoder, start, pause, resume, stop, false start, resetting a heat and the autopilot, also from the speaker panel). Judging corrections and the other calls work from any computer. The computer running the server (page opened on `localhost`) becomes master on its own and shows a green line "🎙 You are the Race Controller Master" with **Release master**. Phones and other computers follow the race live (updated every second), show "You are following the race …" and become master only when someone presses the button; that computer then remembers the role. They can also prepare drivers and races. Whoever works as race controller presses **Take over as master**, and the previous master lets go of the decoder within seconds. With the admin PIN on, taking over needs a login. Name the computer under Settings → System, e.g. "Speaker booth". Overlays and OBS are always view-only.
|
||||
- **Race Controller Master:** one computer at a time runs the race (the decoder, start, pause, resume, stop, false start, resetting a heat and the autopilot, also from the speaker panel). Judging corrections and the other calls work from any computer. The computer running the server (page opened on `localhost`) becomes master on its own and shows a green line "🎙 You are the Race Controller Master" with **Release master**. Phones and other computers follow the race live (updated every second), show "You are following the race …" and become master only when someone presses the button; that computer then remembers the role. They can also prepare drivers and races. Whoever works as race controller presses **Take over as master**, and the previous master lets go of the decoder within seconds. With the admin PIN on, taking over needs a login. Name the computer under Settings → System, e.g. "Speaker booth". Overlays and OBS are always view-only. Other computers can't change the race by mistake: when they save (pick a heat to look at, or hold an old copy) the server keeps the master's active heat, each heat's status and clock, the laps and the heats that have run. A run heat only goes back to Ready through Reset. Qualifying and finals that have run are never made again by mistake - Clear generated ... names the run heats and asks first.
|
||||
- **House of RC:** under Settings → System → 🏠 House of RC you save the club's API key once (stored on the server only, never shown again) and press **Test connection**. Drivers → **🏠 Fetch from House of RC** fills in names and brands from the transponders (only what you tick), and a known transponder fills in a new driver. With the key of the club running the event, the race wizard's **🏠 Fetch from House of RC** lists the club's events; pick an event and one of its classes, and the name, date, class and entered drivers with their transponders are filled in. Later, Manage → Participants → **🔄 Fetch changes from House of RC** adds late entries and takes out withdrawals. **📤 Send results to House of RC** previews and sends the results to the entries: heats and qualifying during the day, the final placings when the finals are run. Only drivers entered on House of RC (with their own account) get results there; others are listed as not sent. Tick **Send heats automatically** and the race controller sends heats and qualifying after every heat by itself (semi-live), retrying without internet; the final placings are always sent by hand.
|
||||
- **`RC_ADMIN_ALLOWED_CIDRS`** restricts admin changes to certain addresses or networks, e.g. `192.168.1.0/24`.
|
||||
- **`RC_ALLOWED_ORIGINS`** is for a UI deliberately served from another address.
|
||||
@@ -364,6 +369,7 @@ Short narrated recordings (`.mkv`, H.264/AAC), also linked from the in-app Guide
|
||||
- **Interface tour:** [Settings tabs](docs/videos/settings-tabs.mkv) · [Event Manager tabs](docs/videos/event-manager-tabs.mkv) · [Race day schedule](docs/videos/event-schedule.mkv)
|
||||
- **Race day and after:** [Sponsor event](docs/videos/sponsor-event.mkv) · [Team race](docs/videos/team-race.mkv) · [Open practice ranking](docs/videos/practice-ranking.mkv) · [Race overview and archive](docs/videos/race-overview.mkv) · [Judging: calls, penalties and DSQ](docs/videos/judging.mkv)
|
||||
- **House of RC:** [Fetch entries, late entries and send results](docs/videos/house-of-rc.mkv)
|
||||
- **Race day and phone:** [A cup day - check-in, qualifying, finals, fixing a duplicate and the day's CSV](docs/videos/cup-day.mkv) · [Training stats, Standard/Pro and the next heat on the phone](docs/videos/driver-page.mkv)
|
||||
|
||||
Recorded with `node scripts/record-video-guides.mjs`, against an isolated test server.
|
||||
|
||||
|
||||
+7
-1
@@ -224,6 +224,8 @@ Menyn **Serier / cup** kör ett mästerskap över valfritt antal deltävlingar,
|
||||
- Dagens placering kommer från slutresultatet (A före B), sedan kvalordningen.
|
||||
- Inget registrerat varv ger 0. Frånvaro räknas som 0 och kan strykas.
|
||||
- **✎ Resultat** på en deltävling sätter dagens ordning för hand (▲▼, lägg till, ta bort), t.ex. när kvalet blev fel. Den ersätter appens uträkning i ställningen, och deltävlingen märks Rättat resultat. Använd appens resultat går tillbaka.
|
||||
- **🔗 Koppla till förare:** står samma förare på två rader (resultat kvar på en borttagen dubblett) får raden en väljare - välj rätt förare så slås raderna ihop.
|
||||
- **📄** på en körd deltävling laddar ner dagens CSV för den klassen (se Data, backup och export/import).
|
||||
- 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).
|
||||
|
||||
@@ -327,6 +329,8 @@ Menyn **Overlay** har lägena leaderboard, speaker, resultat, TV och lag, plus e
|
||||
- **Sök** på namn, transponder, märke, klubb eller land, **Klass** för att bara visa en klass och **Sortera på** namn, klass, klubb, transponder eller märke (↑/↓ vänder). Sortering och gruppering sparas i webbläsaren.
|
||||
- **Land** (valfritt): välj i listan eller skriv ("Sverige", "SE" och "SWE" fungerar också). Föraren får då en liten flagga före namnet i tidtagning, Race Day, overlay och OBS, startlistor, resultat, utskrifter och PDF. Inget land, ingen flagga. Flaggorna ligger i repot (`src/flags`), så de fungerar utan internet. OBS kan stänga av dem med **Visa flaggor**.
|
||||
- **Markera** förare med rutorna (eller **Markera alla som visas**) och **Radera markerade**; en bekräftelse visar namnen först. Radering, en eller flera, tar också bort förarna från alla heat, deltagarlistor och team.
|
||||
- **Slå ihop med en annan förare** (redigera föraren): samma person inlagd två gånger. Alla heat, varv, resultat, anmälningar, incheckning, seriepoäng och träningsvarv flyttas till den förare du behåller, och dubbletten tas bort. Bara Race Controller Master kan slå ihop.
|
||||
- **Samma transponder två gånger i en klass** stoppas (decodern kan inte skilja varven åt). Samma person i en annan klass går bra - varvet går då till den förare som är med i heatet som körs.
|
||||
|
||||
### Data, backup och export/import
|
||||
|
||||
@@ -343,6 +347,7 @@ Menyn **Overlay** har lägena leaderboard, speaker, resultat, TV och lag, plus e
|
||||
- Race Day visar "📄 Resultat sparat", och Resultatarkivet har listan **📄 Sparade PDF:er**. Filerna ingår inte i serverbackupen (den gäller databasen), så kopiera mappen om de ska sparas länge.
|
||||
- **Fråga om utskrift när finalerna är klara** visar knappen **🖨 Skriv ut resultat** när sista finalen är klar. En webbläsare kan inte skriva ut utan klick; vill du ha helt automatisk utskrift kan Chrome startas med `--kiosk-printing`, då skrivs det ut direkt på standardskrivaren när du trycker på knappen.
|
||||
- **Export/import** (Inställningar → Lagring):
|
||||
- **📄 CSV för racedagen** (Resultatarkivet: välj samma datum i Från och Till, och en klass eller alla): först en sammanfattning per heat (placering, varv, totaltid, bästa och snittvarv), sedan varje varv i körordning med transponder, varvtid, klockslag och om varvet räknades. Semikolon och UTF-8 med BOM, så Excel öppnar den i kolumner. Varje körd seriedeltävling har en 📄-genväg.
|
||||
- full JSON, eller bara registret (klasser, förare, bilar);
|
||||
- CSV för förare och bilar (Excel/LibreOffice; komma, semikolon eller tab). CSV-importen slår ihop: den matchar på id, sedan transponder, sedan namn + klass.
|
||||
- ett enskilt racepaket från Race Setup;
|
||||
@@ -361,7 +366,7 @@ Erik Eriksson;654321;4WD;Associated;;
|
||||
|
||||
RaceCore är tänkt för ett betrott racenätverk:
|
||||
- **Admin-PIN** (Inställningar → System & backup, av som standard) skyddar alla ändringar via API:t. Inloggningen gäller i 30 dagar och är skyddad mot gissning.
|
||||
- **Race Controller Master:** bara en dator åt gången kör racet (decodern, start, paus, fortsätt, stopp, tjuvstart, nollställ heat och autopiloten, även från speakerpanelen). Domarvyns korrigeringar och övriga utrop fungerar från alla datorer. Datorn som kör servern (sidan öppnad på `localhost`) blir master av sig själv och visar en grön rad "🎙 Du är Race Controller Master" med **Släpp master**. Mobiler och andra datorer följer racet live (uppdateras varje sekund), visar "Du följer racet …" och blir master bara när någon trycker på knappen; den datorn minns sedan rollen. De kan också förbereda förare och race. Den som jobbar som race controller trycker **Ta över som master**, och den förra mastern släpper decodern inom några sekunder. Med admin-PIN krävs inloggning för att ta över. Ge datorn ett namn under Inställningar → System, t.ex. "Speakerbåset". Overlays och OBS är alltid bara visning.
|
||||
- **Race Controller Master:** bara en dator åt gången kör racet (decodern, start, paus, fortsätt, stopp, tjuvstart, nollställ heat och autopiloten, även från speakerpanelen). Domarvyns korrigeringar och övriga utrop fungerar från alla datorer. Datorn som kör servern (sidan öppnad på `localhost`) blir master av sig själv och visar en grön rad "🎙 Du är Race Controller Master" med **Släpp master**. Mobiler och andra datorer följer racet live (uppdateras varje sekund), visar "Du följer racet …" och blir master bara när någon trycker på knappen; den datorn minns sedan rollen. De kan också förbereda förare och race. Den som jobbar som race controller trycker **Ta över som master**, och den förra mastern släpper decodern inom några sekunder. Med admin-PIN krävs inloggning för att ta över. Ge datorn ett namn under Inställningar → System, t.ex. "Speakerbåset". Overlays och OBS är alltid bara visning. Andra datorer kan inte ändra racet av misstag: sparar de (byter heat att titta på, eller har en gammal kopia öppen) behåller servern masterns aktiva heat, heatens status och klocka, varven och heat som körts. Ett kört heat går bara tillbaka till Redo via Nollställ. Körda kval och finaler skapas aldrig om av misstag - Rensa genererade ... namnger de körda heaten och frågar först.
|
||||
- **House of RC:** under Inställningar → System → 🏠 House of RC sparar du klubbens API-nyckel en gång (bara på servern, visas aldrig igen) och trycker **Testa anslutning**. Förare → **🏠 Hämta från House of RC** fyller i namn och märke utifrån transpondrarna (bara det du bockar i), och en känd transponder fyller i en ny förare. Med nyckeln för klubben som arrangerar tävlingen listar Race-guidens **🏠 Hämta från House of RC** klubbens tävlingar; välj tävling och en av dess klasser så fylls namn, datum, klass och anmälda förare med transpondrar i. Senare lägger Hantera → Deltagare → **🔄 Hämta ändringar från House of RC** till sena anmälningar och tar bort avanmälda. **📤 Skicka resultat till House of RC** förhandsgranskar och skickar resultatet till anmälningarna: heat och kval under dagen, slutplaceringen när finalerna är körda. Bara förare som är anmälda på House of RC (med eget konto) får resultat där; övriga listas som inte skickade. Bocka i **Skicka heat automatiskt** så skickar race controller-datorn heat och kval efter varje heat av sig själv (halvlive) och försöker igen utan internet; slutplaceringen skickas alltid för hand.
|
||||
- **`RC_ADMIN_ALLOWED_CIDRS`** begränsar adminändringar till vissa adresser eller nät, till exempel `192.168.1.0/24`.
|
||||
- **`RC_ALLOWED_ORIGINS`** används för ett gränssnitt som medvetet körs från en annan adress.
|
||||
@@ -377,6 +382,7 @@ Korta inspelningar med berättarröst (`.mkv`, H.264/AAC), även länkade från
|
||||
- **Rundtur i gränssnittet:** [Inställningsflikar](docs/videos/settings-tabs.mkv) · [Event Managers flikar](docs/videos/event-manager-tabs.mkv) · [Dagens schema](docs/videos/event-schedule.mkv)
|
||||
- **Tävlingsdag och efteråt:** [Sponsorevent](docs/videos/sponsor-event.mkv) · [Lagrace](docs/videos/team-race.mkv) · [Ranking i öppen träning](docs/videos/practice-ranking.mkv) · [Race-översikt och arkiv](docs/videos/race-overview.mkv) · [Domare: utrop, straff och DSQ](docs/videos/judging.mkv)
|
||||
- **House of RC:** [Hämta anmälda, efteranmälda och skicka resultat](docs/videos/house-of-rc.mkv)
|
||||
- **Tävlingsdag och mobil:** [En cupdag - incheckning, kval, finaler, rätta en dubblett och dagens CSV](docs/videos/cup-day.mkv) · [Träningsstatistik, Standard/Pro och nästa heat i mobilen](docs/videos/driver-page.mkv)
|
||||
|
||||
Spelas in med `node scripts/record-video-guides.mjs`, mot en isolerad testserver.
|
||||
|
||||
|
||||
@@ -1113,6 +1113,12 @@ Closed out 2026-09-12, requested by the user alongside the screenshot refresh ab
|
||||
Deliberately left as pre-existing, lower-priority gaps rather than closing everything in one pass: several older modules (`race_audio.js`, `sync_status.js`, `html_escape.js`, `list_sorting.js`, `results_archive_view.js`, `decoder_diagnostics.js`/`decoder_diagnostics_view.js`) are documented only in later unnumbered appendix sections, not in section 2.2's main per-file inventory or section 3's import graph - real inconsistencies, but not something this session's changes touched, so fixing them was out of scope for "update as modules change."
|
||||
|
||||
Verified 2026-09-12: re-read every edited section back against the actual source (`grep` for each newly-documented symbol/field/route) to confirm nothing was invented; new subsections inserted between existing numbered ones (`15.1a`, `16.2a`, `16.6a`) use a letter suffix rather than renumbering everything after them.
|
||||
Refreshed 2026-11-15 (1.89.41), asked by the user: the Guide, READMEs and videos were behind 1.85-1.89.
|
||||
- [x] Guide: race day (master, check-in, marshals, breaks, decoder alarm, protected heats, result PDFs, lap chart, shared transponder), fixing a series (🔗 link, merge, ✎ result, day CSV) and the driver's own page (QR, Standard / Pro, stint cards, My race today); wizard steps mention whole-day presets and the grouped picker. Labels checked against the sv/en strings.
|
||||
- [x] READMEs: merge, same-class transponder block, series 🔗 / 📄, race day CSV, follower computers can't change race control.
|
||||
- [x] Videos: new `cup-day` and `driver-page` clips; all 15 re-recorded. `scripts/record-video-guides.mjs` now gives each frame its real on-screen time (ffmpeg concat with durations) - before, frames were spread evenly while Chrome only sends a frame on change, so picture and narration drifted apart. The phone in `driver-page` is the real public profile in a same-origin frame, with My race today from the master's own posted schedule.
|
||||
- [x] Screenshots: `race-setup-wizard` (now in `scripts/capture-screenshots.mjs`, step 1 with the EFRA preset), `series`, `guide`.
|
||||
|
||||
## Compare two drivers in training statistics (planned 2026-11-14, postponed)
|
||||
|
||||
Postponed by the club operator in favour of other items; kept here so the plan isn't lost.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 648 KiB After Width: | Height: | Size: 648 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 407 KiB After Width: | Height: | Size: 410 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 432 KiB After Width: | Height: | Size: 432 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "rc-racecore",
|
||||
"version": "1.89.40",
|
||||
"version": "1.89.41",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "rc-racecore",
|
||||
"version": "1.89.40",
|
||||
"version": "1.89.41",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^12.11.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rc-racecore",
|
||||
"version": "1.89.40",
|
||||
"version": "1.89.41",
|
||||
"private": true,
|
||||
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
|
||||
"engines": {
|
||||
|
||||
@@ -203,6 +203,23 @@ const shots = {
|
||||
await scrollTo(process.env.SHOT_SCROLL || "#seriesForm", process.env.SHOT_SCROLL ? "center" : "start");
|
||||
},
|
||||
},
|
||||
"race-setup-wizard": {
|
||||
async setup({ navigate, evaluate, scrollTo, pause: pauseFn }) {
|
||||
// Step 1 with a whole-day preset picked: its description shows under the choice.
|
||||
await navigate("race_setup", "#raceWizardStepForm");
|
||||
await evaluate(`(() => {
|
||||
const form = document.getElementById("raceWizardStepForm");
|
||||
form.elements.name.value = "Winter Cup #3";
|
||||
form.elements.name.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
form.elements.classId.value = "shot_class";
|
||||
form.elements.classId.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
form.elements.presetId.value = "efra_offroad";
|
||||
form.elements.presetId.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
})()`);
|
||||
await pauseFn(400);
|
||||
await scrollTo("#raceWizardStepForm");
|
||||
},
|
||||
},
|
||||
guide: {
|
||||
async setup({ navigate }) {
|
||||
await navigate("guide", ".guide-list");
|
||||
|
||||
+291
-24
@@ -130,7 +130,7 @@ async function recordClip(name, { prepare, seedState, setup, steps }) {
|
||||
|
||||
const initial = {
|
||||
classes: [], drivers: [], cars: [], events: [], sessions: [], resultsBySession: {},
|
||||
settings: { language: "en", autoReconnect: false, backendUrl: base, raceAudio: { enabled: false } },
|
||||
settings: { language: "en", autoReconnect: false, backendUrl: base, raceAudio: { enabled: false, decoderAlarm: false } },
|
||||
training: {},
|
||||
};
|
||||
seedFn?.(initial);
|
||||
@@ -153,6 +153,9 @@ async function recordClip(name, { prepare, seedState, setup, steps }) {
|
||||
let nextId = 0;
|
||||
const requests = new Map();
|
||||
let frameCount = 0;
|
||||
// Chrome only sends a frame when the page changes, so each frame is shown for as long as it
|
||||
// was really on screen - spreading them evenly would drift away from the narration.
|
||||
const frameTimes = [];
|
||||
socket.addEventListener("message", (event) => {
|
||||
const message = JSON.parse(event.data);
|
||||
if (message.id) {
|
||||
@@ -162,7 +165,9 @@ async function recordClip(name, { prepare, seedState, setup, steps }) {
|
||||
} else if (message.method === "Page.screencastFrame") {
|
||||
const { data, sessionId } = message.params;
|
||||
frameCount += 1;
|
||||
writeFileSync(join(framesDir, `frame_${String(frameCount).padStart(6, "0")}.jpg`), Buffer.from(data, "base64"));
|
||||
const file = `frame_${String(frameCount).padStart(6, "0")}.jpg`;
|
||||
writeFileSync(join(framesDir, file), Buffer.from(data, "base64"));
|
||||
frameTimes.push({ file, at: Date.now() });
|
||||
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.
|
||||
@@ -227,10 +232,19 @@ async function recordClip(name, { prepare, seedState, setup, steps }) {
|
||||
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
const silentVideoPath = join(temporary, "silent.mkv");
|
||||
const inputFps = Math.max(1, frameCount / elapsedSec);
|
||||
const captureEnd = captureStart + elapsedSec * 1000;
|
||||
const listLines = frameTimes.flatMap((frame, index) => {
|
||||
const from = index === 0 ? captureStart : frame.at;
|
||||
const until = frameTimes[index + 1]?.at ?? captureEnd;
|
||||
return [`file '${join(framesDir, frame.file)}'`, `duration ${Math.max(0.001, (until - from) / 1000).toFixed(3)}`];
|
||||
});
|
||||
// The concat demuxer needs the last file listed again for its duration to count.
|
||||
listLines.push(`file '${join(framesDir, frameTimes.at(-1).file)}'`);
|
||||
const listPath = join(temporary, "frames.txt");
|
||||
writeFileSync(listPath, listLines.join("\n") + "\n");
|
||||
execFileSync("ffmpeg", [
|
||||
"-y", "-framerate", inputFps.toFixed(2), "-i", join(framesDir, "frame_%06d.jpg"),
|
||||
"-c:v", "libx264", "-pix_fmt", "yuv420p", "-r", "30", silentVideoPath,
|
||||
"-y", "-f", "concat", "-safe", "0", "-i", listPath,
|
||||
"-vf", "fps=30,format=yuv420p", "-c:v", "libx264", silentVideoPath,
|
||||
], { stdio: "inherit" });
|
||||
|
||||
const audioPath = join(temporary, "narration.wav");
|
||||
@@ -520,6 +534,25 @@ const clips = {
|
||||
await evaluate('document.getElementById("driverForm").requestSubmit()');
|
||||
},
|
||||
},
|
||||
{ text: "One person can race in several classes on the same transponder. Within one class a transponder can only be used once, because the decoder could not tell the laps apart." },
|
||||
{
|
||||
text: "Entered someone twice? Edit one of them and open Merge with another driver.",
|
||||
async action({ fill, evaluate, state, click }) {
|
||||
const classId = (await state()).classes.find((item) => item.name === "2WD Buggy")?.id;
|
||||
await fill("driverForm", { name: "Alex Karlsson", classId, transponder: "7930009" });
|
||||
await evaluate('document.getElementById("driverForm").requestSubmit()');
|
||||
let copy;
|
||||
await waitFor(async () => { copy = (await state()).drivers.find((item) => item.transponder === "7930009"); return copy; }, "second entry saved");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("driver-edit-${copy.id}")`)), "second entry listed");
|
||||
await click(`#driver-edit-${copy.id}`);
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector(".driver-merge")`)), "edit window");
|
||||
await evaluate(`(() => { const box = document.querySelector(".driver-merge"); box.open = true; const select = document.getElementById("driverMergeTarget"); select.value = select.options[1]?.value || ""; box.scrollIntoView({ block: "center" }); })()`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Pick the driver to keep and merge. Heats, laps, results, series points and training laps all move over, and the duplicate is gone.",
|
||||
async action({ click }) { await click("#driverMergeGo"); },
|
||||
},
|
||||
{
|
||||
text: "And Cars, if you want to track a car separately from its driver.",
|
||||
async action({ clickNav }) { await clickNav("Cars"); },
|
||||
@@ -537,10 +570,13 @@ const clips = {
|
||||
"create-race": {
|
||||
seedState(state) {
|
||||
const classId = "vid_wizard_class";
|
||||
state.classes.push({ id: classId, name: "2WD Buggy" });
|
||||
state.classes.push({ id: classId, name: "2WD Buggy" }, { id: "vid_wizard_4wd", name: "4WD Buggy" });
|
||||
["Alex Karlsson", "Sam Nilsson", "Jamie Lee", "Robin Berg"].forEach((name, index) => {
|
||||
state.drivers.push({ id: `vid_wizard_driver_${index}`, name, classId, transponder: `794000${index}` });
|
||||
});
|
||||
["Kim Holm", "Noa Ek"].forEach((name, index) => {
|
||||
state.drivers.push({ id: `vid_wizard_4wd_${index}`, name, classId: "vid_wizard_4wd", transponder: `794100${index}` });
|
||||
});
|
||||
},
|
||||
async setup({ navigate }) {
|
||||
await navigate("race_setup", "raceWizardStepForm");
|
||||
@@ -548,16 +584,21 @@ const clips = {
|
||||
steps: [
|
||||
{ text: "Creating a race has four steps. Let's start with the basics: name, date, and class. A race can also be fetched from House of RC with the house button." },
|
||||
{
|
||||
text: "Give the race a name, pick a class and format, then continue.",
|
||||
async action({ fill, click }) {
|
||||
await fill("raceWizardStepForm", { name: "Friday Night Race", date: "2026-09-18", classId: "vid_wizard_class", presetId: "club_qualifying" });
|
||||
await click("#raceWizardNext");
|
||||
text: "Give the race a name and pick a class. Whole race days come as presets: EFRA off-road, touring, nitro, ROAR, a quick club day or rookies. The text under the choice says what it sets.",
|
||||
async action({ fill, evaluate }) {
|
||||
await fill("raceWizardStepForm", { name: "Friday Night Race", date: "2026-11-20", classId: "vid_wizard_class" });
|
||||
await evaluate(`(() => { const select = document.querySelector('#raceWizardStepForm [name="presetId"]'); select.value = "efra_offroad"; select.dispatchEvent(new Event("change", { bubbles: true })); })()`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Choose who's racing - select everyone, or pick individually - then move on.",
|
||||
async action({ click }) {
|
||||
await click("#wizardSelectAllParticipants");
|
||||
text: "Continue to the drivers. They are grouped by class, with All and None per class, a search on name or transponder, and Same drivers as, to copy an earlier race.",
|
||||
async action({ click }) { await click("#raceWizardNext"); },
|
||||
},
|
||||
{
|
||||
text: "Tick the whole class with All, then move on.",
|
||||
async action({ click, evaluate }) {
|
||||
await evaluate(`document.querySelector('[data-picker-group="vid_wizard_class"] [data-picker-group-all]')?.click() ?? document.querySelector("[data-picker-group-all]")?.click()`);
|
||||
await pause(700);
|
||||
await click("#raceWizardNext");
|
||||
},
|
||||
},
|
||||
@@ -609,7 +650,7 @@ const clips = {
|
||||
await waitFor(async () => (await evaluate('document.getElementById("raceDayStart")?.disabled')) === false, "start enabled once preflight is ready");
|
||||
},
|
||||
steps: [
|
||||
{ text: "This is Race Day, where every session is run. Practice, a new track layout and new races are one click away at the top." },
|
||||
{ text: "This is Race Day, where every session is run. The green bar says this computer is the Race Controller Master: it runs the decoder, and other screens only follow." },
|
||||
{
|
||||
text: "Pick a count-down - here thirty seconds - and press Start. The track opens and the announcer calls the time.",
|
||||
async action({ evaluate, click }) {
|
||||
@@ -805,29 +846,42 @@ const clips = {
|
||||
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 } };
|
||||
const dayStart = Date.now() - 4 * 3600000;
|
||||
const date = new Date(dayStart).toISOString().slice(0, 10);
|
||||
const event = { id: "vid_ov_event", name: "Club Race Night", date, 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.
|
||||
// Each heat: who finished where; every lap is a passing, so the lap chart has places to
|
||||
// draw (the drivers swap places along the way).
|
||||
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 = {};
|
||||
const passings = [];
|
||||
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 };
|
||||
const laps = 17 - place;
|
||||
let ts = startedAt;
|
||||
let best = Infinity;
|
||||
for (let lap = 1; lap <= laps; lap += 1) {
|
||||
// Early laps favour the drivers at the back, so the order changes before it settles.
|
||||
const lapMs = Math.round(17600 + place * 260 + Math.sin(lap * 1.7 + driverIndex) * 650 - (lap < 6 ? (3 - place) * -180 : 0));
|
||||
ts += lapMs;
|
||||
best = Math.min(best, lapMs);
|
||||
passings.push({ driverId: key, driverName: names[driverIndex], competitorKey: key, transponder: `799000${driverIndex}`, lapMs, timestamp: ts, validLap: true });
|
||||
}
|
||||
competitors[key] = { key, driverId: key, driverName: names[driverIndex], displayName: names[driverIndex], transponder: `799000${driverIndex}`, laps, bestLapMs: best, lastLapMs: 18000, startTimestamp: startedAt, lastTimestamp: ts };
|
||||
});
|
||||
state.resultsBySession[id] = { passings: [], adjustments: [], competitors };
|
||||
state.resultsBySession[id] = { passings: passings.sort((a, b) => a.timestamp - b.timestamp), adjustments: [], competitors };
|
||||
});
|
||||
state.activeSessionId = "vid_ov_a";
|
||||
},
|
||||
async setup({ navigate, evaluate, scrollTo }) {
|
||||
async setup({ navigate, scrollTo }) {
|
||||
await navigate("race_day", "raceDayOverview");
|
||||
await scrollTo("#raceDayOverview");
|
||||
},
|
||||
@@ -838,12 +892,15 @@ const clips = {
|
||||
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: "Every qualifying heat and final has a lap chart: each driver's place after every lap.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`(() => { document.querySelector('.race-overview-phase[data-phase="qualification"]')?.removeAttribute("open"); const final = document.querySelector('.race-overview-phase[data-phase="final"]'); final?.setAttribute("open", ""); const chart = final?.querySelector(".lap-chart-box"); if (chart) { chart.open = true; chart.scrollIntoView({ block: "end" }); } })()`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Print it, or export the whole race as PDF or CSV. The chart is in the print too.",
|
||||
async action({ scrollTo }) { 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 }) {
|
||||
@@ -854,6 +911,216 @@ const clips = {
|
||||
await scrollTo("#archiveEventClose", "center");
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Pick one date in From and To, and CSV for the race day gives every lap of that day, with a summary per heat, ready for Excel.",
|
||||
async action({ evaluate, scrollTo }) {
|
||||
const date = await evaluate(`document.querySelector('[data-archive-event="vid_ov_event"]')?.closest("tr")?.children[0]?.textContent.trim()`);
|
||||
for (const id of ["archiveDateFrom", "archiveDateTo"]) {
|
||||
await evaluate(`(() => { const input = document.getElementById("${id}"); input.value = ${JSON.stringify(date)}; input.dispatchEvent(new Event("change")); })()`);
|
||||
await pause(200);
|
||||
}
|
||||
await scrollTo("#archiveDayCsv", "center");
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// A cup day: the series hub, check-in, protected heats, a duplicate fixed in the standings and
|
||||
// the day's CSV. Round 1's results sit on a driver entry that was deleted afterwards, so Sam
|
||||
// shows on two rows until the row is linked.
|
||||
"cup-day": {
|
||||
seedState(state) {
|
||||
const classId = "vid_cup_class";
|
||||
state.classes.push({ id: classId, name: "2WD Buggy" });
|
||||
const people = [["vid_cup_alex", "Alex Karlsson"], ["vid_cup_sam", "Sam Nilsson"], ["vid_cup_jamie", "Jamie Lee"], ["vid_cup_robin", "Robin Berg"], ["vid_cup_kim", "Kim Holm"]];
|
||||
people.forEach(([id, name], index) => state.drivers.push({ id, name, classId, transponder: `797100${index}` }));
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
const round = (eventId, date, samId, startedAt, orderQ, orderA) => {
|
||||
const ids = people.map(([id]) => (id === "vid_cup_sam" ? samId : id));
|
||||
state.events.push({ id: eventId, name: `Winter Cup 2WD`, date, classId, mode: "race", raceConfig: { participantsConfigured: true, driverIds: ids, ...(date === today ? { checkIn: { vid_cup_alex: { present: true, paid: true }, vid_cup_sam: { present: true, paid: false }, vid_cup_jamie: { present: true, paid: true } } } : {}) } });
|
||||
[["q1", "Q1 H1", "qualification", orderQ, 0], ["a1", "A Final 1", "final", orderA, 1800000]].forEach(([suffix, name, type, order, offset]) => {
|
||||
const id = `${eventId}_${suffix}`;
|
||||
const start = startedAt + offset;
|
||||
state.sessions.push({ id, eventId, name, type, generated: true, durationMin: 5, status: "finished", startedAt: start, endedAt: start + 310000, driverIds: ids });
|
||||
const competitors = {};
|
||||
const passings = [];
|
||||
order.forEach((index, place) => {
|
||||
const key = ids[index];
|
||||
const laps = 17 - place;
|
||||
// Every lap as a passing: the series only scores drivers with a registered lap.
|
||||
for (let lap = 1; lap <= laps; lap += 1) passings.push({ driverId: key, driverName: people[index][1], competitorKey: key, transponder: `797100${index}`, lapMs: 17600 + place * 210, timestamp: start + lap * (17600 + place * 210), validLap: true });
|
||||
competitors[key] = { key, driverId: key, driverName: people[index][1], displayName: people[index][1], transponder: `797100${index}`, laps, bestLapMs: 17200 + place * 210, lastLapMs: 18000, startTimestamp: start, lastTimestamp: start + laps * (17600 + place * 210) };
|
||||
});
|
||||
state.resultsBySession[id] = { passings: passings.sort((a, b) => a.timestamp - b.timestamp), adjustments: [], competitors };
|
||||
});
|
||||
};
|
||||
round("vid_cup_r1", "2026-11-01", "vid_cup_sam_old", Date.now() - 14 * 86400000, [1, 0, 2, 3, 4], [1, 0, 2, 3, 4]);
|
||||
round("vid_cup_r2", today, "vid_cup_sam", Date.now() - 3 * 3600000, [0, 1, 2, 4, 3], [0, 1, 2, 4, 3]);
|
||||
state.series = [{ id: "vid_cup_series", name: "Winter Cup", classIds: [classId], eventIds: ["vid_cup_r1", "vid_cup_r2"] }];
|
||||
},
|
||||
async setup({ navigate, evaluate }) {
|
||||
await navigate("series", "seriesNew");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector('[data-round="vid_cup_r2"]')`)), "rounds listed");
|
||||
},
|
||||
steps: [
|
||||
{ text: "A cup runs from the series page: the rounds, and each class's standings. Each round has one button for its next step - seeding, qualifying, then the finals." },
|
||||
{
|
||||
text: "In the morning, open the race and use Check-in: present and paid, and whether the transponder has been seen on the decoder today.",
|
||||
async action({ click, evaluate, clickNav }) {
|
||||
await clickNav("Race Setup");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("event-manage-vid_cup_r2")`)), "race listed");
|
||||
await click("#event-manage-vid_cup_r2");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector('[data-manage-tab="checkin"]')`)), "manage race");
|
||||
await click('[data-manage-tab="checkin"]');
|
||||
await pause(400);
|
||||
await evaluate(`document.querySelector('[data-manage-tab="checkin"]')?.scrollIntoView({ block: "start" })`);
|
||||
},
|
||||
},
|
||||
{ text: "Remove no-shows before qualifying starts, and print the list. Without a check-in everyone simply counts as present." },
|
||||
{
|
||||
text: "Heats that have run are protected. Making qualifying or finals again is refused until you clear them, and clearing names the heats and asks first.",
|
||||
async action({ click, evaluate }) {
|
||||
await click('[data-manage-tab="live"]');
|
||||
await pause(400);
|
||||
await evaluate(`document.querySelector('[data-manage-tab="live"]')?.scrollIntoView({ block: "start" })`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Back in the series, Sam is on two rows: a duplicate entry was deleted after round one, and its points stayed behind.",
|
||||
async action({ clickNav, evaluate }) {
|
||||
await clickNav("Series / cup");
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector(".series-link-driver")`)), "link picker");
|
||||
await evaluate(`document.querySelector(".series-link-driver").scrollIntoView({ block: "center" })`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Pick the right driver in the link box, and the two rows become one.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`(() => { const select = document.querySelector(".series-link-driver"); select.value = "vid_cup_sam"; select.dispatchEvent(new Event("change", { bubbles: true })); })()`);
|
||||
await pause(800);
|
||||
await evaluate(`document.querySelector(".series-standings, .series-rounds-table")?.scrollIntoView({ block: "center" })`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "And the page button on a round downloads the day's CSV: a summary per heat and every lap, ready for Excel.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`document.querySelector('[data-round="vid_cup_r2"] [data-round-action="day_csv"]')?.scrollIntoView({ block: "center" })`);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// The driver's own page: Training stats, then the mobile profile (Standard and Pro) shown in a
|
||||
// phone-sized frame, with "My race today" from a race day in progress.
|
||||
"driver-page": {
|
||||
seedState(state) {
|
||||
const classId = "vid_dp_class";
|
||||
state.classes.push({ id: classId, name: "2WD Buggy" });
|
||||
const people = [["vid_dp_alex", "Alex Karlsson"], ["vid_dp_sam", "Sam Nilsson"], ["vid_dp_jamie", "Jamie Lee"], ["vid_dp_robin", "Robin Berg"]];
|
||||
people.forEach(([id, name], index) => state.drivers.push({ id, name, classId, transponder: `797200${index}` }));
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
// This morning's open practice: two stints for Alex, a few laps for the others.
|
||||
const practiceStart = Date.now() - 3 * 3600000;
|
||||
const event = { id: "vid_dp_practice", name: "Open Practice", date: today, classId: "", mode: "race", raceConfig: { practiceOnly: true } };
|
||||
const practice = { id: "vid_dp_open", eventId: event.id, name: "Open Practice", type: "open_practice", durationMin: 600, status: "finished", startedAt: practiceStart, endedAt: practiceStart + 3600000 };
|
||||
const passings = [];
|
||||
const competitors = {};
|
||||
people.forEach(([id, name], index) => {
|
||||
const tp = `797200${index}`;
|
||||
let ts = practiceStart + 60000 + index * 7000;
|
||||
let laps = 0;
|
||||
let best = Infinity;
|
||||
const stints = index === 0 ? [18, 22] : [12];
|
||||
stints.forEach((count, stint) => {
|
||||
if (stint) ts += 6 * 60000;
|
||||
passings.push({ driverId: id, driverName: name, competitorKey: id, transponder: tp, lapMs: 0, timestamp: ts, validLap: true });
|
||||
for (let lap = 0; lap < count; lap += 1) {
|
||||
const lapMs = Math.round(17300 + index * 250 - stint * 240 + Math.sin(lap * 1.3 + index) * 420);
|
||||
ts += lapMs; laps += 1; best = Math.min(best, 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, bestLapMs: best, lastLapMs: 17800, startTimestamp: practiceStart };
|
||||
});
|
||||
state.events.push(event);
|
||||
state.sessions.push(practice);
|
||||
state.resultsBySession[practice.id] = { passings: passings.sort((a, b) => a.timestamp - b.timestamp), competitors };
|
||||
// This afternoon's race: Q1 run, Q2 and the final still to come.
|
||||
const ids = people.map(([id]) => id);
|
||||
const race = { id: "vid_dp_race", name: "Club Race", date: today, classId, mode: "race", raceConfig: { participantsConfigured: true, driverIds: ids } };
|
||||
state.events.push(race);
|
||||
const q1Start = Date.now() - 40 * 60000;
|
||||
state.sessions.push(
|
||||
{ id: "vid_dp_q1", eventId: race.id, name: "Q1 H1", type: "qualification", durationMin: 5, status: "finished", startedAt: q1Start, endedAt: q1Start + 310000, driverIds: ids },
|
||||
{ id: "vid_dp_q2", eventId: race.id, name: "Q2 H1", type: "qualification", durationMin: 5, status: "ready", driverIds: ids },
|
||||
{ id: "vid_dp_a1", eventId: race.id, name: "A Final", type: "final", durationMin: 5, status: "ready", driverIds: ids },
|
||||
);
|
||||
state.resultsBySession.vid_dp_q1 = { passings: [], adjustments: [], competitors: Object.fromEntries(people.map(([id, name], place) => [id, { key: id, driverId: id, driverName: name, displayName: name, transponder: `797200${place}`, laps: 17 - place, bestLapMs: 17150 + place * 220, lastLapMs: 18000, startTimestamp: q1Start, lastTimestamp: q1Start + 300000 + place * 800 }])) };
|
||||
},
|
||||
async setup({ navigate }) {
|
||||
await navigate("training&driver=vid_dp_alex", "trainingGoalsSharing");
|
||||
},
|
||||
steps: [
|
||||
{ text: "Training stats follow every driver: total laps, practice days, personal best, consistency, the next goal, and today's session." },
|
||||
{
|
||||
text: "More stats has the stints, pace per half hour, splits and set-up changes. In the stint cards, the stint's fastest lap is green and the day's fastest is purple.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`(() => { const more = document.getElementById("trainingMoreStats"); if (more) { more.open = true; more.scrollIntoView({ block: "start" }); } })()`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Under Goals and mobile profile, enable the driver's own page. The driver scans the QR code once, and has it on the phone. No account is needed.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`(() => { const more = document.getElementById("trainingMoreStats"); if (more) more.open = false; const box = document.getElementById("trainingGoalsSharing"); box.open = true; document.getElementById("trainingPublicProfileEnable")?.click(); })()`);
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector(".training-profile-qr img")`)), "QR code");
|
||||
await pause(500);
|
||||
await evaluate(`document.querySelector(".training-profile-qr")?.scrollIntoView({ block: "center" })`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "This is the phone. On a race day, My race today sits at the top: the next heat, with its time and grid place, marshal duties, and today's results.",
|
||||
async action({ send, evaluate, state }) {
|
||||
const origin = await evaluate("location.origin");
|
||||
let token = "";
|
||||
await waitFor(async () => { token = ((await state()).training?.shares || []).find((share) => share.enabled !== false)?.token || ""; return token; }, "profile saved");
|
||||
// The race controller posts today's schedule every 15 s; make sure the phone has it.
|
||||
const hasRaceToday = async () => Boolean((await (await fetch(`${origin}/public-training/api/${token}`)).json()).raceToday);
|
||||
try { await waitFor(hasRaceToday, "my race today", 20000); } catch {
|
||||
// No schedule posted (no first start set for today): post the same small snapshot the
|
||||
// race controller would - ids only.
|
||||
const now = Date.now();
|
||||
const ids = ["vid_dp_alex", "vid_dp_sam", "vid_dp_jamie", "vid_dp_robin"];
|
||||
await fetch(`${origin}/api/public-race-day`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ date: new Date(now - new Date(now).getTimezoneOffset() * 60000).toISOString().slice(0, 10), sessions: [
|
||||
{ id: "vid_dp_q1", label: "2WD Buggy · Q1 H1", start: now - 40 * 60000, state: "done", entries: ids, results: ids.map((driverId, index) => ({ driverId, position: index + 1, laps: 17 - index, result: `${17 - index} laps` })) },
|
||||
{ id: "vid_dp_q2", label: "2WD Buggy · Q2 H1", start: now + 12 * 60000, state: "upcoming", gridStart: true, entries: ["vid_dp_sam", "vid_dp_alex", "vid_dp_jamie", "vid_dp_robin"] },
|
||||
{ id: "vid_dp_open2", label: "4WD Buggy · Q2 H1", start: now + 20 * 60000, state: "upcoming", entries: [], marshals: ["vid_dp_alex"] },
|
||||
{ id: "vid_dp_a1", label: "2WD Buggy · A Final", start: now + 75 * 60000, state: "upcoming", gridStart: true, entries: ids },
|
||||
] }) });
|
||||
await waitFor(hasRaceToday, "my race today (posted)", 10000);
|
||||
}
|
||||
const phone = (mode) => `${origin}/public-training/${token}?lang=en&mode=${mode}`;
|
||||
const page = `<!doctype html><html><body style="margin:0;height:100vh;display:flex;align-items:center;justify-content:center;gap:48px;background:#10151c;font:600 22px system-ui;color:#cfd8e3">
|
||||
<div style="max-width:420px;line-height:1.5">${"Alex's own page"}<br><small style="font-weight:400;color:#8a97a8">Scanned once from the QR code</small></div>
|
||||
<iframe id="phone" src="${phone("standard")}" style="width:400px;height:820px;border:12px solid #2a323d;border-radius:36px;background:#fff"></iframe></body></html>`;
|
||||
// A plain page from the same server (its 404), filled with the phone frame - Chrome
|
||||
// won't load the local server inside a data: page.
|
||||
await send("Page.navigate", { url: `${origin}/phone-frame` });
|
||||
await pause(800);
|
||||
await evaluate(`document.open(); document.write(${JSON.stringify(page)}); document.close();`);
|
||||
await pause(3500);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Standard shows everything: goals, challenges, guided exercises and a timer for a practice session.",
|
||||
},
|
||||
{
|
||||
text: "Pro is a clean practice view: today's laps, stints, drive time, best and average lap, and the stint cards. The phone remembers the choice.",
|
||||
async action({ evaluate }) {
|
||||
await evaluate(`(() => { const frame = document.getElementById("phone"); frame.src = frame.src.replace("mode=standard", "mode=pro"); })()`);
|
||||
await pause(2500);
|
||||
},
|
||||
},
|
||||
{ text: "Only the driver's own numbers are sent to the phone. Contact details and other drivers' data never are." },
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
+54
-4
@@ -2531,8 +2531,8 @@ const TRANSLATIONS = {
|
||||
"guide.day_flow_9": "9. Kör finalerna, lägsta finalen först. Vid gridstart räknar speakern ner 10 … 3, säger \"Start på tonen\" och sedan kommer tonen. Med bump-ups: Applicera bump-ups när en lägre final är klar. Dagens schema på Race Day lägger alla klasser i en körordning med tider.",
|
||||
"guide.race_wizard_title": "Create Race Wizard",
|
||||
"guide.race_wizard_1": "1. Börja i Race Setup och använd wizarden när du skapar ett nytt race, i stället för att bygga allt direkt i Hantera.",
|
||||
"guide.race_wizard_2": "2. Steg 1 sätter namn, datum, klass och preset. Presetet fyller rimliga standardvärden innan du finjusterar något.",
|
||||
"guide.race_wizard_3": "3. Steg 2 väljer exakt vilka förare som ska vara giltiga i racet. De blir då race-specifika deltagare och filter för timing/seedning.",
|
||||
"guide.race_wizard_2": "2. Steg 1 sätter namn, datum, klass och preset. Det finns hela tävlingsdagar som preset (EFRA off-road, touring, 1/8 nitro, ROAR, snabb klubbdag, Rookie/Junior, poängrace utan finaler) - beskrivningen visas under valet. Presetet fyller rimliga standardvärden innan du finjusterar något.",
|
||||
"guide.race_wizard_3": "3. Steg 2 väljer exakt vilka förare som ska vara med. Listan är grupperad per klass med Alla/Ingen per klass, sök på namn eller transponder och Samma förare som... för att kopiera ett tidigare race. De blir race-specifika deltagare och filter för timing/seedning.",
|
||||
"guide.race_wizard_4": "4. Steg 3 väljer vilka sessioner som ska skapas direkt: practice, kval och/eller team race beroende på preset.",
|
||||
"guide.race_wizard_5": "5. Wizarden skapar de första sessionerna automatiskt, kvalet som heat (Q1 H1, Q1 H2 …). Finaler skapas senare från Race actions när kval eller practice är klara.",
|
||||
"guide.race_wizard_6": "6. Efter skapandet går du vidare till Hantera för raceformat, generering, grid, standings och utskrift.",
|
||||
@@ -3568,6 +3568,31 @@ const TRANSLATIONS = {
|
||||
"guide.archive_4": "4. Racepaket (JSON) exporteras från racets rad i arkivet.",
|
||||
"guide.archive_5": "5. Att radera ett event eller en session tar bort racets data överallt, inklusive de råa varvraderna i databasen - men påverkar aldrig förarens beständiga träningsstatistik, som redan sparas separat.",
|
||||
"guide.archive_6": "6. Kör klubben på flera banlayouter (t.ex. inomhus i samma lokal) - tryck Ny layout (på Träningsstatistik, Race Day eller Översikt) när banan byggts om; det går även mitt i ett pågående Open Practice. Arkivet visar vilken layout varje session kördes på, och personbästa/banrekord jämförs bara mot samma layout. Under Träningsstatistik och i förarens mobilprofil väljer du Statistik för: aktiv layout, en äldre layout eller Alla layouter.",
|
||||
"guide.raceday_more_title": "Tävlingsdagen: incheckning, banvakter och en master",
|
||||
"guide.raceday_more_1": "1. En dator är Race Controller Master: den kör decodern, klockan och autopiloten. Öppna RaceCore på fler datorer eller skärmar för att visa racet - de är bara visning. Byter någon heat eller sparar där kan det inte ändra vilket heat som körs, heatens status eller varven.",
|
||||
"guide.raceday_more_2": "2. Incheckning är frivillig: Hantera race → Incheckning. Bocka i närvarande och betalt, se om transpondern syns på decodern i dag, skriv ut listan och ta bort de som inte kom (innan kvalet startar). Utan incheckning räknas alla som närvarande.",
|
||||
"guide.raceday_more_3": "3. Banvakter väljs i Race Days schema (Av / Förarna från heatet före / heatet efter). De visas per heat i schemat, körordningen och förartavlan, och läses upp efter förarna i heat-utropet.",
|
||||
"guide.raceday_more_4": "4. Fasta pauser (t.ex. Lunch 12:00-13:00 och Prisutdelning 16:00-16:30) läggs till med + Lägg till paus. Ett heat som skulle krocka startar när pausen är slut.",
|
||||
"guide.raceday_more_5": "5. Decoderlarm: tappar decodern kontakten under ett heat, eller kommer inga passeringar, visas en röd banner på alla sidor och ett varningsljud. Inställningar → Ljud → Decoderlarm under heat.",
|
||||
"guide.raceday_more_6": "6. Körda kval och finaler görs aldrig om av misstag. Generera kval/finaler säger nej när heat redan har körts. Vill du verkligen göra om dem: Rensa genererade ... först - den namnger de körda heaten och frågar innan något raderas.",
|
||||
"guide.raceday_more_7": "7. Resultat som PDF automatiskt (Inställningar → Utseende): varje heat eller bara slutresultatet sparas på servern och listas i Resultatarkivet. När sista finalen är klar visas 🖨 Skriv ut resultat.",
|
||||
"guide.raceday_more_8": "8. Varje kvalheat och final har ett 📈 varvdiagram i race-översikten: förarnas placering efter varje varv. Det följer med i utskrift och PDF.",
|
||||
"guide.raceday_more_9": "9. Samma transponder på två förare (samma person i 2WD och 4WD) går bra - varvet går till den förare som är med i heatet. I samma klass går det inte, då kan decodern inte skilja dem åt.",
|
||||
"guide.series_fix_title": "Rätta till i en serie",
|
||||
"guide.series_fix_1": "1. Samma förare på två rader i serien? Det händer när en dubblett tagits bort efter en omgång. Raden får 🔗 Koppla till förare - välj rätt förare så flyttas poängen dit.",
|
||||
"guide.series_fix_2": "2. Två förarposter för samma person: Förare → redigera → Slå ihop med en annan förare. Alla heat, varv, resultat, anmälningar, seriepoäng och träningsvarv flyttas till den du behåller. Bara Race Controller Master kan slå ihop.",
|
||||
"guide.series_fix_3": "3. Ett race som körts utanför RaceCore, eller körts som något annat (t.ex. Open Practice): skapa omgången och sätt ordningen med ✎ Resultat. Seriepoängen räknas från den.",
|
||||
"guide.series_fix_4": "4. En förare som körde kvalet men inte finalen placeras efter finalisterna i kvalordning och får poäng, enligt vanliga cupregler.",
|
||||
"guide.series_fix_5": "5. 📄 på en omgång laddar ner dagens CSV för den klassen: sammanfattning per heat och alla varv.",
|
||||
"guide.driver_page_title": "Förarens egen sida i mobilen",
|
||||
"guide.driver_page_1": "1. Under Träning → Mål och mobilprofil: Aktivera mobilprofil och visa QR-koden. Föraren skannar den en gång och har sin sida i mobilen - inget konto behövs.",
|
||||
"guide.driver_page_2": "2. Standard visar allt: mål, utmaningar, övningar, timer och statistik. Pro är en ren träningsvy - bara dagens träning högst upp (varv, stints, körtid, bästa, snitt och dagens PB) och stintkorten. Mobilen kommer ihåg valet, och en länk med ?mode=pro öppnar direkt i Pro.",
|
||||
"guide.driver_page_3": "3. Stintkorten: stintens snabbaste varv är grönt och dagens snabbaste lila. Varje stint visar total tid och jämnhet.",
|
||||
"guide.driver_page_4": "4. 🏁 Mitt race i dag: på en tävlingsdag visar sidan förarens nästa heat med tid och startplats, banvaktspass och dagens resultat. Den uppdateras av sig själv.",
|
||||
"guide.driver_page_5": "5. Sidan visar bara förarens egen statistik. Kontaktuppgifter och andra förares data skickas aldrig till mobilen.",
|
||||
"guide.archive_7": "7. 📄 CSV för racedagen: välj samma datum i Från och Till (och en klass om du vill). Filen har en sammanfattning per heat och sedan varje varv i körordning, och öppnas i kolumner i Excel. Sparade resultat-PDF:er listas under 📄 Sparade PDF:er.",
|
||||
"guide.video_cup_day": "En cupdag - incheckning, kval, finaler, rätta en dubblett och dagens CSV",
|
||||
"guide.video_driver_page": "Träningsstatistik, Standard/Pro och nästa heat i mobilen",
|
||||
"overlay.title": "Overlay",
|
||||
"overlay.subtitle": "Extern leaderboard-skärm",
|
||||
"overlay.no_active": "Ingen aktiv session vald.",
|
||||
@@ -4929,8 +4954,8 @@ const TRANSLATIONS = {
|
||||
"guide.day_flow_9": "9. Run the finals, lowest final first. On a grid start the announcer counts 10 … 3, says \"Starting to the sound of the tone\" and the tone follows. With bump-ups: Apply bump-ups when a lower final is done. Today's schedule on Race Day puts every class in one running order with times.",
|
||||
"guide.race_wizard_title": "Create Race Wizard",
|
||||
"guide.race_wizard_1": "1. Start in Race Setup and use the wizard when creating a new race instead of building everything directly in Manage.",
|
||||
"guide.race_wizard_2": "2. Step 1 sets name, date, class and preset. The preset fills sensible defaults before you fine-tune anything.",
|
||||
"guide.race_wizard_3": "3. Step 2 selects exactly which drivers should be valid for this race. They then become the race-specific participant scope for timing and seeding.",
|
||||
"guide.race_wizard_2": "2. Step 1 sets name, date, class and preset. Whole race days come as presets (EFRA off-road, touring, 1/8 nitro, ROAR, quick club day, Rookie/Junior, points race without finals) - the description shows under the choice. The preset fills sensible defaults before you fine-tune anything.",
|
||||
"guide.race_wizard_3": "3. Step 2 selects exactly which drivers take part. The list is grouped by class with All/None per class, a search on name or transponder and Same drivers as... to copy an earlier race. They become the race-specific participant scope for timing and seeding.",
|
||||
"guide.race_wizard_4": "4. Step 3 chooses which sessions should be created immediately: practice, qualifying and/or team race depending on the preset.",
|
||||
"guide.race_wizard_5": "5. The wizard creates the initial sessions automatically, qualifying as heats (Q1 H1, Q1 H2 …). Finals are generated later from Race Actions after qualifying or practice is complete.",
|
||||
"guide.race_wizard_6": "6. After creation, continue in Manage for race format, generation, grid, standings and print/export.",
|
||||
@@ -5966,6 +5991,31 @@ const TRANSLATIONS = {
|
||||
"guide.archive_4": "4. The race package (JSON) is exported from the race in the archive.",
|
||||
"guide.archive_5": "5. Deleting an event or session removes the race's data everywhere, including the raw lap rows in the database - but never affects a driver's durable training statistics, which are already stored separately.",
|
||||
"guide.archive_6": "6. Running your club across several track layouts (e.g. indoors in the same building) - press New layout (on Training stats, Race Day or the Dashboard) when the track has been rebuilt; it works even in the middle of a running Open Practice. The archive shows which layout each session ran on, and personal bests/track records only compare against the same layout. On Training stats and in the driver's mobile profile, pick Stats for: the current layout, an older layout, or All layouts.",
|
||||
"guide.raceday_more_title": "Race day: check-in, marshals and one master",
|
||||
"guide.raceday_more_1": "1. One computer is the Race Controller Master: it runs the decoder, the clock and the autopilot. Open RaceCore on more computers or screens to show the race - they only show it. Picking a heat or saving there can't change which heat runs, a heat's status or the laps.",
|
||||
"guide.raceday_more_2": "2. Check-in is optional: Manage race → Check-in. Tick present and paid, see whether the transponder has been seen on the decoder today, print the list and remove no-shows (before qualifying starts). Without a check-in everyone counts as present.",
|
||||
"guide.raceday_more_3": "3. Marshals are chosen in Race Day's schedule (Off / Drivers of the heat before / the heat after). They show per heat in the schedule, the running order and the drivers' board, and are read out after the drivers in the heat call.",
|
||||
"guide.raceday_more_4": "4. Fixed breaks (e.g. Lunch 12:00-13:00 and Prize-giving 16:00-16:30) are added with + Add break. A heat that would run into one starts when it ends.",
|
||||
"guide.raceday_more_5": "5. Decoder alarm: if the decoder drops during a heat, or no passings come, a red banner shows on every page with a warning sound. Settings → Audio → Decoder alarm during heats.",
|
||||
"guide.raceday_more_6": "6. Qualifying and finals that have run are never made again by mistake. Generate qualifying/finals refuses when heats have run. To really redo them: Clear generated ... first - it names the run heats and asks before deleting.",
|
||||
"guide.raceday_more_7": "7. Results as PDF automatically (Settings → Appearance): every heat or the final results only, saved on the server and listed in the Results archive. When the last final is done, 🖨 Print results appears.",
|
||||
"guide.raceday_more_8": "8. Every qualifying heat and final has a 📈 lap chart in the race overview: each driver's place after every lap. It is in the print and PDF too.",
|
||||
"guide.raceday_more_9": "9. One transponder on two drivers (the same person in 2WD and 4WD) is fine - the lap goes to the driver in the heat. Within one class it is refused, since the decoder can't tell them apart.",
|
||||
"guide.series_fix_title": "Fixing things in a series",
|
||||
"guide.series_fix_1": "1. The same driver on two rows in the series? That happens when a duplicate was deleted after a round. The row gets 🔗 Link to driver - pick the right driver and the points move there.",
|
||||
"guide.series_fix_2": "2. Two driver entries for one person: Drivers → edit → Merge with another driver. Every heat, lap, result, entry, series point and training lap moves to the one you keep. Only the Race Controller Master can merge.",
|
||||
"guide.series_fix_3": "3. A race run outside RaceCore, or run as something else (e.g. Open Practice): create the round and set the order with ✎ Result. The series points are counted from it.",
|
||||
"guide.series_fix_4": "4. A driver who ran qualifying but not the final is placed after the finalists in qualifying order and gets points, as cup rules usually say.",
|
||||
"guide.series_fix_5": "5. 📄 on a round downloads the day's CSV for that class: a summary per heat and every lap.",
|
||||
"guide.driver_page_title": "The driver's own page on the phone",
|
||||
"guide.driver_page_1": "1. Under Training → Goals and mobile profile: Enable mobile profile and show the QR code. The driver scans it once and has their page on the phone - no account needed.",
|
||||
"guide.driver_page_2": "2. Standard shows everything: goals, challenges, exercises, timer and stats. Pro is a clean practice view - just today's practice at the top (laps, stints, drive time, best, average and today's PB) and the stint cards. The phone remembers the choice, and a link with ?mode=pro opens straight in Pro.",
|
||||
"guide.driver_page_3": "3. Stint cards: the stint's fastest lap is green and the day's fastest purple. Each stint shows its total time and consistency.",
|
||||
"guide.driver_page_4": "4. 🏁 My race today: on a race day the page shows the driver's next heats with time and grid place, marshal duties and today's results. It updates by itself.",
|
||||
"guide.driver_page_5": "5. The page only shows the driver's own stats. Contact details and other drivers' data are never sent to the phone.",
|
||||
"guide.archive_7": "7. 📄 CSV for the race day: pick the same date in From and To (and a class if you like). The file has a summary per heat and then every lap in running order, and opens in columns in Excel. Saved result PDFs are listed under 📄 Saved PDFs.",
|
||||
"guide.video_cup_day": "A cup day - check-in, qualifying, finals, fixing a duplicate and the day's CSV",
|
||||
"guide.video_driver_page": "Training stats, Standard/Pro and the next heat on the phone",
|
||||
"overlay.title": "Overlay",
|
||||
"overlay.subtitle": "External leaderboard screen",
|
||||
"overlay.no_active": "No active session selected.",
|
||||
|
||||
+9
-1
@@ -105,6 +105,10 @@ export function renderGuideView({ dom, t }) {
|
||||
${renderGuidePanel("guide.qualifying_title", ["guide.qualifying_1", "guide.qualifying_2", "guide.qualifying_3", "guide.qualifying_4", "guide.qualifying_5", "guide.qualifying_6", "guide.qualifying_7"], "", { t })}
|
||||
</div>
|
||||
|
||||
<div class="guide-section-grid mt-16">
|
||||
${renderGuidePanel("guide.raceday_more_title", ["guide.raceday_more_1", "guide.raceday_more_2", "guide.raceday_more_3", "guide.raceday_more_4", "guide.raceday_more_5", "guide.raceday_more_6", "guide.raceday_more_7", "guide.raceday_more_8", "guide.raceday_more_9"], "", { t })}
|
||||
</div>
|
||||
|
||||
<div class="guide-section-grid mt-16">
|
||||
${renderGuidePanel("guide.audio_title", ["guide.audio_1", "guide.audio_2", "guide.audio_3", "guide.audio_4", "guide.audio_5", "guide.audio_6", "guide.audio_7", "guide.audio_8", "guide.audio_9", "guide.audio_10"], "", { t })}
|
||||
</div>
|
||||
@@ -116,6 +120,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.series_fix_title", ["guide.series_fix_1", "guide.series_fix_2", "guide.series_fix_3", "guide.series_fix_4", "guide.series_fix_5"], "", { 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>
|
||||
@@ -123,7 +128,8 @@ export function renderGuideView({ dom, t }) {
|
||||
<div data-guide-panel="training">
|
||||
<div class="guide-section-grid mt-16">
|
||||
${renderGuidePanel("guide.training_title", ["guide.training_1", "guide.training_2", "guide.training_3", "guide.training_4", "guide.training_5", "guide.training_6", "guide.training_7", "guide.training_8", "guide.training_9", "guide.training_10", "guide.training_11", "guide.training_12", "guide.training_13", "guide.training_14", "guide.training_15", "guide.training_16", "guide.training_17", "guide.training_18", "guide.training_19", "guide.training_20", "guide.training_21", "guide.training_22", "guide.training_23", "guide.training_24", "guide.training_25", "guide.training_26", "guide.training_27", "guide.training_28", "guide.training_29", "guide.training_30", "guide.training_31"], "", { t })}
|
||||
${renderGuidePanel("guide.archive_title", ["guide.archive_1", "guide.archive_2", "guide.archive_3", "guide.archive_4", "guide.archive_5", "guide.archive_6"], "", { t })}
|
||||
${renderGuidePanel("guide.archive_title", ["guide.archive_1", "guide.archive_2", "guide.archive_3", "guide.archive_4", "guide.archive_5", "guide.archive_6", "guide.archive_7"], "", { t })}
|
||||
${renderGuidePanel("guide.driver_page_title", ["guide.driver_page_1", "guide.driver_page_2", "guide.driver_page_3", "guide.driver_page_4", "guide.driver_page_5"], "", { t })}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -137,6 +143,8 @@ export function renderGuideView({ dom, t }) {
|
||||
<li><a href="/docs/videos/add-drivers-cars.mkv" target="_blank" rel="noopener">${t("guide.video_add_drivers_cars")}</a></li>
|
||||
<li><a href="/docs/videos/create-race.mkv" target="_blank" rel="noopener">${t("guide.video_create_race")}</a></li>
|
||||
<li><a href="/docs/videos/run-a-session.mkv" target="_blank" rel="noopener">${t("guide.video_run_session")}</a></li>
|
||||
<li><a href="/docs/videos/cup-day.mkv" target="_blank" rel="noopener">${t("guide.video_cup_day")}</a></li>
|
||||
<li><a href="/docs/videos/driver-page.mkv" target="_blank" rel="noopener">${t("guide.video_driver_page")}</a></li>
|
||||
<li><a href="/docs/videos/settings-tabs.mkv" target="_blank" rel="noopener">${t("guide.video_settings_tabs")}</a></li>
|
||||
<li><a href="/docs/videos/event-manager-tabs.mkv" target="_blank" rel="noopener">${t("guide.video_event_manager_tabs")}</a></li>
|
||||
<li><a href="/docs/videos/event-schedule.mkv" target="_blank" rel="noopener">${t("guide.video_event_schedule")}</a></li>
|
||||
|
||||
@@ -39,13 +39,13 @@ 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`), 27, "five sections (with Rookie), 27 steps");
|
||||
assert.equal(await evaluate(`document.querySelectorAll('[data-guide-panel="series"] .guide-list li').length`), 32, "six sections (with Rookie and fixing a series), 32 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");
|
||||
|
||||
const videoLinkCount = await evaluate(`document.querySelectorAll('[data-guide-panel="videos"] a[href^="/docs/videos/"]').length`);
|
||||
assert.equal(videoLinkCount, 13, "all 13 video guide links live under the Video guides tab");
|
||||
assert.equal(videoLinkCount, 15, "all 15 video guide links live under the Video guides tab");
|
||||
|
||||
await evaluate(`document.querySelector('[data-guide-tab="run"]').click()`);
|
||||
assert.equal(await activeTab(), "run");
|
||||
|
||||
Reference in new issue
Block a user