mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 09:45:13 +00:00
V2 Node Search (+ hidden Node Library changes) (#8987)
## Summary Redesigned node search with categories ## Changes - **What**: Adds a v2 search component, leaving the existing implementation untouched - It also brings onboard the incomplete node library & preview changes, disabled and behind a hidden setting - **Breaking**: Changes the 'default' value of the node search setting to v2, adding v1 (legacy) as an option ## Screenshots (if applicable) https://github.com/user-attachments/assets/2ab797df-58f0-48e8-8b20-2a1809e3735f ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8987-V2-Node-Search-hidden-Node-Library-changes-30c6d73d36508160902bcb92553f147c) by [Unito](https://www.unito.io) --------- Co-authored-by: Yourz <crazilou@vip.qq.com> Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<div
|
||||
v-if="enableNodePreview && hoveredSuggestion"
|
||||
class="comfy-vue-node-preview-container absolute top-[50px] left-[-375px] z-50 cursor-pointer"
|
||||
@mousedown.stop="onAddNode(hoveredSuggestion!)"
|
||||
@mousedown.stop="onAddNode(hoveredSuggestion!, $event)"
|
||||
>
|
||||
<NodePreview
|
||||
:key="hoveredSuggestion?.name || ''"
|
||||
@@ -148,15 +148,19 @@ const search = (query: string) => {
|
||||
debouncedTrackSearch(query)
|
||||
}
|
||||
|
||||
const emit = defineEmits(['addFilter', 'removeFilter', 'addNode'])
|
||||
const emit = defineEmits<{
|
||||
addFilter: [filter: FuseFilterWithValue<ComfyNodeDefImpl, string>]
|
||||
removeFilter: [filter: FuseFilterWithValue<ComfyNodeDefImpl, string>]
|
||||
addNode: [nodeDef: ComfyNodeDefImpl, dragEvent?: MouseEvent]
|
||||
}>()
|
||||
|
||||
// Track node selection and emit addNode event
|
||||
const onAddNode = (nodeDef: ComfyNodeDefImpl) => {
|
||||
function onAddNode(nodeDef: ComfyNodeDefImpl, event?: MouseEvent) {
|
||||
telemetry?.trackNodeSearchResultSelected({
|
||||
node_type: nodeDef.name,
|
||||
last_query: currentQuery.value
|
||||
})
|
||||
emit('addNode', nodeDef)
|
||||
emit('addNode', nodeDef, event)
|
||||
}
|
||||
|
||||
let inputElement: HTMLInputElement | null = null
|
||||
|
||||
Reference in New Issue
Block a user