feat(migration): show error detail under failed rows and summary hint

Failed/blocked rows now show the error message or first blocker in small
red text below the template name. On completion, if any templates failed
a count + "select View Results for details" hint appears above the footer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Huliganga 2026-04-21 14:53:50 -04:00
parent 5eee7e0ab4
commit 1c5b131f19
2 changed files with 34 additions and 2 deletions

View File

@ -118,6 +118,7 @@
.progress-template-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10px;
padding: 8px 12px;
background: var(--ecru);
@ -126,6 +127,16 @@
}
.progress-template-name { flex: 1; font-weight: 500; }
.progress-template-status { font-size: 16px; flex-shrink: 0; }
.progress-template-error {
flex-basis: 100%;
font-size: 11px;
color: var(--error, #c0392b);
margin-top: -4px;
padding-left: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* ── Project switcher modal ── */
.project-list {

View File

@ -166,11 +166,32 @@ async function _startMigration(ids, wrapper) {
else if (r.status === 'skipped') statusEl.textContent = '⏭';
else if (r.status === 'blocked') statusEl.textContent = '🚫';
else statusEl.textContent = '❌';
if (r.status === 'blocked' || r.status === 'error' || r.status === 'failed') {
const msg = r.error || (r.blockers||[])[0] || 'Migration failed';
let hint = row.querySelector('.progress-template-error');
if (!hint) {
hint = document.createElement('div');
hint.className = 'progress-template-error';
row.appendChild(hint);
}
hint.textContent = msg;
}
});
});
// Migration done — show "View Results" button
const allResults = (jobData.results || []);
const failCount = allResults.filter(r => r.status === 'blocked' || r.status === 'error' || r.status === 'failed').length;
document.getElementById('prog-label') && (document.getElementById('prog-label').textContent = 'Done!');
if (failCount > 0) {
const hint = document.createElement('div');
hint.style.cssText = 'font-size:12px;color:var(--text-muted);margin-top:10px;text-align:center';
hint.textContent = `${failCount} template${failCount > 1 ? 's' : ''} had issues — select View Results for details.`;
body.appendChild(hint);
}
footer.innerHTML = `
<button class="btn btn-secondary" id="mm-close-done">Close</button>
<button class="btn btn-primary" id="mm-view-results">View Results </button>