From fc5e81006bb7e84fe48d6442c3a579694e62340a Mon Sep 17 00:00:00 2001 From: dlawler489 <104159223@student.swin.edu.au> Date: Wed, 16 Sep 2026 13:55:41 +1000 Subject: [PATCH] Show a watch's failure on its row, not in an alert() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A failed "Get files" popped a browser alert: jarring, and the message is gone the moment you dismiss it — which matters here, because the message explains MakerWorld's download limit. It now appears on the watch's row until the next attempt. Co-Authored-By: Claude Opus 5 --- public/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index 569e9fe..fba20d0 100644 --- a/public/app.js +++ b/public/app.js @@ -2178,6 +2178,10 @@ function watchPanelHtml() { const WATCH_STATUS = { ok: 'Up to date', checking: 'Checking…', error: 'Problem' }; +// What went wrong with the last thing you asked a watch to do, shown on its row +// until the next attempt. Beats an alert() you can't read once it's dismissed. +const watchNotices = new Map(); + function watchHtml(w) { const when = w.last_checked_at ? `checked ${formatDate(w.last_checked_at)}` : 'not checked yet'; const listed = w.total != null && w.listed != null && w.listed < w.total @@ -2199,6 +2203,7 @@ function watchHtml(w) {
${escapeHtml(when)} · every ${w.interval_hours}h · ${plural(w.imported_count, 'model')} imported${w.partial_count ? ` · ${w.partial_count} still without files` : ''}${w.error_count ? ` · ${w.error_count} failed` : ''}${listed}
${w.last_error ? `
${escapeHtml(w.last_error)} ${w.last_error_reason === 'makerworld_token' ? '' : ''}
` : ''} + ${watchNotices.has(w.id) ? `
${escapeHtml(watchNotices.get(w.id))}
` : ''} ${recent.length ? `
${recent.map((i) => ` ${i.model_id ? `` @@ -2288,6 +2293,7 @@ async function handleWatchAction(btn) { const id = Number(btn.closest('[data-watch-id]').dataset.watchId); const action = btn.dataset.watch; btn.disabled = true; + watchNotices.delete(id); // this attempt replaces whatever the last one said try { if (action === 'check') { await postJson(`/api/watches/${id}/check`); @@ -2309,7 +2315,7 @@ async function handleWatchAction(btn) { if (err.message && /token/i.test(err.message)) { promptMakerworldToken(err.message, () => retryWatchCheck(id), 'Save & check collection'); } else { - alert(err.message); + watchNotices.set(id, err.message); } } refreshWatches();