From 81b100c0d3a11189392377f69aad8377f186ae1a Mon Sep 17 00:00:00 2001 From: Scout Date: Tue, 13 Oct 2026 00:00:23 -0500 Subject: [PATCH 1/2] Atlas search: rank suggestions by recency, not file order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The suggestion sort only ordered identical names and left everything else in index order — and the index is chronological, so a surname query filled all 8 slots with the oldest namesakes: 'Curry' showed Dell and Michael Curry seasons and never Stephen. Now: match tier (name/word-start before substring), then most recent season first, then name. Verified in a browser: 'Curry' now leads with Stephen Curry 2025-26; 'Dell' and 'Jordan' behave consistently; no page errors. --- assets/atlas-map.js | 14 +++++++++++++- index.html | 2 +- public/assets/atlas-map.js | 14 +++++++++++++- public/index.html | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/assets/atlas-map.js b/assets/atlas-map.js index 0defbf64..5c37e285 100644 --- a/assets/atlas-map.js +++ b/assets/atlas-map.js @@ -330,8 +330,20 @@ if (n.indexOf(q) === 0 || n.indexOf(' ' + q) > -1) starts.push(i); else if (n.indexOf(q) > -1) contains.push(i); } + // Rank: match tier first (name/word-start before substring), then + // MOST RECENT season first. The old comparator only ordered identical + // names and left everything else in file order — and the index is + // chronological, so a surname query filled the 8 slots with the + // OLDEST namesakes ("Curry" showed Dell and Michael, never Stephen). + var tier = {}; + starts.forEach(function (i) { tier[i] = 0; }); + contains.forEach(function (i) { tier[i] = 1; }); var all = starts.concat(contains); - all.sort(function (a, b) { return P[a].n === P[b].n ? (P[b].s > P[a].s ? 1 : -1) : 0; }); + all.sort(function (a, b) { + if (tier[a] !== tier[b]) return tier[a] - tier[b]; + if (P[a].s !== P[b].s) return P[b].s > P[a].s ? 1 : -1; + return P[a].n < P[b].n ? -1 : P[a].n > P[b].n ? 1 : 0; + }); results = all.slice(0, 8); active = results.length ? 0 : -1; render(); }); input.addEventListener('keydown', function (e) { diff --git a/index.html b/index.html index d439e771..0d3e7a82 100644 --- a/index.html +++ b/index.html @@ -359,7 +359,7 @@

Fresh from the lab · new - + - +