From d4b0e748290e45255fcec1a82a57d2dc2b3d7091 Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 8 Oct 2026 13:40:31 -0500 Subject: [PATCH] Archived card shows what each campaign actually returned (Yoshi: 'credits released' read as a refund on 7 fully delivered campaigns) Co-Authored-By: Claude Fable 5.1 --- public/assets/my.js | 10 +++++++--- public/my.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/assets/my.js b/public/assets/my.js index e1fbb28..64b6a7d 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -978,16 +978,20 @@ const box = document.createElement('div'); box.className = 'card'; box.style.marginTop = '18px'; - box.innerHTML = '

Archived

' + rows.length + ' finished campaign' + (rows.length === 1 ? '' : 's') + ' · credits released
' - + '
' + // what each one gave back = budget not delivered (flat packs are charged in full when bought, so theirs is 0) + const leftOf = c => Math.max(0, Number(c.budget || 0) - Number(c.spent || 0) - Number(c.accrued || 0)); + const returned = rows.reduce((n, c) => n + leftOf(c), 0); + box.innerHTML = '

Archived

' + rows.length + ' finished campaign' + (rows.length === 1 ? '' : 's') + ' · ' + returned.toLocaleString() + ' unspent credit' + (returned === 1 ? '' : 's') + ' returned
' + + '
NameTypeViews hereClicksSpentRan until
' + rows.map(c => '' + '' + '' + '' + + '' + '' + '').join('') + '
NameTypeViews hereClicksSpentReturnedRan until
' + esc(c.name || ('#' + c.id)) + '' + esc(c.type) + '' + Number(c.imps || 0).toLocaleString() + '' + Number(c.clicks || 0).toLocaleString() + '' + Number(c.spent || 0).toLocaleString() + '' + leftOf(c).toLocaleString() + '' + (c.created ? new Date(c.created).toLocaleDateString() : '') + '
' - + '

Archived campaigns keep every number they earned. They serve nothing and reserve nothing, so their unspent credits are back in your Available balance. Restore brings one back, paused.

'; + + '

Archived campaigns keep every number they earned. They serve nothing and reserve nothing, so any budget they had not delivered is back in your Available balance (the Returned column). A campaign that delivered its whole budget has nothing left to return, and visit packs, Golden Door, login and featured runs are paid in full when bought. Restore brings one back, paused.

'; el.appendChild(box); box.querySelectorAll('[data-unarch]').forEach(b => b.addEventListener('click', async () => { b.disabled = true; diff --git a/public/my.html b/public/my.html index bf72773..ddd7066 100644 --- a/public/my.html +++ b/public/my.html @@ -1149,7 +1149,7 @@ - +