mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-09 20:39:25 -03:00
feat(ui): merge user tags into auto-tag badges and refresh on tag edit (#918)
- Layer 2 fallback: user tags overlapping with auto-tag categories (HIGH/LOW/I2V/T2V/TI2V/Lightning/Turbo) are merged into auto_tags, providing manual override when filename-based detection fails. Matching is case-insensitive so "high"/"High"/"HIGH" all work. - Refresh on tag edit: save_metadata and add_tags handlers now return recalculated auto_tags in the response; the frontend passes them to VirtualScroller.updateSingleItem so badges update immediately without requiring a page reload. - 8 new test cases for Layer 2 fallback and case-insensitive matching.
This commit is contained in:
@@ -422,8 +422,12 @@ export class BaseModelApiClient {
|
||||
throw new Error('Failed to save metadata');
|
||||
}
|
||||
|
||||
state.virtualScroller.updateSingleItem(filePath, data);
|
||||
return response.json();
|
||||
const result = await response.json();
|
||||
state.virtualScroller.updateSingleItem(filePath, {
|
||||
...data,
|
||||
auto_tags: result.auto_tags,
|
||||
});
|
||||
return result;
|
||||
} finally {
|
||||
state.loadingManager.hide();
|
||||
}
|
||||
@@ -448,7 +452,10 @@ export class BaseModelApiClient {
|
||||
const result = await response.json();
|
||||
|
||||
if (result.success && result.tags) {
|
||||
state.virtualScroller.updateSingleItem(filePath, { tags: result.tags });
|
||||
state.virtualScroller.updateSingleItem(filePath, {
|
||||
tags: result.tags,
|
||||
auto_tags: result.auto_tags,
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user