Commit Graph
50 Commits
Author SHA1 Message Date
larssand fbc4246a60 feat(race): autopilot waits for qualifying from practice; qualifying start time per class (1.89.51) 2026-11-16 23:01:49 +01:00
larssand 576847279d feat(race): practice seeding setting (EFRA 3 in a row), seeding time in lists and a new-seeding-time call (1.89.49) 2026-11-16 22:39:10 +01:00
larssand 74a2e9ba47 feat(race): practice split into heats by cars per heat; format change rebuilds heats not run yet (1.89.46) 2026-11-16 21:54:06 +01:00
larssand 93c590e5b8 fix(race): never remake qualifying or finals that have already run; clearing them asks first (1.89.36) 2026-11-15 16:16:28 +01:00
larssand 01abe5b7ae fix(timing): shared transponder goes to the driver in the heat; confirm before remaking run finals (1.89.35) 2026-11-15 15:02:26 +01:00
larssand cc286165df feat(race): driver picker grouped by class with all/none per class, search and copy from an earlier race (1.89.33) 2026-11-14 21:34:32 +01:00
larssand 2db77fe6cd feat(race): optional check-in tab with present, paid, transponder seen and remove no-shows (1.89.29) 2026-11-14 16:09:42 +01:00
larssand f8080ffaeb feat(day): one start time - Race setup's start time and gap are Race Day's, with Race Day's times shown (1.89.17) 2026-11-13 09:40:48 +01:00
larssand 3870510d8c feat(houseofrc): send heats automatically after every heat, show send status, warn before sending (1.85.0) 2026-11-08 23:19:43 +01:00
larssand ebdc6104e6 feat(houseofrc): preview and send results to the event's entries, heats or final placings (1.83.0) 2026-11-08 20:44:23 +01:00
larssand f4a62b92d2 feat(houseofrc): re-fetch late entries and withdrawals, remember class mapping, offer brand differences (1.82.0) 2026-11-08 19:04:27 +01:00
larssand 37076b8490 feat(team-race): one team race setup panel with auto split, car per team and start checks (1.67.0) 2026-11-05 21:55:37 +01:00
larssand d0a5df6992 feat(sponsor): quick setup with guest drivers, shared rental cars, rotating heats and A/B finals (1.63.0) 2026-11-05 18:31:57 +01:00
larssand db6a9f19e4 fix(race): finish the lap you are on, one clock owner, edits survive refresh, participants editable (1.59.0) 2026-11-04 21:34:06 +01:00
larssand 8b625c3d64 fix(race-setup): ask before deleting a race or a session (1.54.1) 2026-11-02 08:48:37 +01:00
larssand 73e3d1ff75 feat(race-setup): group a race's sessions per step, fold run steps, rare actions in a menu (1.53.0) 2026-11-02 08:26:00 +01:00
larssand bb0fa7ede4 feat(race-setup): list sessions in running order and move them with up/down (1.49.0) 2026-11-01 20:13:15 +01:00
larssandandClaude Opus 5.5 5bfb67ea02 feat(race-day): start heats with an EFRA/IFMAR count-down and flying start
Race Day Start now runs a count-down (Go, 30 s - 5 min, default per
event) with calls every minute, 30 s and 10 s, grid call and 9..3
count for grid starts, hold/resume/+1 min/to 30 s/to 10 s/Go now, and
starts the heat by itself when it runs out. The transponder check runs
during the count-down, replacing the separate warm-up.

Adds a flying start mode (horn + clock is running, own clock per car)
as the qualifying default, and the latest personal clock start rules
from EFRA 9.3 / IFMAR 4.2.3 for flying and staggered starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 21:27:20 +02:00
larssandandClaude Sonnet 5 ba4ed30b11 Split Event Manager's race-mode page into tabs
The race-mode management page (participants, teams, race format,
live grid/standings, and now the schedule/print tools) had grown into
a long scroll. Grouped into four tabs - Participants & teams, Format,
Live & results, Schedule & print - matching the tab pattern already
used for Settings. Only wrapper divs were added; no section's markup
or event bindings moved. The existing step-card overview and warning
links now switch to the right tab before jumping to it, and Open Grid
switches to the Live tab so its target is actually visible. Track/
sponsor events, which never had this length problem, are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 13:47:35 +02:00
larssandandClaude Sonnet 5 cf89086dff Add a time-of-day race day schedule to Event Manager
Events can now be given a start time and a gap between sessions on a
new "Schedule" panel; every session's planned clock time cascades
automatically in running order (practice, qualifying, finals), and
once a session actually starts or finishes, everything after it
re-anchors to that real time - a late start or a session that ran
long (including any pause) pushes the rest of the day forward with
no manual reschedule step. The scheduled time now also shows on the
printed/PDF start lists.

