Simplify download progress UI rendering and fix queue DOM insertion

This commit is contained in:
Dariusz L
2026-08-03 16:54:00 +02:00
parent 5b8b243aee
commit 8d48e0dc37
4 changed files with 10 additions and 52 deletions
-34
View File
@@ -424,40 +424,6 @@
gap: var(--mr-spacing-8);
}
.mr-download-progress-item {
padding: var(--mr-spacing-8);
border: 1px solid var(--mr-border);
border-radius: var(--mr-radius-xl);
background: rgba(255, 255, 255, 0.025);
}
.mr-download-progress-item-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--mr-spacing-8);
margin-bottom: var(--mr-spacing-5);
color: var(--mr-text-muted);
font-size: var(--mr-font-sm);
font-weight: 700;
}
.mr-download-progress-item-head > span:first-child {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mr-download-progress-item-head > span:last-child {
flex: 0 0 auto;
color: var(--mr-text);
}
.mr-download-progress-item .mr-progress-container {
margin-top: 0;
}
.mr-civitai-open-btn {
background: transparent;
color: var(--mr-color-civitai);
+4
View File
@@ -682,6 +682,10 @@
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.mr-download-queue-items > .mr-download-queue-item:not(:last-child) {
margin-bottom: 0;
}
/* The Missing Models preview already provides the panel's horizontal padding. */
#model-resolver-modal .mr-missing-detail-pane .mr-download-progress-slot .mr-download-queue-item {
margin: 0;
+5 -2
View File
@@ -1053,8 +1053,11 @@ export const queueMethods = {
}
if (!currentChild) {
current.appendChild(nextChild.cloneNode(true));
cursor = null;
// Insert at the current position so the cleanup pass can
// remove an obsolete single-card/group root after a mode switch.
const insertedChild = nextChild.cloneNode(true);
current.insertBefore(insertedChild, cursor);
cursor = insertedChild.nextSibling;
continue;
}
@@ -1215,22 +1215,7 @@ export const resolveDownloadMethods = {
},
renderDownloadProgressGroupItem(downloadId, snapshot) {
const progress = snapshot.progress || {};
const status = snapshot.status || progress.status || '';
const displayProgress = this.getDownloadDisplayProgress(progress);
const percent = displayProgress.percent;
const filename = progress.filename || snapshot.filename || 'Download';
const statusLabel = this.getDownloadProgressStatusLabel(status, percent, displayProgress.isFinalizing);
const itemIdAttr = downloadId ? ` data-download-id="${this.escapeHtml(String(downloadId))}"` : '';
return `
<div class="mr-download-progress-item"${itemIdAttr}>
<div class="mr-download-progress-item-head">
<span data-tooltip="${this.escapeHtml(filename)}">${this.escapeHtml(filename)}</span>
<span>${this.escapeHtml(statusLabel)}</span>
</div>
${this.renderDownloadSnapshotMarkup(downloadId, snapshot)}
</div>
`;
return this.renderDownloadSnapshotMarkup(downloadId, snapshot);
},
patchDownloadProgressContent(progressDiv, html) {