fix(overlay): show every driver, compact rows beyond 12 (1.42.6)
The overlay page cut the leaderboard at 12 drivers. It now shows all of them, with compact rows when there are more than 12 so they fit on a TV.
This commit is contained in:
1 parent
2c2b16537e
commit
0cabe1f96f
6 files changed
+29
-5
No files matched your search
+3
-1
@@ -176,7 +176,9 @@ export function renderOverlayPageView(deps) {
|
||||
const { state, dom, t, escapeHtml, formatLap, formatCountdown, formatElapsedClock, formatPredictedLapDelta, getActiveSession, buildLeaderboard, ensureSessionResult, getSessionTiming, getVisiblePassings, resolveEventBranding, buildPracticeStandings, buildQualifyingStandings, buildFinalStandings, getOverlayModeLabel, getStatusLabel, getObsOverlayConfig, buildOverlayPanels, normalizeStartMode, renderPositionGrid, getEventName, getSessionTypeLabel, getStartModeLabel, renderRaceStandingsTableView, renderTeamOverlay, renderObsOverlay, renderOverlayLeaderboard, renderOverlaySidePanel, formatTeamActiveMemberLabel, getSessionGridEntries, getSessionGridOrder, overlayViewMode, overlayMode, publicOverlayMode, overlayEvents, overlayRotationIndex, openOverlayWindow, buildOverlayUrl } = deps;
|
||||
|
||||
const active = getActiveSession();
|
||||
const leaderboard = active ? buildLeaderboard(active).slice(0, 12) : [];
|
||||
// Every driver: an Open Practice often has more than 12 cars out (OBS has its own row
|
||||
// setting and cuts the list itself).
|
||||
const leaderboard = active ? buildLeaderboard(active) : [];
|
||||
const result = active ? ensureSessionResult(active.id) : null;
|
||||
const sessionTiming = active ? getSessionTiming(active) : null;
|
||||
const overlayClock = sessionTiming?.followUpActive
|
||||
|
||||
+4
-1
@@ -66,8 +66,11 @@ export function renderOverlayLeaderboard(rows, { t, escapeHtml, formatTeamActive
|
||||
const sortAttrs = sortable
|
||||
? ` data-sort-id="overlay-leaderboard" data-sort-text-columns="1" data-sort-labels="${sortValuesAttribute([t("table.pos"), t("table.driver"), t("table.laps"), t("table.result"), t("table.gap"), t("table.ahead_gap"), t("table.own_delta"), t("table.best_lap")])}"`
|
||||
: "";
|
||||
// More than 12 cars (a busy Open Practice): compact rows so all of them fit on a TV that
|
||||
// can't scroll - no per-cell labels (the header names the columns), sub-line or prediction bar.
|
||||
const compact = rows.length > 12;
|
||||
return `
|
||||
<div class="overlay-race-list"${sortAttrs}>
|
||||
<div class="overlay-race-list ${compact ? "overlay-race-list-compact" : ""}"${sortAttrs}>
|
||||
${rows
|
||||
.map((row, idx) => {
|
||||
const posClass = idx === 0 ? "pos-1" : idx === 1 ? "pos-2" : idx === 2 ? "pos-3" : "";
|
||||
|
||||
@@ -4716,3 +4716,16 @@ tr.is-removed td.lap-actions {
|
||||
/* RaceCore's own overlay: a driver row opens their training stats. */
|
||||
.overlay-race-row.is-linked { cursor: pointer; }
|
||||
.overlay-race-row.is-linked:hover .overlay-race-driver strong { text-decoration: underline; text-underline-offset: 3px; }
|
||||
|
||||
/* More than 12 cars: compact rows so every driver fits on a TV screen (renderOverlayLeaderboard). */
|
||||
.overlay-race-list-compact .overlay-race-row {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
.overlay-race-list-compact .overlay-race-metric label,
|
||||
.overlay-race-list-compact .overlay-race-best label,
|
||||
.overlay-race-list-compact .overlay-race-driver > span,
|
||||
.overlay-race-list-compact .overlay-prediction,
|
||||
.overlay-race-list-compact .overlay-decoder-meta {
|
||||
display: none;
|
||||
}
|
||||
Reference in new issue
Block a user