From d533cda5e83d82513d365da69a06be24a8c3a44c Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Tue, 16 Jun 2026 19:19:45 +0200 Subject: [PATCH] fix: preserve model_url fallback and add search download button icons with tooltips --- README.md | 6 +-- web/css/resolver-main.css | 3 +- .../actions/resolve_download_methods.js | 46 ++++++++++++++++--- web/resolver/search/search_panel.js | 5 +- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d78cff4..5130e21 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ > **WIP (Work in Progress) — Download and use at your own risk!** > This project is still under active development and some features may be unfinished or contain bugs. -

ComfyUI - License - + License + + Python 3.10+ JavaScript

diff --git a/web/css/resolver-main.css b/web/css/resolver-main.css index 6647a6f..4a6d5fe 100644 --- a/web/css/resolver-main.css +++ b/web/css/resolver-main.css @@ -2060,7 +2060,8 @@ justify-content: flex-end; gap: 8px; min-height: 24px; - min-width: 96px; + min-width: 0; + width: 100%; } #model-resolver-modal .mr-search-result-action-btn { display: inline-flex; diff --git a/web/resolver/actions/resolve_download_methods.js b/web/resolver/actions/resolve_download_methods.js index 1fdf252..7332bba 100644 --- a/web/resolver/actions/resolve_download_methods.js +++ b/web/resolver/actions/resolve_download_methods.js @@ -296,13 +296,14 @@ export const resolveDownloadMethods = { const result = candidate.result; const url = result?.[candidate.urlKey]; if (!url) continue; + const rawModelUrl = result.model_url || result.url || url; return { source: candidate.source, url, filename: result[candidate.filenameKey] || missing.civitai_info?.expected_filename || filename, directory: result[candidate.categoryKey] || result.directory || result.category || missing.category || 'checkpoints', - model_url: result.url || result.model_url || this.getModelCardUrl(url), + model_url: this.getModelCardUrl(rawModelUrl) || rawModelUrl, name: result.name || result.repo_id || result.repo || result.filename || filename, size: result.size, type: result.type || missing.category @@ -696,15 +697,34 @@ export const resolveDownloadMethods = { const percent = Number(progress.progress); downloadBtn.disabled = true; downloadBtn.classList.remove('mr-is-success-action', 'mr-btn-primary'); - downloadBtn.textContent = Number.isFinite(percent) && percent > 0 ? `${Math.round(percent)}%` : 'Starting...'; + const label = Number.isFinite(percent) && percent > 0 ? `Downloading ${Math.round(percent)}%` : 'Starting download...'; + if (downloadBtn.classList.contains('search-download-btn')) { + downloadBtn.innerHTML = getSvgIcon('download'); + downloadBtn.setAttribute('data-tooltip', label); + downloadBtn.setAttribute('aria-label', label); + } else { + downloadBtn.textContent = Number.isFinite(percent) && percent > 0 ? `${Math.round(percent)}%` : 'Starting...'; + } } else if (status === 'cancelling') { downloadBtn.disabled = true; downloadBtn.classList.remove('mr-is-success-action', 'mr-btn-primary'); - downloadBtn.textContent = 'Cancelling...'; + if (downloadBtn.classList.contains('search-download-btn')) { + downloadBtn.innerHTML = getSvgIcon('download'); + downloadBtn.setAttribute('data-tooltip', 'Cancelling download...'); + downloadBtn.setAttribute('aria-label', 'Cancelling download'); + } else { + downloadBtn.textContent = 'Cancelling...'; + } } else if (status === 'error' || status === 'refresh_error') { downloadBtn.disabled = false; downloadBtn.classList.remove('mr-is-success-action', 'mr-btn-primary'); - downloadBtn.textContent = 'Retry'; + if (downloadBtn.classList.contains('search-download-btn')) { + downloadBtn.innerHTML = getSvgIcon('download'); + downloadBtn.setAttribute('data-tooltip', 'Retry download'); + downloadBtn.setAttribute('aria-label', 'Retry download'); + } else { + downloadBtn.textContent = 'Retry'; + } } else { this.restoreDownloadButtonReadyState(downloadBtn); } @@ -1151,6 +1171,8 @@ export const resolveDownloadMethods = { downloadBtn.classList.remove('mr-is-success-action', 'mr-btn-primary'); if (downloadBtn.classList.contains('search-download-btn')) { downloadBtn.innerHTML = getSvgIcon('download'); + downloadBtn.setAttribute('data-tooltip', 'Download'); + downloadBtn.setAttribute('aria-label', 'Download'); return; } downloadBtn.innerHTML = '☁ Download'; @@ -1976,7 +1998,13 @@ export const resolveDownloadMethods = { btn.disabled = true; btn.classList.remove('mr-is-success-action', 'mr-btn-primary'); - btn.textContent = 'Starting...'; + if (btn.classList.contains('search-download-btn')) { + btn.innerHTML = getSvgIcon('download'); + btn.setAttribute('data-tooltip', 'Starting download...'); + btn.setAttribute('aria-label', 'Starting download'); + } else { + btn.textContent = 'Starting...'; + } if (progressDiv) { progressDiv.classList.remove('mr-is-hidden'); @@ -2069,7 +2097,13 @@ export const resolveDownloadMethods = { } btn.disabled = false; btn.classList.remove('mr-is-success-action', 'mr-btn-primary'); - btn.textContent = 'Retry'; + if (btn.classList.contains('search-download-btn')) { + btn.innerHTML = getSvgIcon('download'); + btn.setAttribute('data-tooltip', 'Retry download'); + btn.setAttribute('aria-label', 'Retry download'); + } else { + btn.textContent = 'Retry'; + } this.updateQueuePanel?.(); this.showNotification('Download failed: ' + error.message, 'error'); } diff --git a/web/resolver/search/search_panel.js b/web/resolver/search/search_panel.js index c84b499..178e2ba 100644 --- a/web/resolver/search/search_panel.js +++ b/web/resolver/search/search_panel.js @@ -1104,9 +1104,10 @@ export const searchPanelMethods = { const sourceSecondary = isFromWorkflow && sourceLabels[source] && source !== 'workflow' ? sourceLabels[source] : ''; - const modelUrl = downloadSource.model_url + const rawModelUrl = downloadSource.model_url || downloadSource.workflow_model_url - || this.getModelCardUrl(downloadSource.url); + || downloadSource.url; + const modelUrl = this.getModelCardUrl(rawModelUrl) || rawModelUrl; const versionName = downloadSource.version_name || missing.civitai_info?.version_name || ''; const modelParts = this.getModelVersionParts( downloadSource.name || missing.civitai_info?.model_name || '',