← back to AbramsEgo

build-queue/done/15-kamlist-grid-controls.md

28 lines

# AbramsEgo task 15 — Kamatera fleet list: kill the silent 40/226 cap (grid controls)

Read SPEC.md. Steve HARD rule (and task 06b's own criterion): any list that can exceed ~40 rows
gets a sort `<select>` + density slider (localStorage-persisted) + infinite scroll. The Kamatera
fleet panel violates it: `public/index.html:340` renders `(k.procs||[]).slice(0,40)` — 40 of the
**226** live procs, silently dropped, no controls, no "more" indicator. The API already returns
all 226 (`/api/data` → `kamatera.procs`), so this is a front-end-only fix.

Reuse the existing `initGrid()`/`feedGrid()` machinery (`public/index.html:244–280`) exactly like
the canaries panel (`renderCanaries`, ~line 541):

1. In the Fleet · Kamatera card markup (~line 139–143), add `<div id="kam-ctl"></div>` above
   `#kam-list`.
2. Replace the line-340 `$('kam-list').innerHTML=…slice(0,40)…` with a `renderKamFleet(k)` that
   calls `initGrid('kamfleet', {controlsHost:$('kam-ctl'), host:$('kam-list'), batch:25,
   minCols:1, maxCols:3, defaultCols:1, …})` + `feedGrid('kamfleet', k.procs||[])`.
   Sort modes: Newest (startedAt desc, default), Oldest, Name A→Z, Restarts ↓ (b.restarts-a.restarts),
   Status (offline first). Row render = the same `lrow(statusDot+name, restarts↺, whenChip(startedAt))`
   already used — keep the 🕓 chip.
3. Keep the `k.note` fallback for when Kamatera is unreachable (empty: pass `cfg.empty` = the note
   or 'kamatera unreachable').
4. Leave the Local fleet list (2 procs) as-is — it can't exceed 40.

Verify: `pm2 restart abramsego`, then load http://127.0.0.1:9773/ (admin:DW2024!) — Kamatera card
shows sort+density controls and scrolling loads past 40 rows ("… N more · scroll to load" sentinel).
Commit: `git add -A && git commit -m "fix: Kamatera fleet list — sort+density+infinite scroll, no silent 40-row cap" --author="Steve <steve@designerwallcoverings.com>"`
Local only, no deploy. Do not restyle other panels.