From f2e30c62aa63fd3a4c52ed049e15091678d01744 Mon Sep 17 00:00:00 2001 From: Samuel Enocsson Date: Mon, 25 May 2026 09:44:46 +0200 Subject: [PATCH] fix: zero excluded count in fallback, drop debug-icon orphan, align ejs guard (#21) --- public/css/players.css | 7 ------- src/services/rating-calculator.js | 1 + views/partials/player-history.ejs | 2 +- views/partials/ratings-cards.ejs | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/public/css/players.css b/public/css/players.css index 844d152..3dc2715 100644 --- a/public/css/players.css +++ b/public/css/players.css @@ -94,13 +94,6 @@ box-shadow: var(--shadow-lg); } -/* ── Debug Icon ───────────────────────────────── */ - -.debug-icon:hover { - opacity: 1 !important; - color: var(--accent) !important; -} - /* ── Add Player Modal ─────────────────────────── */ .modal { diff --git a/src/services/rating-calculator.js b/src/services/rating-calculator.js index ad7adcc..a30a9c1 100644 --- a/src/services/rating-calculator.js +++ b/src/services/rating-calculator.js @@ -191,6 +191,7 @@ function calculatePredictedRating(roundRatings) { debugLog.push(` ✅ Using ${filteredRatings.length} rounds after outlier removal`); } else { debugLog.push(` ⚠️ Too few rounds after outlier removal (${filteredRatings.length}), keeping all rounds`); + excludedRoundsCount = 0; } } else { debugLog.push(`⏭️ OUTLIER EXCLUSION SKIPPED (only ${workingRatings.length} rounds, need ≥7)`); diff --git a/views/partials/player-history.ejs b/views/partials/player-history.ejs index 42b6298..62e532b 100644 --- a/views/partials/player-history.ejs +++ b/views/partials/player-history.ejs @@ -36,7 +36,7 @@ const chartPdgaNumber = hasPlayer ? player.pdgaNumber : pdgaNumber;
<%= player.rating - player.stdDev %>–<%= player.rating + player.stdDev %>
<% } %> - <% if (player.excludedRoundsCount != null && player.rating != null) { %> + <% if (player.excludedRoundsCount != null && player.rating) { %>
Excluded rounds
<%= player.excludedRoundsCount %>
diff --git a/views/partials/ratings-cards.ejs b/views/partials/ratings-cards.ejs index 41d3f21..d46e2aa 100644 --- a/views/partials/ratings-cards.ejs +++ b/views/partials/ratings-cards.ejs @@ -124,7 +124,7 @@ function renderSparkline(values, opts) {
<%= player.rating - player.stdDev %>–<%= player.rating + player.stdDev %>
<% } %> - <% if (player.excludedRoundsCount != null && player.rating != null) { %> + <% if (player.excludedRoundsCount != null && player.rating) { %>
Excluded rounds
<%= player.excludedRoundsCount %>