Fix tool wall ordering, and make suite-me use the one entitlement helper

Two bugs Marty spotted from a screenshot of his own wall.

1. The Traffic Desk rendered between L5 and L6 under a stray second
   "L1 SCINTILLA" header. The wall emits a section header whenever the level
   changes while walking the TOOLS array, and the Traffic Desk was still in
   its original L5 array slot from before it moved to L1. Now the wall sorts
   by level before rendering, so the array can be edited in any order and
   this class of bug cannot come back.

2. Tiles above L4 still showed "UNLOCKS AT ..." despite suiteLevelOverride.
   /api/public/suite-me carried its OWN copy of the org/allowlist logic
   rather than calling suiteEntitlement, so the override reached every tool
   page but not the wall linking to them. That duplication is the actual
   defect — the route now calls the shared helper, and the override also
   carries levelName so the header cannot disagree with the tiles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-28 11:18:08 -05:00
parent f05d5a2746
commit 7ca89f25ee
2 changed files with 17 additions and 29 deletions
+5 -1
View File
@@ -43,7 +43,11 @@
var grid = $('suGrid');
grid.innerHTML = '';
var lastLv = 0;
TOOLS.forEach(function (t) {
// Render in LEVEL order, not array order. The array is maintained by hand
// and a tile whose level changes (the Traffic Desk moved from L5 to L1)
// would otherwise emit a stray section header in the middle of the wall.
// Sorting here means the array can be edited in any order, forever.
TOOLS.slice().sort(function (a, b) { return a.lv - b.lv; }).forEach(function (t) {
if (t.lv !== lastLv) {
lastLv = t.lv;
var h = document.createElement('div');