Preserve resolver display mode when auto-opening for missing models

Add openResolverForDetectedMissingModels() in model_resolver.js to
keep the current resolver display state when missing models are
detected: if the resolver dialog is already visible, schedule an
active workflow refresh instead of re-activating the button; if it
is hidden, activate the resolver button as before.

Update the auto-open-on-missing path to use the new method, and
adjust/add tests to cover the preserved display mode behavior.
This commit is contained in:
Dariusz L
2026-07-19 15:28:47 +02:00
parent 0047514f7c
commit c1e7dcfa1c
2 changed files with 39 additions and 2 deletions
+10 -1
View File
@@ -1069,6 +1069,15 @@ export class ModelResolver {
return localStorage.getItem('ModelResolver.autoOpenOnMissing') === 'true';
}
openResolverForDetectedMissingModels() {
if (this.dialog?.isVisible?.()) {
this.dialog.scheduleActiveWorkflowRefresh?.('auto-open-missing-models');
return;
}
this.activateResolverButton();
}
/**
* Check for missing models and auto-open dialog if any are found
@@ -1121,7 +1130,7 @@ export class ModelResolver {
// Auto-open dialog if there are missing models
if (data.total_missing > 0) {
log.debug(`Model Resolver: Found ${data.total_missing} missing model(s), opening dialog...`);
this.openResolverManager();
this.openResolverForDetectedMissingModels();
}
} catch (error) {