Printable start lists and manually moving a driver to start last in
their own heat (for a mechanic-time request) already existed, so
this only builds the missing piece: the schedule itself.

Also fixes a real pre-existing bug in the same session-ordering logic
this feature relies on: getSessionSortWeight used `order[type] || 99`,
which silently treated open_practice's own weight of 0 as falsy and
sorted practice sessions dead last instead of first in print/PDF
output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 22:33:57 +02:00
larssandandClaude Sonnet 5 b1b65a9cf9 Add moving a driver between qualifying heats
The user asked whether a lone driver left in the last heat (e.g. 7
drivers at 3 per heat) could be moved into another heat manually.
Investigated first: neither "Reseed" (redistributes every not-yet-run
heat by current standings, not a targeted move) nor the grid editor
(reorders start position within one heat, never moves a driver
between heats) could do this - there was genuinely no path to it.

moveDriversIntoQualifyingHeat (src/event_race_logic.js) adds the same
"checking them elsewhere is the move" pattern already used for team
rosters: a new driver checklist on the qualification session edit
form pulls a checked driver out of whichever other heat they're
currently on, scoped to the same round only ("Q2 H2" never touches
"Q1"/"Q3", since heat composition can legitimately differ round to
round after a reseed). The checklist names the driver's current heat
before saving, mirroring the team-roster warning.

Also confirmed, per the user's earlier questions, already correct
with no changes needed: practice's per-driver "best 3 laps"/"best
5-minute result" stats, and that heats are already seeded fastest-
first from practice results. Flagged one real, deliberately unbuilt
gap while investigating: a true per-driver rolling "5 minutes from
your own first crossing" qualifying *heat* clock isn't supported -
only the practice stats work that way today.

Verified with new unit tests for moveDriversIntoQualifyingHeat and
the extracted parseQualifyingHeatName helper, and a real headless-
browser run reproducing the exact reported scenario end to end
through the actual UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 18:18:01 +02:00
larssandandClaude Sonnet 5 f0838bc5db Fix qualifying/finals/bump-up/judging/pause-timing bugs
A thorough audit of practice/qualifying/heats/finals, bump-up,
judging and pause/timer code (requested by the user) found several
real, concrete bugs, fixed together:

- Qualifying reseed sorted heats as text ("H10" before "H2"),
  scrambling grids at 10+ heats; now sorts numerically and reports a
  clear warning instead of silently dropping/ghosting heats when the
  participant count changes.
- A driver with zero laps in a finished heat/final (DNS) vanished
  entirely - not just from that round, but silently from every future
  reseeded round and the final grid. Now backfilled as a real,
  last-place "DNS" row.
- Bump-up did nothing at all with "reserve bump slots" off (mains
  were already seeded full, so the old capacity check always
  blocked it), and a promoted driver stayed double-entered in their
  old main's upcoming leg. An oversized bump count could also blow
  the main-letter naming past "Z". All three fixed.
- Judging undo restored an absolute snapshot instead of reversing its
  own delta - undoing two penalties out of order could leave a live
  penalty behind two "undone" log entries. Now always nets correctly
  regardless of undo order.
- A competitor's elapsed time didn't exclude paused time (only the
  session clock did), making a paused heat's results incomparable to
  an unpaused one in qualifying ranking. Finishing while paused also
  dropped the final pause segment, so the displayed elapsed time kept
  growing after finish. Both fixed.

Verified with new unit tests for every fix (including a new
session_control.test.js - that file had zero prior coverage) and a
real headless-browser run confirming the judging-undo and bump-up
fixes end to end through the actual UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 17:41:10 +02:00
larssandandClaude Sonnet 5 15b574a37d Fix Team Race duplicate-membership bug and two related team-roster gaps
Reported by the user: creating a team, adding the wrong driver, then
moving that driver to another team by ticking them on the new team's
edit form left the driver on both teams at once. Root cause: there
was never a "move" action - the edit form only ever added a driver to
the team being saved, never removed them from wherever they already
were. Live laps from a driver on two teams were then silently
credited to only the first-matching team, with no clear error.

reassignTeamMembers (event_race_logic.js) now strips a driver/car
being saved onto one team out of every other team in the same event,
and the team checkbox list shows which team a driver is already on
before you move them.

