Skip to content

Commit e8e1d7a

Browse files
make vue node settings appear higher in the settings dialog (#6820)
makes setting groups/categories be sorted by highest internal setting field `sortOrder` and adds high `sortOrder` values to the Vue Nodes (Nodes 2.0) settings. <img width="2282" height="1872" alt="Selection_2371" src="https://github.com/user-attachments/assets/71e7e76b-4637-42b5-9f0c-2617622cda23" />
1 parent 662f79e commit e8e1d7a

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/locales/en/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,11 @@
335335
"name": "Validate workflows"
336336
},
337337
"Comfy_VueNodes_AutoScaleLayout": {
338-
"name": "Auto-scale layout (Vue nodes)",
338+
"name": "Auto-scale layout (Nodes 2.0)",
339339
"tooltip": "Automatically scale node positions when switching to Vue rendering to prevent overlap"
340340
},
341341
"Comfy_VueNodes_Enabled": {
342-
"name": "Modern Node Design (Vue Nodes)",
342+
"name": "Modern Node Design (Nodes 2.0)",
343343
"tooltip": "Modern: DOM-based rendering with enhanced interactivity, native browser features, and updated visual design. Classic: Traditional canvas rendering."
344344
},
345345
"Comfy_WidgetControlMode": {

src/platform/settings/components/SettingDialogContent.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,17 @@ const {
107107
108108
const authActions = useFirebaseAuthActions()
109109
110+
// Get max sortOrder from settings in a group
111+
const getGroupSortOrder = (group: SettingTreeNode): number =>
112+
Math.max(0, ...flattenTree<SettingParams>(group).map((s) => s.sortOrder ?? 0))
113+
110114
// Sort groups for a category
111115
const sortedGroups = (category: SettingTreeNode): ISettingGroup[] => {
112116
return [...(category.children ?? [])]
113-
.sort((a, b) => a.label.localeCompare(b.label))
117+
.sort((a, b) => {
118+
const orderDiff = getGroupSortOrder(b) - getGroupSortOrder(a)
119+
return orderDiff !== 0 ? orderDiff : a.label.localeCompare(b.label)
120+
})
114121
.map((group) => ({
115122
label: group.label,
116123
settings: flattenTree<SettingParams>(group).sort((a, b) => {

src/platform/settings/constants/coreSettings.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,24 +1082,28 @@ export const CORE_SETTINGS: SettingParams[] = [
10821082
},
10831083

10841084
/**
1085-
* Vue Node System Settings
1085+
* Nodes 2.0 Settings
10861086
*/
10871087
{
10881088
id: 'Comfy.VueNodes.Enabled',
1089-
name: 'Modern Node Design (Vue Nodes)',
1089+
category: ['Comfy', 'Nodes 2.0', 'VueNodesEnabled'],
1090+
name: 'Modern Node Design (Nodes 2.0)',
10901091
type: 'boolean',
10911092
tooltip:
10921093
'Modern: DOM-based rendering with enhanced interactivity, native browser features, and updated visual design. Classic: Traditional canvas rendering.',
10931094
defaultValue: false,
1095+
sortOrder: 100,
10941096
experimental: true,
10951097
versionAdded: '1.27.1'
10961098
},
10971099
{
10981100
id: 'Comfy.VueNodes.AutoScaleLayout',
1099-
name: 'Auto-scale layout (Vue nodes)',
1101+
category: ['Comfy', 'Nodes 2.0', 'AutoScaleLayout'],
1102+
name: 'Auto-scale layout (Nodes 2.0)',
11001103
tooltip:
11011104
'Automatically scale node positions when switching to Vue rendering to prevent overlap',
11021105
type: 'boolean',
1106+
sortOrder: 50,
11031107
experimental: true,
11041108
defaultValue: true,
11051109
versionAdded: '1.30.3'

0 commit comments

Comments
 (0)