chore: hide paused elo and mvp UI

Hide paused MVP/Elo UI from the public historical page and remove server 3 from the frontend selector while preserving backend code and data.
This commit is contained in:
devRaGonSa
2026-05-19 09:57:09 +02:00
committed by GitHub
parent 032aaa9ad5
commit bf3ba630fc
3 changed files with 224 additions and 309 deletions

View File

@@ -7,10 +7,6 @@ const HISTORICAL_SERVERS = Object.freeze([
slug: "comunidad-hispana-02",
label: "Comunidad Hispana #02",
},
{
slug: "comunidad-hispana-03",
label: "Comunidad Hispana #03",
},
{
slug: "all-servers",
label: "Todos",
@@ -93,27 +89,6 @@ document.addEventListener("DOMContentLoaded", () => {
const weeklyStateNode = document.getElementById("weekly-leaderboard-state");
const weeklyTableNode = document.getElementById("weekly-leaderboard-table");
const weeklyBodyNode = document.getElementById("weekly-leaderboard-body");
const monthlyMvpTitleNode = document.getElementById("monthly-mvp-title");
const monthlyMvpStateNode = document.getElementById("monthly-mvp-state");
const monthlyMvpListNode = document.getElementById("monthly-mvp-list");
const monthlyMvpNoteNode = document.getElementById("monthly-mvp-note");
const monthlyMvpSnapshotMetaNode = document.getElementById(
"monthly-mvp-snapshot-meta",
);
const monthlyMvpV2TitleNode = document.getElementById("monthly-mvp-v2-title");
const monthlyMvpV2StateNode = document.getElementById("monthly-mvp-v2-state");
const monthlyMvpV2ListNode = document.getElementById("monthly-mvp-v2-list");
const monthlyMvpV2NoteNode = document.getElementById("monthly-mvp-v2-note");
const monthlyMvpV2SnapshotMetaNode = document.getElementById(
"monthly-mvp-v2-snapshot-meta",
);
const comparisonStateNode = document.getElementById("mvp-comparison-state");
const comparisonListNode = document.getElementById("mvp-comparison-list");
const comparisonNoteNode = document.getElementById("mvp-comparison-note");
const eloMmrStateNode = document.getElementById("elo-mmr-state");
const eloMmrListNode = document.getElementById("elo-mmr-list");
const eloMmrNoteNode = document.getElementById("elo-mmr-note");
const eloMmrMetaNode = document.getElementById("elo-mmr-meta");
const weeklyValueHeadingNode = document.getElementById("weekly-leaderboard-value-heading");
const weeklyWindowNoteNode = document.getElementById("weekly-window-note");
const weeklySnapshotMetaNode = document.getElementById(
@@ -136,12 +111,7 @@ document.addEventListener("DOMContentLoaded", () => {
const summaryCache = new Map();
const recentMatchesCache = new Map();
const leaderboardCache = new Map();
const monthlyMvpCache = new Map();
const monthlyMvpV2Cache = new Map();
const eloMmrCache = new Map();
const pendingRequestCache = new Map();
let latestMonthlyMvpResult = null;
let latestMonthlyMvpV2Result = null;
const getSummarySnapshot = (serverSlug) =>
getCachedJson(
@@ -167,30 +137,6 @@ document.addEventListener("DOMContentLoaded", () => {
`${backendBaseUrl}/api/historical/snapshots/leaderboard?server=${encodeURIComponent(serverSlug)}&timeframe=${encodeURIComponent(timeframeKey)}&metric=${encodeURIComponent(metricKey)}&limit=10`,
);
const getMonthlyMvpSnapshot = (serverSlug) =>
getCachedJson(
monthlyMvpCache,
pendingRequestCache,
buildMonthlyMvpSnapshotKey(serverSlug),
`${backendBaseUrl}/api/historical/snapshots/monthly-mvp?server=${encodeURIComponent(serverSlug)}&limit=3`,
);
const getMonthlyMvpV2Snapshot = (serverSlug) =>
getCachedJson(
monthlyMvpV2Cache,
pendingRequestCache,
buildMonthlyMvpV2SnapshotKey(serverSlug),
`${backendBaseUrl}/api/historical/snapshots/monthly-mvp-v2?server=${encodeURIComponent(serverSlug)}&limit=3`,
);
const getEloMmrLeaderboard = (serverSlug) =>
getCachedJson(
eloMmrCache,
pendingRequestCache,
buildEloMmrSnapshotKey(serverSlug),
`${backendBaseUrl}/api/historical/elo-mmr/leaderboard?server=${encodeURIComponent(serverSlug)}&limit=5`,
);
const refreshServerContent = async () => {
const requestId = activeServerRequestId + 1;
const leaderboardRequestId = activeLeaderboardRequestId + 1;
@@ -218,32 +164,6 @@ document.addEventListener("DOMContentLoaded", () => {
summaryNoteNode.textContent = `La vista esta leyendo snapshots precalculados del historico local para ${activeServerLabel}.`;
setSnapshotMeta(summarySnapshotMetaNode, "Cargando snapshot de resumen...");
renderSummaryLoading(summaryNode);
monthlyMvpTitleNode.textContent = `Top 3 MVP mensual V1 - ${activeServerLabel}`;
monthlyMvpNoteNode.textContent = "Cargando periodo del MVP mensual V1...";
setState(monthlyMvpStateNode, "Cargando Top 3 MVP mensual V1...");
monthlyMvpListNode.innerHTML = "";
setSnapshotMeta(
monthlyMvpSnapshotMetaNode,
"Cargando snapshot del MVP mensual V1...",
);
monthlyMvpV2TitleNode.textContent = `Top 3 MVP mensual V2 - ${activeServerLabel}`;
monthlyMvpV2NoteNode.textContent = "Cargando lectura avanzada del MVP mensual V2...";
setState(monthlyMvpV2StateNode, "Cargando Top 3 MVP mensual V2...");
monthlyMvpV2ListNode.innerHTML = "";
setSnapshotMeta(
monthlyMvpV2SnapshotMetaNode,
"Cargando snapshot del MVP mensual V2...",
);
latestMonthlyMvpResult = null;
latestMonthlyMvpV2Result = null;
comparisonListNode.innerHTML = "";
comparisonNoteNode.textContent =
"Cargando comparativa entre los rankings mensuales V1 y V2...";
setState(comparisonStateNode, "Preparando comparativa V1 vs V2...");
eloMmrListNode.innerHTML = "";
eloMmrNoteNode.textContent = "Cargando lectura del rating persistente y score mensual...";
setState(eloMmrStateNode, "Cargando leaderboard Elo/MMR...");
setSnapshotMeta(eloMmrMetaNode, "Cargando metadata de Elo/MMR...");
weeklyWindowNoteNode.textContent = "Cargando snapshot del ranking activo...";
setSnapshotMeta(
weeklySnapshotMetaNode,
@@ -268,66 +188,6 @@ document.addEventListener("DOMContentLoaded", () => {
);
}
const cachedMonthlyMvpPayload = readCachedPayload(
monthlyMvpCache,
buildMonthlyMvpSnapshotKey(activeServerSlug),
);
if (cachedMonthlyMvpPayload) {
latestMonthlyMvpResult = { status: "fulfilled", value: cachedMonthlyMvpPayload };
hydrateMonthlyMvp(
{ status: "fulfilled", value: cachedMonthlyMvpPayload },
monthlyMvpStateNode,
monthlyMvpListNode,
monthlyMvpTitleNode,
monthlyMvpNoteNode,
monthlyMvpSnapshotMetaNode,
);
hydrateMvpComparison(
latestMonthlyMvpResult,
latestMonthlyMvpV2Result,
comparisonStateNode,
comparisonListNode,
comparisonNoteNode,
);
}
const cachedMonthlyMvpV2Payload = readCachedPayload(
monthlyMvpV2Cache,
buildMonthlyMvpV2SnapshotKey(activeServerSlug),
);
if (cachedMonthlyMvpV2Payload) {
latestMonthlyMvpV2Result = { status: "fulfilled", value: cachedMonthlyMvpV2Payload };
hydrateMonthlyMvpV2(
{ status: "fulfilled", value: cachedMonthlyMvpV2Payload },
monthlyMvpV2StateNode,
monthlyMvpV2ListNode,
monthlyMvpV2TitleNode,
monthlyMvpV2NoteNode,
monthlyMvpV2SnapshotMetaNode,
);
hydrateMvpComparison(
latestMonthlyMvpResult,
latestMonthlyMvpV2Result,
comparisonStateNode,
comparisonListNode,
comparisonNoteNode,
);
}
const cachedEloMmrPayload = readCachedPayload(
eloMmrCache,
buildEloMmrSnapshotKey(activeServerSlug),
);
if (cachedEloMmrPayload) {
hydrateEloMmr(
{ status: "fulfilled", value: cachedEloMmrPayload },
eloMmrStateNode,
eloMmrListNode,
eloMmrNoteNode,
eloMmrMetaNode,
);
}
const cachedLeaderboardPayload = readCachedPayload(
leaderboardCache,
buildLeaderboardSnapshotKey(
@@ -443,86 +303,6 @@ document.addEventListener("DOMContentLoaded", () => {
);
});
void settlePromise(getMonthlyMvpSnapshot(targetServerSlug)).then((monthlyMvpResult) => {
if (
!isActiveServerRequest(
requestId,
targetServerSlug,
targetTimeframe,
targetMetric,
)
) {
return;
}
latestMonthlyMvpResult = monthlyMvpResult;
hydrateMonthlyMvp(
monthlyMvpResult,
monthlyMvpStateNode,
monthlyMvpListNode,
monthlyMvpTitleNode,
monthlyMvpNoteNode,
monthlyMvpSnapshotMetaNode,
);
hydrateMvpComparison(
latestMonthlyMvpResult,
latestMonthlyMvpV2Result,
comparisonStateNode,
comparisonListNode,
comparisonNoteNode,
);
});
void settlePromise(getMonthlyMvpV2Snapshot(targetServerSlug)).then((monthlyMvpV2Result) => {
if (
!isActiveServerRequest(
requestId,
targetServerSlug,
targetTimeframe,
targetMetric,
)
) {
return;
}
latestMonthlyMvpV2Result = monthlyMvpV2Result;
hydrateMonthlyMvpV2(
monthlyMvpV2Result,
monthlyMvpV2StateNode,
monthlyMvpV2ListNode,
monthlyMvpV2TitleNode,
monthlyMvpV2NoteNode,
monthlyMvpV2SnapshotMetaNode,
);
hydrateMvpComparison(
latestMonthlyMvpResult,
latestMonthlyMvpV2Result,
comparisonStateNode,
comparisonListNode,
comparisonNoteNode,
);
});
void settlePromise(getEloMmrLeaderboard(targetServerSlug)).then((eloMmrResult) => {
if (
!isActiveServerRequest(
requestId,
targetServerSlug,
targetTimeframe,
targetMetric,
)
) {
return;
}
hydrateEloMmr(
eloMmrResult,
eloMmrStateNode,
eloMmrListNode,
eloMmrNoteNode,
eloMmrMetaNode,
);
});
};
const refreshLeaderboardContent = async () => {

View File

@@ -66,14 +66,6 @@
>
Comunidad Hispana #02
</button>
<button
class="historical-selector__button"
type="button"
data-server-slug="comunidad-hispana-03"
>
Comunidad Hispana #03
</button>
</div>
</div>
</div>
@@ -107,87 +99,6 @@
</div>
</section>
<section class="panel historical-panel" aria-labelledby="monthly-mvp-title">
<div class="panel__shell">
<div class="panel__header historical-panel__header">
<div>
<p class="eyebrow eyebrow--section">MVP mensual V1</p>
<h2 id="monthly-mvp-title">Top 3 V1 del alcance activo</h2>
<p class="historical-panel__note" id="monthly-mvp-note">
Cargando baseline del MVP mensual V1...
</p>
<p class="historical-snapshot-meta" id="monthly-mvp-snapshot-meta">
Cargando snapshot del MVP mensual V1...
</p>
</div>
</div>
<p class="historical-state" id="monthly-mvp-state" aria-live="polite">
Cargando Top 3 MVP mensual V1...
</p>
<div class="historical-mvp-grid" id="monthly-mvp-list"></div>
</div>
</section>
<section class="panel historical-panel" aria-labelledby="monthly-mvp-v2-title">
<div class="panel__shell">
<div class="panel__header historical-panel__header">
<div>
<p class="eyebrow eyebrow--section">MVP mensual V2</p>
<h2 id="monthly-mvp-v2-title">Top 3 V2 del alcance activo</h2>
<p class="historical-panel__note" id="monthly-mvp-v2-note">
Cargando lectura avanzada del MVP mensual V2...
</p>
<p class="historical-snapshot-meta" id="monthly-mvp-v2-snapshot-meta">
Cargando snapshot del MVP mensual V2...
</p>
</div>
</div>
<p class="historical-state" id="monthly-mvp-v2-state" aria-live="polite">
Cargando Top 3 MVP mensual V2...
</p>
<div class="historical-mvp-grid" id="monthly-mvp-v2-list"></div>
</div>
</section>
<section class="panel historical-panel" aria-labelledby="mvp-comparison-title">
<div class="panel__shell">
<div class="panel__header historical-panel__header">
<div>
<p class="eyebrow eyebrow--section">Comparativa V1 vs V2</p>
<h2 id="mvp-comparison-title">Lectura de validacion del alcance activo</h2>
<p class="historical-panel__note" id="mvp-comparison-note">
Cargando comparativa entre los rankings mensuales V1 y V2...
</p>
</div>
</div>
<p class="historical-state" id="mvp-comparison-state" aria-live="polite">
Preparando comparativa V1 vs V2...
</p>
<div class="historical-comparison-grid" id="mvp-comparison-list"></div>
</div>
</section>
<section class="panel historical-panel" aria-labelledby="elo-mmr-title">
<div class="panel__shell">
<div class="panel__header historical-panel__header">
<div>
<p class="eyebrow eyebrow--section">Elo/MMR mensual</p>
<h2 id="elo-mmr-title">Rating persistente y ranking mensual del alcance activo</h2>
<p class="historical-panel__note" id="elo-mmr-note">
Cargando sistema mensual de rating...
</p>
<p class="historical-snapshot-meta" id="elo-mmr-meta">
Cargando metadata de Elo/MMR...
</p>
</div>
</div>
<p class="historical-state" id="elo-mmr-state" aria-live="polite">
Cargando leaderboard Elo/MMR...
</p>
<div class="historical-elo-grid" id="elo-mmr-list"></div>
</div>
</section>
<section class="panel historical-panel" aria-labelledby="weekly-ranking-title">
<div class="panel__shell">
<div class="panel__header historical-panel__header">