mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 17:40:09 +00:00
Always show extension panel in settings dialog (#2002)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -116,12 +116,6 @@ const serverConfigPanelNode: SettingTreeNode = {
|
||||
children: []
|
||||
}
|
||||
|
||||
const extensionPanelNodeList = computed<SettingTreeNode[]>(() => {
|
||||
const settingStore = useSettingStore()
|
||||
const showExtensionPanel = settingStore.get('Comfy.Settings.ExtensionPanel')
|
||||
return showExtensionPanel ? [extensionPanelNode] : []
|
||||
})
|
||||
|
||||
/**
|
||||
* Server config panel is only available in Electron. We might want to support
|
||||
* it in the web version in the future.
|
||||
@@ -140,7 +134,7 @@ const categories = computed<SettingTreeNode[]>(() =>
|
||||
[
|
||||
...settingCategories.value,
|
||||
keybindingPanelNode,
|
||||
...extensionPanelNodeList.value,
|
||||
extensionPanelNode,
|
||||
...serverConfigPanelNodeList.value,
|
||||
aboutPanelNode
|
||||
].map((node) => ({
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
>
|
||||
<template #body="slotProps">
|
||||
<ToggleSwitch
|
||||
:disabled="
|
||||
extensionStore.isExtensionAlwaysEnabled(slotProps.data.name)
|
||||
"
|
||||
v-model="editingEnabledExtensions[slotProps.data.name]"
|
||||
@change="updateExtensionStatus"
|
||||
/>
|
||||
|
||||
@@ -436,14 +436,6 @@ export const CORE_SETTINGS: SettingParams[] = [
|
||||
defaultValue: [] as string[],
|
||||
versionAdded: '1.3.11'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.Settings.ExtensionPanel',
|
||||
name: 'Show extension panel in settings dialog',
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
experimental: true,
|
||||
versionAdded: '1.3.11'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.Validation.NodeDefs',
|
||||
name: 'Validate node definitions (slow)',
|
||||
|
||||
@@ -262,9 +262,6 @@
|
||||
"name": "Server config values for frontend display",
|
||||
"tooltip": "Server config values used for frontend display only"
|
||||
},
|
||||
"Comfy_Settings_ExtensionPanel": {
|
||||
"name": "Show extension panel in settings dialog"
|
||||
},
|
||||
"Comfy_Sidebar_Location": {
|
||||
"name": "Sidebar location",
|
||||
"options": {
|
||||
|
||||
@@ -262,9 +262,6 @@
|
||||
"name": "フロントエンド表示用のサーバー設定値",
|
||||
"tooltip": "フロントエンド表示のみに使用されるサーバー設定値"
|
||||
},
|
||||
"Comfy_Settings_ExtensionPanel": {
|
||||
"name": "設定ダイアログに拡張パネルを表示"
|
||||
},
|
||||
"Comfy_Sidebar_Location": {
|
||||
"name": "サイドバーの位置",
|
||||
"options": {
|
||||
|
||||
@@ -262,9 +262,6 @@
|
||||
"name": "프론트엔드 표시를 위한 서버 구성 값",
|
||||
"tooltip": "프론트엔드 표시를 위해 사용되는 서버 구성 값만 해당됩니다."
|
||||
},
|
||||
"Comfy_Settings_ExtensionPanel": {
|
||||
"name": "설정 대화 상자에서 확장 패널 표시"
|
||||
},
|
||||
"Comfy_Sidebar_Location": {
|
||||
"name": "사이드바 위치",
|
||||
"options": {
|
||||
|
||||
@@ -262,9 +262,6 @@
|
||||
"name": "Значения конфигурации сервера для отображения на фронтенде",
|
||||
"tooltip": "Значения конфигурации сервера, используемые только для отображения на фронтенде"
|
||||
},
|
||||
"Comfy_Settings_ExtensionPanel": {
|
||||
"name": "Показать панель расширений в диалоговом окне настроек"
|
||||
},
|
||||
"Comfy_Sidebar_Location": {
|
||||
"name": "Расположение боковой панели",
|
||||
"options": {
|
||||
|
||||
@@ -262,9 +262,6 @@
|
||||
"name": "前端显示的服务器配置值",
|
||||
"tooltip": "仅用于前端显示的服务器配置值"
|
||||
},
|
||||
"Comfy_Settings_ExtensionPanel": {
|
||||
"name": "在设置对话框中显示扩展面板"
|
||||
},
|
||||
"Comfy_Sidebar_Location": {
|
||||
"name": "侧边栏位置",
|
||||
"options": {
|
||||
|
||||
@@ -9,6 +9,16 @@ import { useMenuItemStore } from './menuItemStore'
|
||||
import { useBottomPanelStore } from './workspace/bottomPanelStore'
|
||||
import { useWidgetStore } from './widgetStore'
|
||||
|
||||
/**
|
||||
* These extensions are always active, even if they are disabled in the setting.
|
||||
* TODO(https://github.com/Comfy-Org/ComfyUI_frontend/issues/1996):
|
||||
* Migrate logic to out of extensions/core, as features provided
|
||||
* by these extensions are now essential to core.
|
||||
*/
|
||||
export const ALWAYS_ENABLED_EXTENSIONS: readonly string[] = [
|
||||
'Comfy.ColorPalette'
|
||||
]
|
||||
|
||||
export const useExtensionStore = defineStore('extension', () => {
|
||||
// For legacy reasons, the name uniquely identifies an extension
|
||||
const extensionByName = ref<Record<string, ComfyExtension>>({})
|
||||
@@ -32,6 +42,10 @@ export const useExtensionStore = defineStore('extension', () => {
|
||||
return extensions.value.filter((ext) => isExtensionEnabled(ext.name))
|
||||
})
|
||||
|
||||
function isExtensionAlwaysEnabled(name: string) {
|
||||
return ALWAYS_ENABLED_EXTENSIONS.includes(name)
|
||||
}
|
||||
|
||||
function registerExtension(extension: ComfyExtension) {
|
||||
if (!extension.name) {
|
||||
throw new Error("Extensions must have a 'name' property.")
|
||||
@@ -80,6 +94,10 @@ export const useExtensionStore = defineStore('extension', () => {
|
||||
// allowed since v1.3.12.
|
||||
// https://github.com/Comfy-Org/ComfyUI_frontend/issues/1176
|
||||
disabledExtensionNames.value.add('pysssss.SnapToGrid')
|
||||
|
||||
for (const name of ALWAYS_ENABLED_EXTENSIONS) {
|
||||
disabledExtensionNames.value.delete(name)
|
||||
}
|
||||
}
|
||||
|
||||
// Some core extensions are registered before the store is initialized, e.g.
|
||||
@@ -95,6 +113,7 @@ export const useExtensionStore = defineStore('extension', () => {
|
||||
enabledExtensions,
|
||||
inactiveDisabledExtensionNames,
|
||||
isExtensionEnabled,
|
||||
isExtensionAlwaysEnabled,
|
||||
registerExtension,
|
||||
loadDisabledExtensionNames
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user