mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-12 03:07:52 -03:00
feat(bulk): reorganize context menu with sections and submenu for workflow actions
Group 15 flat menu items into 5 logical sections (Workflow, Metadata, Attributes, Organize, Download) with section headers to reduce cognitive load. Nest the three workflow-related actions (Append, Replace, Copy Syntax) into a single "Send to Workflow" hover-triggered submenu. Add submenu infrastructure to BaseContextMenu with mouseover/mouseout boundary detection, 250ms close delay, and viewport-aware positioning. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,14 @@ export class BulkContextMenu extends BaseContextMenu {
|
||||
if (copyAllItem) {
|
||||
copyAllItem.style.display = config.copyAll ? 'flex' : 'none';
|
||||
}
|
||||
|
||||
// Submenu parent visibility
|
||||
const sendToWorkflowSubmenu = this.menu.querySelector('[data-has-submenu="send-to-workflow"]');
|
||||
if (sendToWorkflowSubmenu) {
|
||||
const hasWorkflowActions = config.sendToWorkflow || config.copyAll;
|
||||
sendToWorkflowSubmenu.style.display = hasWorkflowActions ? 'flex' : 'none';
|
||||
}
|
||||
|
||||
if (refreshAllItem) {
|
||||
refreshAllItem.style.display = config.refreshAll ? 'flex' : 'none';
|
||||
}
|
||||
@@ -148,6 +156,14 @@ export class BulkContextMenu extends BaseContextMenu {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Hide empty sections
|
||||
this.menu.querySelectorAll('.context-menu-section').forEach(section => {
|
||||
const items = Array.from(section.querySelectorAll('.context-menu-item'))
|
||||
.filter(item => !item.closest('.context-submenu'));
|
||||
const allHidden = items.length > 0 && items.every(item => item.style.display === 'none');
|
||||
section.style.display = allHidden ? 'none' : '';
|
||||
});
|
||||
}
|
||||
|
||||
updateSelectedCountHeader() {
|
||||
|
||||
Reference in New Issue
Block a user