mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 14:42:11 -03:00
feat: add model type context to tag suggestions
- Pass modelType parameter to setupTagEditMode function - Implement model type aware priority tag suggestions - Add model type normalization and resolution logic - Handle suggestion state reset when model type changes - Maintain backward compatibility with existing functionality The changes enable context-aware tag suggestions based on model type, improving tag relevance and user experience when editing tags for different model types.
This commit is contained in:
@@ -66,7 +66,11 @@ export class BulkManager {
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
getPriorityTagSuggestions().then((tags) => {
|
||||
const currentType = state.currentPageType;
|
||||
if (!currentType || currentType === 'recipes') {
|
||||
return;
|
||||
}
|
||||
getPriorityTagSuggestions(currentType).then((tags) => {
|
||||
if (!container.isConnected) {
|
||||
return;
|
||||
}
|
||||
@@ -619,17 +623,22 @@ export class BulkManager {
|
||||
container.className = 'metadata-suggestions-container';
|
||||
container.innerHTML = `<div class="metadata-suggestions-loading">${translate('settings.priorityTags.loadingSuggestions', 'Loading suggestions…')}</div>`;
|
||||
|
||||
getPriorityTagSuggestions().then((tags) => {
|
||||
if (!container.isConnected) {
|
||||
return;
|
||||
}
|
||||
this.renderBulkSuggestionItems(container, tags);
|
||||
this.updateBulkSuggestionsDropdown();
|
||||
}).catch(() => {
|
||||
if (container.isConnected) {
|
||||
container.innerHTML = '';
|
||||
}
|
||||
});
|
||||
const currentType = state.currentPageType;
|
||||
if (!currentType || currentType === 'recipes') {
|
||||
container.innerHTML = '';
|
||||
} else {
|
||||
getPriorityTagSuggestions(currentType).then((tags) => {
|
||||
if (!container.isConnected) {
|
||||
return;
|
||||
}
|
||||
this.renderBulkSuggestionItems(container, tags);
|
||||
this.updateBulkSuggestionsDropdown();
|
||||
}).catch(() => {
|
||||
if (container.isConnected) {
|
||||
container.innerHTML = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
dropdown.appendChild(container);
|
||||
return dropdown;
|
||||
|
||||
Reference in New Issue
Block a user