From 906ba108ccb96679ba1b8c255cc43d77dd2f9bef Mon Sep 17 00:00:00 2001 From: newtextdoc1111 Date: Sat, 22 Nov 2025 17:51:47 +0900 Subject: [PATCH 1/7] fix: Add "AutoFormatter" category to localization files --- locales/en/main.json | 3 ++- locales/ja/main.json | 3 ++- locales/zh-TW/main.json | 3 ++- locales/zh/main.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/locales/en/main.json b/locales/en/main.json index be1d093..a6a5bec 100644 --- a/locales/en/main.json +++ b/locales/en/main.json @@ -4,6 +4,7 @@ "Tag Source": "Tag Source", "Autocompletion": "Autocompletion", "Related Tags": "Related Tags", - "Display": "Display" + "Display": "Display", + "AutoFormatter": "AutoFormatter" } } \ No newline at end of file diff --git a/locales/ja/main.json b/locales/ja/main.json index f81e15d..71210ea 100644 --- a/locales/ja/main.json +++ b/locales/ja/main.json @@ -4,6 +4,7 @@ "Tag Source": "タグソース", "Autocompletion": "オートコンプリート", "Related Tags": "関連タグ", - "Display": "表示" + "Display": "表示", + "AutoFormatter": "自動フォーマット" } } \ No newline at end of file diff --git a/locales/zh-TW/main.json b/locales/zh-TW/main.json index 10d1af3..6e64796 100644 --- a/locales/zh-TW/main.json +++ b/locales/zh-TW/main.json @@ -4,6 +4,7 @@ "Tag Source": "標籤來源", "Autocompletion": "自動完成", "Related Tags": "相關標籤", - "Display": "顯示" + "Display": "顯示", + "AutoFormatter": "自動格式化" } } \ No newline at end of file diff --git a/locales/zh/main.json b/locales/zh/main.json index 03a1abc..b77a390 100644 --- a/locales/zh/main.json +++ b/locales/zh/main.json @@ -4,6 +4,7 @@ "Tag Source": "标签来源", "Autocompletion": "自动完成", "Related Tags": "相关标签", - "Display": "显示" + "Display": "显示", + "AutoFormatter": "自动格式化" } } \ No newline at end of file From 3f84125262b472a8c52d59a45ff40087ba0c2bbb Mon Sep 17 00:00:00 2001 From: newtextdoc1111 Date: Sat, 22 Nov 2025 17:56:55 +0900 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20Bump=20version=20=C2=A0to=201.8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b068ca9..fd49b04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-autocomplete-plus" description = "Autocomplete and Related Tag display for ComfyUI" -version = "1.7.2" +version = "1.8.0" license = {file = "LICENSE"} dependencies = ["",] From b6d4fb559070ce8b4be399a5f5ebccb6dbfe9489 Mon Sep 17 00:00:00 2001 From: BlakeNeko Date: Sun, 23 Nov 2025 11:28:45 +0800 Subject: [PATCH 3/7] feat: Add setting for trailing comma in auto-formatting --- web/js/auto-formatter.js | 4 ++-- web/js/main.js | 11 +++++++++++ web/js/settings.js | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/web/js/auto-formatter.js b/web/js/auto-formatter.js index a47fc01..b3e7a84 100644 --- a/web/js/auto-formatter.js +++ b/web/js/auto-formatter.js @@ -100,8 +100,8 @@ export function formatPromptText(text) { // Rejoin cleaned tags with ", " let formattedLine = cleanedTags.join(', '); - // Add a trailing comma and space if the line contains valid tags - if (formattedLine.length > 0) { + // Add a trailing comma and space if the setting is enabled and line contains valid tags + if (formattedLine.length > 0 && settingValues.addTrailingComma) { formattedLine += ', '; } diff --git a/web/js/main.js b/web/js/main.js index ad444a6..18da111 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -512,5 +512,16 @@ app.registerExtension({ settingValues.enableAutoFormat = newVal; }, }, + { + id: id + '.AutoFormatter.AddTrailingComma', + name: 'Add Trailing Comma', + tooltip: 'Add a comma at the end of each line when auto-formatting', + type: 'boolean', + defaultValue: false, + category: [name, 'AutoFormatter', 'Add Trailing Comma'], + onChange: (newVal, oldVal) => { + settingValues.addTrailingComma = newVal; + }, + }, ] }); \ No newline at end of file diff --git a/web/js/settings.js b/web/js/settings.js index 0cbc7b3..6351d2a 100644 --- a/web/js/settings.js +++ b/web/js/settings.js @@ -24,6 +24,7 @@ export const settingValues = { // Auto format settings enableAutoFormat: true, autoFormatTrigger: 'auto', // Options: 'auto' (format on blur + shortcut), 'manual' (shortcut only) + addTrailingComma: false, // Whether to add comma at the end of each line // Internal logic settings From 5a76096c7e89875c383418dad4a34416dca716dc Mon Sep 17 00:00:00 2001 From: BlakeNeko Date: Sun, 23 Nov 2025 11:32:28 +0800 Subject: [PATCH 4/7] feat: Add en/zh/zh-TW translation for "addTrailingComma" option --- locales/en/settings.json | 4 ++++ locales/zh-TW/settings.json | 4 ++++ locales/zh/settings.json | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/locales/en/settings.json b/locales/en/settings.json index 49597ba..984fbc9 100644 --- a/locales/en/settings.json +++ b/locales/en/settings.json @@ -79,6 +79,10 @@ "manual": "Manual" } }, + "AutocompletePlus_AutoFormatter_AddTrailingComma": { + "name": "Add Trailing Comma", + "tooltip": "Add a comma at the end of each line when auto-formatting" + }, "AutocompletePlus_AutoFormatter_EnableAutoFormat": { "name": "Enable Auto Format" } diff --git a/locales/zh-TW/settings.json b/locales/zh-TW/settings.json index 5f18774..f5080d5 100644 --- a/locales/zh-TW/settings.json +++ b/locales/zh-TW/settings.json @@ -79,6 +79,10 @@ "manual": "手動" } }, + "AutocompletePlus_AutoFormatter_AddTrailingComma": { + "name": "在行末添加逗號", + "tooltip": "自動格式化時在每行末尾添加逗號" + }, "AutocompletePlus_AutoFormatter_EnableAutoFormat": { "name": "啟用自動格式化" } diff --git a/locales/zh/settings.json b/locales/zh/settings.json index e9b9b58..face403 100644 --- a/locales/zh/settings.json +++ b/locales/zh/settings.json @@ -79,6 +79,10 @@ "manual": "手动" } }, + "AutocompletePlus_AutoFormatter_AddTrailingComma": { + "name": "在行末添加逗号", + "tooltip": "自动格式化时在每行末尾添加逗号" + }, "AutocompletePlus_AutoFormatter_EnableAutoFormat": { "name": "启用自动格式化" } From 8189b2b75dd381227b09da518ae05a2104d8a6ad Mon Sep 17 00:00:00 2001 From: BlakeNeko Date: Wed, 26 Nov 2025 10:01:41 +0800 Subject: [PATCH 5/7] refactor: Replace 'Add Trailing Comma' setting with 'Use Trailing Comma' --- web/js/main.js | 22 +++++++++++----------- web/js/settings.js | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/web/js/main.js b/web/js/main.js index 18da111..3d49c86 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -490,6 +490,17 @@ app.registerExtension({ }, // --- Auto format settings --- + { + id: id + '.AutoFormatter.UseTrailingComma', + name: 'Use Trailing Comma', + tooltip: 'When enabled, ensures all lines end with a trailing comma.\nWhen disabled, removes trailing commas.', + type: 'boolean', + defaultValue: false, + category: [name, 'AutoFormatter', 'Use Trailing Comma'], + onChange: (newVal, oldVal) => { + settingValues.useTrailingComma = newVal; + }, + }, { id: id + '.AutoFormatter.Trigger', name: 'Auto Format Trigger', @@ -512,16 +523,5 @@ app.registerExtension({ settingValues.enableAutoFormat = newVal; }, }, - { - id: id + '.AutoFormatter.AddTrailingComma', - name: 'Add Trailing Comma', - tooltip: 'Add a comma at the end of each line when auto-formatting', - type: 'boolean', - defaultValue: false, - category: [name, 'AutoFormatter', 'Add Trailing Comma'], - onChange: (newVal, oldVal) => { - settingValues.addTrailingComma = newVal; - }, - }, ] }); \ No newline at end of file diff --git a/web/js/settings.js b/web/js/settings.js index 6351d2a..d02830f 100644 --- a/web/js/settings.js +++ b/web/js/settings.js @@ -24,7 +24,7 @@ export const settingValues = { // Auto format settings enableAutoFormat: true, autoFormatTrigger: 'auto', // Options: 'auto' (format on blur + shortcut), 'manual' (shortcut only) - addTrailingComma: false, // Whether to add comma at the end of each line + useTrailingComma: false, // Whether to add comma at the end of each line // Internal logic settings From 4fdef7f436d9cfb36b69559b3d8da497bf1e0a82 Mon Sep 17 00:00:00 2001 From: BlakeNeko Date: Wed, 26 Nov 2025 10:04:26 +0800 Subject: [PATCH 6/7] refactor: Rename 'Add Trailing Comma' to 'Use Trailing Comma' and update in localization files --- locales/en/settings.json | 6 +++--- locales/zh-TW/settings.json | 4 ++-- locales/zh/settings.json | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/locales/en/settings.json b/locales/en/settings.json index 984fbc9..f7ea594 100644 --- a/locales/en/settings.json +++ b/locales/en/settings.json @@ -79,9 +79,9 @@ "manual": "Manual" } }, - "AutocompletePlus_AutoFormatter_AddTrailingComma": { - "name": "Add Trailing Comma", - "tooltip": "Add a comma at the end of each line when auto-formatting" + "AutocompletePlus_AutoFormatter_UseTrailingComma": { + "name": "Use Trailing Comma", + "tooltip": "When enabled, ensures all lines end with a trailing comma.\nWhen disabled, removes trailing commas." }, "AutocompletePlus_AutoFormatter_EnableAutoFormat": { "name": "Enable Auto Format" diff --git a/locales/zh-TW/settings.json b/locales/zh-TW/settings.json index f5080d5..b0d930c 100644 --- a/locales/zh-TW/settings.json +++ b/locales/zh-TW/settings.json @@ -79,9 +79,9 @@ "manual": "手動" } }, - "AutocompletePlus_AutoFormatter_AddTrailingComma": { + "AutocompletePlus_AutoFormatter_UseTrailingComma": { "name": "在行末添加逗號", - "tooltip": "自動格式化時在每行末尾添加逗號" + "tooltip": "啟用時,確保所有行都以逗號結尾。\n停用時,移除結尾逗號。" }, "AutocompletePlus_AutoFormatter_EnableAutoFormat": { "name": "啟用自動格式化" diff --git a/locales/zh/settings.json b/locales/zh/settings.json index face403..7cb56b7 100644 --- a/locales/zh/settings.json +++ b/locales/zh/settings.json @@ -79,9 +79,9 @@ "manual": "手动" } }, - "AutocompletePlus_AutoFormatter_AddTrailingComma": { + "AutocompletePlus_AutoFormatter_UseTrailingComma": { "name": "在行末添加逗号", - "tooltip": "自动格式化时在每行末尾添加逗号" + "tooltip": "启用时,确保所有行都以逗号结尾。\n禁用时,移除结尾逗号。" }, "AutocompletePlus_AutoFormatter_EnableAutoFormat": { "name": "启用自动格式化" From 156d5696145f7a921dc4ff99b174db700733bc74 Mon Sep 17 00:00:00 2001 From: BlakeNeko Date: Wed, 26 Nov 2025 10:05:19 +0800 Subject: [PATCH 7/7] refactor: Update condition to use 'useTrailingComma' setting instead of 'addTrailingComma' --- web/js/auto-formatter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/auto-formatter.js b/web/js/auto-formatter.js index b3e7a84..44dca74 100644 --- a/web/js/auto-formatter.js +++ b/web/js/auto-formatter.js @@ -101,7 +101,7 @@ export function formatPromptText(text) { let formattedLine = cleanedTags.join(', '); // Add a trailing comma and space if the setting is enabled and line contains valid tags - if (formattedLine.length > 0 && settingValues.addTrailingComma) { + if (formattedLine.length > 0 && settingValues.useTrailingComma) { formattedLine += ', '; }