Node source/id badge (#781)

* Add basic node badge

* Node source badge

* Prevent manager badge rendering

* Update litegraph (Badge support)

* Add playwright tests

* Separate nodes

* nit

* Checkout devtools repo for browser test expectation CI

* Fix failing unittests

* Rename setting

* Hide all badges in playwright tests

* Handle group node

* Update test expectations [skip ci]

* Fix unittest

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-12 09:36:06 +09:00
committed by GitHub
parent f2a30ec197
commit 80ca1808f0
29 changed files with 301 additions and 29 deletions

View File

@@ -10,6 +10,7 @@
import { app } from '@/scripts/app'
import { ComfySettingsDialog } from '@/scripts/ui/settings'
import { Settings } from '@/types/apiTypes'
import { NodeBadgeMode } from '@/types/nodeSource'
import {
LinkReleaseTriggerAction,
LinkReleaseTriggerMode
@@ -330,6 +331,22 @@ export const useSettingStore = defineStore('setting', {
options: ['en', 'zh'],
defaultValue: navigator.language.split('-')[0] || 'en'
})
app.ui.settings.addSetting({
id: 'Comfy.NodeBadge.NodeSourceBadgeMode',
name: 'Node source badge mode',
type: 'combo',
options: Object.values(NodeBadgeMode),
defaultValue: NodeBadgeMode.HideBuiltIn
})
app.ui.settings.addSetting({
id: 'Comfy.NodeBadge.NodeIdBadgeMode',
name: 'Node ID badge mode',
type: 'combo',
options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll],
defaultValue: NodeBadgeMode.ShowAll
})
},
set<K extends keyof Settings>(key: K, value: Settings[K]) {