diff --git a/tests/test_downloads_tab_workflow_route.mjs b/tests/test_downloads_tab_workflow_route.mjs index 03afc45..fb49992 100644 --- a/tests/test_downloads_tab_workflow_route.mjs +++ b/tests/test_downloads_tab_workflow_route.mjs @@ -5205,6 +5205,14 @@ test('local match refreshes preserve keyed rows and button handlers', () => { assert.doesNotMatch(wireLocalMatchButtons, /addEventListener\('click'/); }); +test('URN resolution preserves the download panel container', () => { + const resolveUrnAsync = extractMethod(resolveDownloadMethodsSource, 'resolveUrnAsync'); + + assert.doesNotMatch(resolveUrnAsync, /downloadEl\.outerHTML\s*=/); + assert.match(resolveUrnAsync, /downloadEl\.innerHTML\s*=\s*this\.renderKnownDownloadPanel/); + assert.match(resolveUrnAsync, /wireDownloadSearchPanel\(downloadEl, missing\)/); +}); + test('local match status group warns when match folder is unsupported by node', () => { const renderLocalMatchStatus = eval(`(${extractMethod(searchPanelMethodsSource, 'renderLocalMatchStatus')})`); const getLocalMatchCategory = eval(`(${extractMethod(searchPanelMethodsSource, 'getLocalMatchCategory')})`); diff --git a/web/resolver/actions/resolve_download_methods.js b/web/resolver/actions/resolve_download_methods.js index dd3002a..1ea5b04 100644 --- a/web/resolver/actions/resolve_download_methods.js +++ b/web/resolver/actions/resolve_download_methods.js @@ -2873,9 +2873,8 @@ export const resolveDownloadMethods = { if (missing) { this.applyCivitaiUrnResult(missing, data.civitai); this.refreshSearchBaseModelLabels?.(); - const downloadParent = downloadEl.parentElement; - downloadEl.outerHTML = this.renderKnownDownloadPanel(missing, missing.download_source); - this.wireDownloadSearchPanel(downloadParent || this.contentElement, missing); + downloadEl.innerHTML = this.renderKnownDownloadPanel(missing, missing.download_source); + this.wireDownloadSearchPanel(downloadEl, missing); this.refreshUrnLocalMatches(missing); } } else if (downloadEl) {