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

Fix node library bookmark preview #626

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading