From 3626795e03539f5f062aaca53e2a52880b515ceb Mon Sep 17 00:00:00 2001 From: Chris Amow Date: Thu, 27 Aug 2026 02:26:02 -0500 Subject: [PATCH] Say why Duplicate did nothing. It aborted on unresolved geometry, a failed 10-bar shift, or HTTP error with only a console.error. --- static/app.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/static/app.js b/static/app.js index b4b6d41..c68a865 100644 --- a/static/app.js +++ b/static/app.js @@ -1104,11 +1104,17 @@ createApp({ } async function duplicateLine(line) { - if (line.geometry_resolved === false) return; + if (line.geometry_resolved === false) { + addEvent(`DUPLICATE #${line.number} FAILED · no source geometry`, 'error'); + return; + } const anchorT = shiftTimeByBars(line, line.anchor_t); const endT = shiftTimeByBars(line, line.last_t); const cutoffT = line.cutoff_t == null ? null : shiftTimeByBars(line, line.cutoff_t); - if (anchorT == null || endT == null || (line.cutoff_t != null && cutoffT == null)) return; + if (anchorT == null || endT == null || (line.cutoff_t != null && cutoffT == null)) { + addEvent(`DUPLICATE #${line.number} FAILED · cannot shift 10 bars`, 'error'); + return; + } const endP = line.anchor_p + line.slope * (line.last_t - line.anchor_t); const response = await apiFetch('/api/lines', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -1123,7 +1129,7 @@ createApp({ }), }); if (!response.ok) { - console.error(`Unable to duplicate line: HTTP ${response.status}`); + addEvent(`DUPLICATE #${line.number} FAILED · HTTP ${response.status}`, 'error'); return; } const saved = await response.json();