Add 'empty' placeholder to prevent automatic text appending in prompts. See #345 and #339

This commit is contained in:
mic 2025-04-14 22:40:24 +02:00
parent 00a605e794
commit 5070494ed0
2 changed files with 14 additions and 0 deletions

View file

@ -1099,6 +1099,10 @@
"message": "Default language as defined in ThunderAI options.",
"description": ""
},
"empty": {
"message": "This placeholder doesn't add any text, but it prevents the email body from being automatically appended at the end of the prompt.",
"description": ""
},
"prefs_OptionText_spamfilter": {
"message": "Automatic Spam Filter",
"description": ""

View file

@ -175,6 +175,13 @@ const defaultPlaceholders = [
type: 0,
is_default: "1",
},
{
id: 'empty',
name: "__MSG_placeholder_empty__",
default_value: "",
type: 0,
is_default: "1",
},
];
@ -358,6 +365,9 @@ export const placeholdersUtils = {
let prefs_def_lang = await browser.storage.sync.get({default_chatgpt_lang: ''});
finalSubs['thunderai_def_lang'] = placeholdersUtils.failSafePlaceholders(prefs_def_lang.default_chatgpt_lang);
break;
case 'empty':
finalSubs['empty'] = '';
break;
default: // TODO Manage custom placeholders https://github.com/micz/ThunderAI/issues/156
break;
}