Also fixed two related gaps found while investigating, at the user's
request to fix everything: getTeamDriverPool had regressed to
ignoring the event's class/participant scoping entirely (showing
every driver in the club), and deleting a driver or car left them
behind in team rosters forever. Added a duplicate_team_members Race
Day preflight check as defense in depth for any already-corrupted
saved state.

Verified with new unit tests for reassignTeamMembers, getTeamDriverPool
and the new preflight check, plus a new permanent browser test
reproducing the user's exact reported scenario end to end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 17:07:45 +02:00
larssandandClaude Sonnet 5 94794350e5 Add a results archive and purge orphaned passing rows on delete
Until now there was no way to find a completed session without already
knowing which event it belonged to - navigation was strictly Events ->
one event -> its sessions. A new "Resultatarkiv" view lists every
finished session across all events, searchable by event/session name,
class, driver and date range.

Opening a session reuses the existing single-session leaderboard
builder for standings and the existing per-competitor lap lookup for
lap history - no new results logic - plus a session-wide penalties/
corrections list (resultsBySession[id].adjustments), previously only
visible in the live judging action log. Export buttons reuse the
existing per-event PDF and race-package JSON export functions rather
than adding a new format.

Investigated what should happen to raw timing data when a race is
deleted. Training statistics and session replay already read from
their own independent, deliberately-retained copies that survive
deletion by existing design - unaffected either way. The one thing
that outlived deletion with no purpose was the raw `passings` SQLite
rows (write-only; nothing in the app reads them), growing forever with
driver IDs never purged. A new POST /api/passings/purge endpoint now
removes exactly the deleted session(s)' rows, called as a best-effort
side call from both delete-event and delete-session.

Also fixes a real bug found while building this: ensureSessionResult
guarded adjustments/splits/pitEvents/pitStops against being missing on
an already-existing result, but not passings itself, so viewing lap
history for such a result (e.g. an older/imported race package)
crashed outright.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 15:49:10 +02:00
larssand abf887dccd Split- och depåstatistik är implementerad 2026-08-25 20:00:55 +02:00
larssand ceac00987c Fix race format persistence in event manager 2026-03-27 21:47:50 +01:00
larssand e4b3c9f5d2 logik miss 2026-03-27 21:24:38 +01:00
larssand 346b1e7657 aadd 2026-03-27 21:20:32 +01:00
larssand 5ff81a3f1e nytt lag öppnar inte edit-modal automatiskt längre
det ska bara dyka upp i listan direkt
2026-03-27 21:13:29 +01:00
larssand 346eb41e75 fix lag 2026-03-27 19:35:05 +01:00
larssand f5be5b57ad fixa lag 2026-03-27 19:07:19 +01:00
larssand 05e0bf0c1f lag race 2026-03-27 18:56:32 +01:00
larssand 4daee0cd21 gjort om race o lag 2026-03-27 18:47:59 +01:00
larssand a1695e86db ssssss 2026-03-27 18:28:47 +01:00
larssand 0e92c85c73 lag issues 2026-03-27 18:24:13 +01:00
larssand c0f2908973 ifno igen 2026-03-27 18:21:58 +01:00
larssand 86fcbc4f4c add info 2026-03-27 18:21:20 +01:00
larssand d59eab3ffa alrets 2026-03-27 18:17:08 +01:00
larssand f3b5216a2b fix event och tappa decoder connect 2026-03-27 18:12:44 +01:00
larssand aeaca807f1 restore 2026-03-27 18:06:39 +01:00
larssand 0df1aba99a deb 2026-03-27 18:01:16 +01:00
larssand 07faeff8fd lag 2026-03-27 17:58:13 +01:00
larssand f2945edf08 add debug för race event 2026-03-27 17:52:26 +01:00
larssand d81f262966 fix 2026-03-27 16:56:05 +01:00
larssand 0b625c462e Fix race team actions with explicit manager hooks 2026-03-27 16:51:28 +01:00
larssand 069a2d97e6 Fix team edit and delete wiring in race manager 2026-03-27 16:43:00 +01:00
larssand 1d3dcdf50e fix 2026-03-27 16:41:23 +01:00
larssand 735f1bd350 Fix team edit and delete wiring in race manager 2026-03-27 16:35:06 +01:00
larssand 14b8f777f1 Fix passing validation wiring in timing leaderboard" 2026-03-27 16:26:00 +01:00
larssand 1aa55e3212 Extract event manager controller into module 2026-03-26 20:46:04 +01:00