feat(layouts): optional min/max lap time per track layout for practice
Each layout can carry its own lap window (set on creation, editable in Settings, saved from Race Day during practice). Open/Free practice on that layout uses it; races always keep the event's values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8601954ea2
commit
9d79bcb4d3
13 files changed
+174
-15
No files matched your search
@@ -24,7 +24,9 @@ export function bindTrackLayoutBar(root, { state, t, addTrackLayout, renderView
|
||||
const suggested = nextTrackLayoutLabel(normalizeTrackLayouts(state.trackLayouts));
|
||||
const label = window.prompt(t("layouts.new_prompt"), suggested);
|
||||
if (label === null) return;
|
||||
const result = addTrackLayout(label.trim() || suggested, Date.now());
|
||||
// Optional: a rebuilt track often needs its own minimum lap time (empty = the event's).
|
||||
const minLapSec = Number(String(window.prompt(t("layouts.new_min_lap_prompt"), "") || "").replace(",", "."));
|
||||
const result = addTrackLayout(label.trim() || suggested, Date.now(), { minLapMs: Number.isFinite(minLapSec) && minLapSec > 0 ? Math.round(minLapSec * 1000) : 0 });
|
||||
if (!result.ok) {
|
||||
window.alert(result.message);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user