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>
This commit is contained in:
larssandandClaude Sonnet 5 committed 2026-09-11 13:47:35 +02:00
1 parent 85e18db0ed
commit ba4ed30b11
8 files changed
+114 -5

No files matched your search

+30
View File
@@ -1,3 +1,16 @@
let activeManageTab = "setup";
// Maps a data-target anchor id (used by the step-card overview and the race-summary
// warning links) to the tab it now lives inside, so jumping to it also switches tabs
// first - scrollIntoView on an element hidden behind an inactive tab does nothing useful.
const MANAGE_TAB_TARGETS = {
"manage-setup-participants": "setup",
"manage-setup-teams": "setup",
"manage-format": "format",
"manage-generation": "format",
"manage-live-grid": "live",
"manage-live-results": "live",
};
export function renderEventManagerView(context) {
const {
eventId,
@@ -201,9 +214,25 @@ export function renderEventManagerView(context) {
renderTable,
});
const manageTabButtons = Array.from(eventManageArea.querySelectorAll(".manage-tab"));
const manageTabPanels = Array.from(eventManageArea.querySelectorAll("[data-manage-panel]"));
const applyManageTab = (tabId) => {
activeManageTab = tabId;
manageTabButtons.forEach((button) => button.classList.toggle("active", button.dataset.manageTab === tabId));
manageTabPanels.forEach((panel) => { panel.hidden = panel.dataset.managePanel !== tabId; });
};
manageTabButtons.forEach((button) => {
button.addEventListener("click", () => applyManageTab(button.dataset.manageTab));
});
if (manageTabButtons.length) {
applyManageTab(manageTabButtons.some((button) => button.dataset.manageTab === activeManageTab) ? activeManageTab : "setup");
}
const bindManageJump = (node) => {
const triggerJump = () => {
const targetId = node.getAttribute("data-target") || "";
const targetTab = MANAGE_TAB_TARGETS[targetId];
if (targetTab) applyManageTab(targetTab);
const target = targetId ? document.getElementById(targetId) : null;
if (target) {
target.scrollIntoView({ behavior: "smooth", block: "start" });
@@ -344,6 +373,7 @@ export function renderEventManagerView(context) {
document.getElementById(`session-grid-${s.id}`)?.addEventListener("click", () => {
ensureSessionDriverOrder(s);
setSelectedGridSessionId(s.id);
activeManageTab = "live";
saveState();
refreshManager();
});