Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Major Refactor] Use TreeExplorer on nodeLibrarySidebarTab #699

Merged
merged 26 commits into from
Sep 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Context menu only for folder
  • Loading branch information
huchenlei committed Sep 1, 2024
commit 6e1befdedf9d9de1fca55a6e19b687f10c13bb74
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,34 @@ const updateCustomization = (icon: string, color: string) => {
}

const extraMenuItems = computed(
() => (menuTargetNode: RenderedTreeExplorerNode<ComfyNodeDefImpl>) => [
{
label: t('newFolder'),
icon: 'pi pi-folder-plus',
command: () => {
if (menuTargetNode.data) {
addNewBookmarkFolder(menuTargetNode.data)
}
}
},
{
label: t('customize'),
icon: 'pi pi-palette',
command: () => {
const customization =
nodeBookmarkStore.bookmarksCustomization[menuTargetNode.data.nodePath]
initialIcon.value =
customization?.icon || nodeBookmarkStore.defaultBookmarkIcon
initialColor.value =
customization?.color || nodeBookmarkStore.defaultBookmarkColor
() => (menuTargetNode: RenderedTreeExplorerNode<ComfyNodeDefImpl>) =>
menuTargetNode?.leaf
? []
: [
{
label: t('newFolder'),
icon: 'pi pi-folder-plus',
command: () => {
addNewBookmarkFolder(menuTargetNode.data)
}
},
{
label: t('customize'),
icon: 'pi pi-palette',
command: () => {
const customization =
nodeBookmarkStore.bookmarksCustomization[
menuTargetNode.data.nodePath
]
initialIcon.value =
customization?.icon || nodeBookmarkStore.defaultBookmarkIcon
initialColor.value =
customization?.color || nodeBookmarkStore.defaultBookmarkColor

showCustomizationDialog.value = true
customizationTargetNodePath.value = menuTargetNode.data.nodePath
}
}
]
showCustomizationDialog.value = true
customizationTargetNodePath.value = menuTargetNode.data.nodePath
}
}
]
)
</script>