+
🌅 Welcome back
You've been away. Some tasks are still here — and that's okay.
Keep what matters, release the rest.
diff --git a/site/static/app.js b/site/static/app.js
index be9a98f..210b3de 100644
--- a/site/static/app.js
+++ b/site/static/app.js
@@ -840,12 +840,13 @@
return (Date.now() - last) > SWEEP_THRESHOLD;
}
- function openSweep(items) {
+ function openSweep(items, isManual) {
var modal = $('#sweep-modal');
var list = $('#sweep-list');
var keepAll = $('#sweep-keep-all');
var relAll = $('#sweep-release-all');
var doneBtn = $('#sweep-done');
+ var closeBtn = $('#sweep-close');
if (!modal || !list) return;
list.innerHTML = '';
@@ -887,7 +888,7 @@
list.appendChild(li);
});
- keepAll.addEventListener('click', function () {
+ keepAll.onclick = function () {
items.forEach(function (_, i) {
if (decisions[i] !== 'release') {
decisions[i] = 'keep';
@@ -900,9 +901,9 @@
}
}
});
- });
+ };
- relAll.addEventListener('click', function () {
+ relAll.onclick = function () {
items.forEach(function (_, i) {
if (decisions[i] !== 'keep') {
decisions[i] = 'release';
@@ -913,9 +914,9 @@
}
}
});
- });
+ };
- doneBtn.addEventListener('click', function () {
+ doneBtn.onclick = function () {
// Rebuild inbox: keep items that were kept or undecided
var kept = [];
items.forEach(function (text, i) {
@@ -924,15 +925,21 @@
inboxItems = kept;
saveInbox();
modal.hidden = true;
- stampVisit();
- });
+ if (!isManual) stampVisit();
+ };
+
+ if (closeBtn) {
+ closeBtn.onclick = function () {
+ modal.hidden = true;
+ }
+ }
modal.hidden = false;
}
// Auto-trigger on page load if stale
if (sweepNeeded() && inboxItems.length > 0) {
- openSweep(inboxItems.slice());
+ openSweep(inboxItems.slice(), false);
} else {
stampVisit();
}
@@ -942,7 +949,7 @@
if ($inboxSweep) {
$inboxSweep.addEventListener('click', function () {
if (inboxItems.length === 0) return;
- openSweep(inboxItems.slice());
+ openSweep(inboxItems.slice(), true);
});
}