Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
refactor: Move searchbox preference to the searchboxstore
  • Loading branch information
DrJKL committed Aug 22, 2025
commit ed6ecf55afb7d760c7d53610e75f0fb3ba5cf3d2
5 changes: 1 addition & 4 deletions src/components/searchbox/NodeSearchBoxPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let disconnectOnReset = false
const settingStore = useSettingStore()
const litegraphService = useLitegraphService()

const { visible } = storeToRefs(useSearchBoxStore())
const { visible, newSearchBoxEnabled } = storeToRefs(useSearchBoxStore())
const dismissable = ref(true)
const getNewNodeLocation = (): Point => {
return triggerEvent
Expand Down Expand Up @@ -107,9 +107,6 @@ const addNode = (nodeDef: ComfyNodeDefImpl) => {
window.requestAnimationFrame(closeDialog)
}

const newSearchBoxEnabled = computed(
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
)
const showSearchBox = (e: CanvasPointerEvent) => {
if (newSearchBoxEnabled.value) {
if (e.pointerType === 'touch') {
Expand Down
15 changes: 12 additions & 3 deletions src/stores/workspace/searchBoxStore.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { computed, ref } from 'vue'

import { useSettingStore } from '@/stores/settingStore'

export const useSearchBoxStore = defineStore('searchBox', () => {
const settingStore = useSettingStore()

const newSearchBoxEnabled = computed(
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
)

const visible = ref(false)
function toggleVisible() {
visible.value = !visible.value
}

return {
visible,
toggleVisible
newSearchBoxEnabled,
toggleVisible,
visible
}
})