Refine race setup summary and preset-aware basic mode

This commit is contained in:
larssand
2026-03-20 14:37:51 +01:00
parent db1038f9bf
commit 4a16a76206
4 changed files with 29 additions and 0 deletions

View File

@@ -193,6 +193,8 @@ const TRANSLATIONS = {
"events.race_summary_finals": "Finalupplägg",
"events.race_summary_validation": "Varvfönster",
"events.race_summary_follow_up": "Follow-up",
"events.race_summary_focus": "Fokus",
"events.race_summary_generation": "Generering",
"events.race_actions_title": "Race actions",
"events.race_actions_hint": "Generering och reseeding ligger separat från formatinställningarna så setupen blir lättare att läsa.",
"events.context_standard_title": "Klubbrace-läge",
@@ -907,6 +909,8 @@ const TRANSLATIONS = {
"events.race_summary_finals": "Finals setup",
"events.race_summary_validation": "Lap window",
"events.race_summary_follow_up": "Follow-up",
"events.race_summary_focus": "Focus",
"events.race_summary_generation": "Generation",
"events.race_actions_title": "Race actions",
"events.race_actions_hint": "Generation and reseeding live separately from the format fields so setup is easier to read.",
"events.context_standard_title": "Club race mode",
@@ -7712,12 +7716,25 @@ function getRaceSummaryItems(event, sessions, raceDrivers, selectedPreset) {
const teamCount = sessions.filter((session) => session.type === "team_race").length;
const scoringLabel = cfg.qualifyingScoring === "best" ? t("events.qualifying_scoring_best") : t("events.qualifying_scoring_points");
const lapWindow = `${((cfg.minLapMs || 0) / 1000).toFixed(1)}s / ${((cfg.maxLapMs || 0) / 1000).toFixed(1)}s`;
const isEndurancePreset = selectedPreset?.id === "endurance";
if (isEndurancePreset) {
return [
{ label: t("events.race_summary_preset"), value: selectedPreset?.label || t("events.preset_custom") },
{ label: t("events.race_summary_focus"), value: `${t("events.team_race")} · ${getStartModeLabel("mass")}` },
{ label: t("events.race_summary_participants"), value: String(participantCount || 0) },
{ label: t("events.race_summary_created_sessions"), value: `P ${practiceCount} · T ${teamCount}` },
{ label: t("events.race_summary_generation"), value: `${teamCount ? t("events.team_race") : t("events.wizard_use_team_race")} · ${cfg.finalDurationMin || 0} min` },
{ label: t("events.race_summary_validation"), value: lapWindow },
{ label: t("events.race_summary_follow_up"), value: `${cfg.followUpSec || 0}s` },
];
}
return [
{ label: t("events.race_summary_preset"), value: selectedPreset?.label || t("events.preset_custom") },
{ label: t("events.race_summary_participants"), value: String(participantCount || 0) },
{ label: t("events.race_summary_created_sessions"), value: `P ${practiceCount} · Q ${qualCount} · F ${finalCount} · T ${teamCount}` },
{ label: t("events.race_summary_qualifying"), value: `${cfg.qualifyingRounds || 0} x ${cfg.qualDurationMin || 0} min · ${cfg.carsPerHeat || 0}/heat · ${scoringLabel}` },
{ label: t("events.race_summary_finals"), value: `${cfg.carsPerFinal || 0}/main · ${cfg.finalLegs || 0} leg · ${getStartModeLabel(cfg.finalStartMode || "position")}` },
{ label: t("events.race_summary_generation"), value: `${cfg.finalsSource === "practice" ? t("events.finals_from_practice") : t("events.finals_from_qualifying")} · bump ${cfg.bumpCount || 0}` },
{ label: t("events.race_summary_validation"), value: lapWindow },
{ label: t("events.race_summary_follow_up"), value: `${cfg.followUpSec || 0}s` },
];