Skip to content

Commit d02b074

Browse files
authored
Manage searchbox imp setting in Vue app (#282)
* Manage searchbox setting in vue * nit
1 parent e14d845 commit d02b074

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/components/graph/GraphCanvas.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import SideToolBar from '@/components/sidebar/SideToolBar.vue'
1515
import LiteGraphCanvasSplitterOverlay from '@/components/LiteGraphCanvasSplitterOverlay.vue'
1616
import NodeSearchboxPopover from '@/components/NodeSearchBoxPopover.vue'
17-
import { ref, onMounted, computed, onUnmounted } from 'vue'
17+
import { ref, computed, onUnmounted, watch, onMounted } from 'vue'
1818
import { app as comfyApp } from '@/scripts/app'
1919
import { useSettingStore } from '@/stores/settingStore'
2020
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'
@@ -32,6 +32,9 @@ const betaMenuEnabled = computed(
3232
const nodeSearchEnabled = computed<boolean>(
3333
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
3434
)
35+
watch(nodeSearchEnabled, (newVal) => {
36+
comfyApp.canvas.allow_searchbox = !newVal
37+
})
3538
3639
let dropTargetCleanup = () => {}
3740
@@ -40,6 +43,7 @@ onMounted(async () => {
4043
4144
workspaceStore.spinner = true
4245
await comfyApp.setup(canvasRef.value)
46+
comfyApp.canvas.allow_searchbox = !nodeSearchEnabled.value
4347
workspaceStore.spinner = false
4448
4549
window['app'] = comfyApp

src/scripts/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,6 @@ export class ComfyApp {
18811881
this.#addAfterConfigureHandler()
18821882

18831883
this.canvas = new LGraphCanvas(canvasEl, this.graph)
1884-
this.ui.settings.refreshSetting('Comfy.NodeSearchBoxImpl')
18851884
this.ctx = canvasEl.getContext('2d')
18861885

18871886
LiteGraph.release_link_on_empty_shows_menu = true

src/scripts/ui.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,7 @@ export class ComfyUI {
425425
name: 'Node Search box implementation',
426426
type: 'combo',
427427
options: ['default', 'litegraph (legacy)'],
428-
defaultValue: 'default',
429-
onChange: (value?: string) => {
430-
if (!app.canvas) return
431-
432-
value = value || 'default'
433-
const useLitegraphSearch = value === 'litegraph (legacy)'
434-
app.canvas.allow_searchbox = useLitegraphSearch
435-
}
428+
defaultValue: 'default'
436429
})
437430

438431
const fileInput = $el('input', {

0 commit comments

Comments
 (0)