fix(frontend): preserve URN download panel container

This commit is contained in:
Dariusz L
2026-08-04 19:40:49 +02:00
parent 058832073d
commit b8d7bac497
2 changed files with 10 additions and 3 deletions
@@ -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')})`);
@@ -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) {