Restore context menu for new searchbox (#724)

* Searchbox revamp

* nit

* nit

* Add playwright test

* Update litegraph

* Rename setting

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-03 13:28:26 -04:00
committed by GitHub
parent 974a7ef63f
commit 36cdebcad1
13 changed files with 177 additions and 94 deletions

View File

@@ -2,6 +2,7 @@ import { ZodType, z } from 'zod'
import { zComfyWorkflow, zNodeId } from './comfyWorkflow'
import { fromZodError } from 'zod-validation-error'
import { colorPalettesSchema } from './colorPalette'
import { LinkReleaseTriggerAction } from './searchBoxTypes'
const zNodeType = z.string()
const zQueueIndex = z.number()
@@ -419,6 +420,10 @@ const zBookmarkCustomization = z.object({
})
export type BookmarkCustomization = z.infer<typeof zBookmarkCustomization>
const zLinkReleaseTriggerAction = z.enum(
Object.values(LinkReleaseTriggerAction) as [string, ...string[]]
)
const zSettings = z.record(z.any()).and(
z
.object({
@@ -454,6 +459,8 @@ const zSettings = z.record(z.any()).and(
'hold shift',
'NOT hold shift'
]),
'Comfy.LinkRelease.Action': zLinkReleaseTriggerAction,
'Comfy.LinkRelease.ActionShift': zLinkReleaseTriggerAction,
'Comfy.NodeSearchBoxImpl.NodePreview': z.boolean(),
'Comfy.NodeSearchBoxImpl': z.enum(['default', 'simple']),
'Comfy.NodeSearchBoxImpl.ShowCategory': z.boolean(),

View File

@@ -3,3 +3,9 @@ export enum LinkReleaseTriggerMode {
HOLD_SHIFT = 'hold shift',
NOT_HOLD_SHIFT = 'NOT hold shift'
}
export enum LinkReleaseTriggerAction {
CONTEXT_MENU = 'context menu',
SEARCH_BOX = 'search box',
NO_ACTION = 'no action'
}

View File

@@ -44,4 +44,5 @@ export interface SettingParams {
// Note: Like id, category value need to be unique.
category?: string[]
experimental?: boolean
deprecated?: boolean
}