Skip to content

Commit b27c741

Browse files
authored
Feat/vue nodes try it now banner (#6362)
## Summary Banner to try vue nodes. Clicking try it now will flip shouldRenderVueNodes = true. ## Screenshots (if applicable) <img width="1512" height="824" alt="image" src="https://github.com/user-attachments/assets/dfd4bdc3-6753-45ee-86f1-ed7dc077f868" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6362-Feat-vue-nodes-try-it-now-banner-29b6d73d365081c29f04f9126f06ee9d) by [Unito](https://www.unito.io)
1 parent ca5729a commit b27c741

File tree

5 files changed

+82
-2
lines changed

5 files changed

+82
-2
lines changed

browser_tests/fixtures/utils/litegraphUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export class NodeReference {
503503
for (const position of clickPositions) {
504504
// Clear any selection first
505505
await this.comfyPage.canvas.click({
506-
position: { x: 50, y: 50 },
506+
position: { x: 250, y: 250 },
507507
force: true
508508
})
509509
await this.comfyPage.nextFrame()

src/components/graph/GraphCanvas.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
<!-- If load immediately, the top-level splitter stateKey won't be correctly
44
synced with the stateStorage (localStorage). -->
55
<LiteGraphCanvasSplitterOverlay v-if="comfyAppReady">
6-
<template v-if="showUI && workflowTabsPosition === 'Topbar'" #workflow-tabs>
6+
<template v-if="showUI" #workflow-tabs>
7+
<TryVueNodeBanner />
78
<div
9+
v-if="workflowTabsPosition === 'Topbar'"
810
class="workflow-tabs-container pointer-events-auto relative h-9.5 w-full"
911
>
1012
<!-- Native drag area for Electron -->
@@ -152,6 +154,8 @@ import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
152154
import { useWorkspaceStore } from '@/stores/workspaceStore'
153155
import { isNativeWindow } from '@/utils/envUtil'
154156
157+
import TryVueNodeBanner from '../topbar/TryVueNodeBanner.vue'
158+
155159
const emit = defineEmits<{
156160
ready: []
157161
}>()

src/components/toast/GlobalToast.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function updateToastPosition() {
6666
.p-toast.p-component.p-toast-top-right {
6767
top: ${rect.top + 100}px !important;
6868
right: ${window.innerWidth - (rect.left + rect.width) + 20}px !important;
69+
z-index: 10000 !important;
6970
}
7071
`
7172
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<template>
2+
<div
3+
v-if="showVueNodesBanner"
4+
class="pointer-events-auto relative w-full h-10 bg-gradient-to-r from-blue-600 to-blue-700 flex items-center justify-center px-4"
5+
>
6+
<div class="flex items-center">
7+
<i class="icon-[lucide--sparkles]"></i>
8+
<span class="pl-2">{{ $t('vueNodesBanner.message') }}</span>
9+
<Button
10+
class="cursor-pointer bg-transparent rounded h-7 px-3 border border-white text-white ml-4 text-xs"
11+
@click="handleTryItOut"
12+
>
13+
{{ $t('vueNodesBanner.tryItOut') }}
14+
</Button>
15+
</div>
16+
<Button
17+
class="cursor-pointer bg-transparent border-0 outline-0 grid place-items-center absolute right-4"
18+
unstyled
19+
@click="handleDismiss"
20+
>
21+
<i class="w-5 h-5 icon-[lucide--x]"></i>
22+
</Button>
23+
</div>
24+
</template>
25+
26+
<script setup lang="ts">
27+
import { useLocalStorage } from '@vueuse/core'
28+
import Button from 'primevue/button'
29+
import { computed } from 'vue'
30+
31+
import { useSettingStore } from '@/platform/settings/settingStore'
32+
33+
const STORAGE_KEY = 'vueNodesBannerDismissed'
34+
35+
const settingStore = useSettingStore()
36+
const bannerDismissed = useLocalStorage(STORAGE_KEY, false)
37+
38+
const vueNodesEnabled = computed(() => {
39+
try {
40+
return settingStore.get('Comfy.VueNodes.Enabled') ?? false
41+
} catch {
42+
return false
43+
}
44+
})
45+
46+
const showVueNodesBanner = computed(() => {
47+
if (vueNodesEnabled.value) {
48+
return false
49+
}
50+
51+
if (bannerDismissed.value) {
52+
return false
53+
}
54+
55+
return true
56+
})
57+
58+
const handleDismiss = (): void => {
59+
bannerDismissed.value = true
60+
}
61+
62+
const handleTryItOut = async (): Promise<void> => {
63+
try {
64+
await settingStore.set('Comfy.VueNodes.Enabled', true)
65+
} catch (error) {
66+
console.error('Failed to enable Vue nodes:', error)
67+
} finally {
68+
handleDismiss()
69+
}
70+
}
71+
</script>

src/locales/en/main.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,5 +1819,9 @@
18191819
"Close": "Close"
18201820
}
18211821
}
1822+
},
1823+
"vueNodesBanner": {
1824+
"message": "Nodes just got a new look and feel",
1825+
"tryItOut": "Try it out"
18221826
}
18231827
}

0 commit comments

Comments
 (0)