Holding-tank readiness on the tank cards (Marty 2026-11-18, warm-up stage 1, no email)

Each waiting lead on the Holding tank card (/tools) and Admin > Members tank card shows how they got into the tank, a stage chip (New / Warming / Engaged / Activated / Ready, real actions only), the network heat 0-100 with its band, and their last real action, from the network hub (POST /v1/tank/readiness). tankready.js is the same module as InstantAdPay's (entry facts from this site's adoption records, follow records and join data; usernames only). Hottest first inside the usual grace / ready-to-activate groups, a "Warm or hot only" toggle. Hub down = the card as before. No mail, no Telegram, no sponsor moves; adoption rules and caps untouched. qa/tank-readiness.test.mjs in member + tankhold; tankready.js / my.js / admin.js ?v=20261118rd, site.css ?v=ls20261118rd. qa member ALL PASSED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-18 19:08:51 -06:00
parent 4d22ae72c8
commit 7edc1a25b0
10 changed files with 306 additions and 10 deletions
+11 -3
View File
@@ -1274,6 +1274,7 @@
}
// ── holding tank: waiting members, adopt, my open adoptions ──
const ago = ts => { if (!ts) return 'never'; const d = Math.floor((Date.now() - ts) / 86400000); return d === 0 ? 'today' : d === 1 ? 'yesterday' : d + ' days ago'; };
let TANK_WARM_ONLY = false; // the "Warm or hot only" toggle on the holding tank (2026-11-18)
async function loadTank() {
const el = $('tankList'); if (!el) return;
try {
@@ -1293,10 +1294,17 @@
const opens = w => w.opensAt > Date.now(); // new sign-up: they have 24 hours to say who invited them
const opensBadge = w => ' <span class="badge amber" title="New member. They have 24 hours from sign-up to tell us who invited them. You can adopt them after that.">Opens in ' + holdLeft(w.opensAt - Date.now()) + '</span>';
const readyBadge = w => w.ready ? ' <span class="badge" style="background:var(--ok-soft);border-color:var(--ok);color:var(--ok)" title="Wallet linked. If nobody adopts them, the site assigns them to the next eligible adopter when the time runs out.">Ready to activate \u00b7 ' + (w.holdUntil > Date.now() ? holdLeft(w.holdUntil - Date.now()) + ' left' : 'assigning now') + '</span>' : '';
el.innerHTML = r.waiting.slice().sort((a, b) => (opens(a) ? 1 : 0) - (opens(b) ? 1 : 0) || (b.ready ? 1 : 0) - (a.ready ? 1 : 0)).map(w => '<div class="lin-row"><span class="nm">' + esc(w.name) + (opens(w) ? opensBadge(w) : readyBadge(w)) + '</span>'
+ '<span class="em">joined ' + ago(w.joined) + '</span>'
// readiness (2026-11-18, network hub): hottest first inside the usual groups, a "Warm or hot" toggle, and under each lead its stage,
// heat, last action and how they got here; the hub down = the list exactly as before
const RD = window.TankReady; const rdOn = !!(RD && r.waiting.some(w => w.rd));
const heatOrder = (a, b) => (rdOn ? RD.score(b) - RD.score(a) : 0);
const list = r.waiting.filter(w => !(rdOn && TANK_WARM_ONLY) || (w.rd && w.rd.heat && w.rd.heat.score >= 40));
const bar = rdOn ? '<div class="rd-bar"><span class="small muted">Hottest first</span> <button type="button" class="btn sec small' + (TANK_WARM_ONLY ? ' on' : '') + '" id="tankWarmOnly" aria-pressed="' + (TANK_WARM_ONLY ? 'true' : 'false') + '">' + (TANK_WARM_ONLY ? 'Showing warm or hot only' : 'Warm or hot only') + '</button> <span class="small muted">' + list.length + ' of ' + r.waiting.length + '</span></div>' : '';
el.innerHTML = bar + (list.length ? list.slice().sort((a, b) => (opens(a) ? 1 : 0) - (opens(b) ? 1 : 0) || (b.ready ? 1 : 0) - (a.ready ? 1 : 0) || heatOrder(a, b)).map(w => '<div class="lin-row' + (w.rd ? ' rd-row' : '') + '"><span class="nm">' + esc(w.name) + (opens(w) ? opensBadge(w) : readyBadge(w)) + '</span>'
+ '<span class="em">joined ' + ago(w.joined) + (w.rd && RD ? RD.html(w.rd) : '') + '</span>'
+ '<span class="dt">last sign-in: <b>' + ago(w.lastSeen) + '</b></span>'
+ (r.eligible && !opens(w) ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('');
+ (r.eligible && !opens(w) ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('') : '<p class="muted small">Nobody warm or hot is waiting right now. Switch the filter off to see everyone.</p>');
{ const t = $('tankWarmOnly'); if (t) t.addEventListener('click', () => { TANK_WARM_ONLY = !TANK_WARM_ONLY; loadTank(); }); }
el.querySelectorAll('[data-adopt]').forEach(b => b.addEventListener('click', async () => {
const note = await IAP.ask({ title: 'Adopt ' + b.dataset.aname, text: 'Your first message to ' + b.dataset.aname + ' (sent as a chat and an email):', type: 'textarea', ok: 'Adopt and send', value: 'Hi, I picked you up from the LinkSpin holding tank so you have a sponsor who will actually help. Reply here and I will walk you through the first three steps.' });
if (note === null) return;