Skip to content

Commit

Permalink
Fix node library bookmark preview
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Aug 25, 2024
1 parent 7a7188a commit 50c70bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions browser_tests/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ test.describe('Menu', () => {
)
// Verify the bookmark node with the same name is added to the tree.
expect(await tab.getNode('KSampler (Advanced)').count()).toBe(2)

// Hover on the bookmark node to display the preview
await comfyPage.page.hover('.node-tree-leaf.bookmark')
expect(await comfyPage.page.isVisible('.node-lib-node-preview')).toBe(
true
)
})

test('Ignores unrecognized node', async ({ comfyPage }) => {
Expand Down
5 changes: 1 addition & 4 deletions src/components/sidebar/tabs/NodeLibrarySidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
:pt="{
nodeLabel: 'node-lib-tree-node-label',
nodeContent: ({ props }) => ({
onClick: (e: MouseEvent) => onNodeContentClick(e, props.node)
}),
nodeChildren: ({ props }) => ({
'data-comfy-node-name': props.node?.data?.name,
onClick: (e: MouseEvent) => onNodeContentClick(e, props.node),
onMouseenter: (event: MouseEvent) =>
handleNodeHover(event, props.node?.data?.name),
onMouseleave: () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="node-tree-leaf" ref="container">
<div :class="['node-tree-leaf', { bookmark: isBookmarked }]" ref="container">
<div class="node-content">
<Tag
v-if="node.experimental"
Expand Down

0 comments on commit 50c70bc

Please sign in to comment.