diff --git a/public/scripts/extensions/objective/index.js b/public/scripts/extensions/objective/index.js index 5ab8bd83a..cc3fef741 100644 --- a/public/scripts/extensions/objective/index.js +++ b/public/scripts/extensions/objective/index.js @@ -113,13 +113,13 @@ async function generateTasks() { // Call Quiet Generate to check if a task is completed async function checkTaskCompleted() { - // Make sure there are tasks - if (currentTask == {}){ + // Make sure there are tasks and check is enabled + if (currentTask == {} || $('#objective-check-frequency').val() == 0){ return } // Check only at specified interval - if (checkCounter >= 0){ + if (checkCounter > 0){ return } checkCounter = $('#objective-check-frequency').val() @@ -176,6 +176,7 @@ const defaultSettings = { tasks: [], chatDepth: 2, checkFrequency:3, + hideTasks: false } // Convenient single call. Not much at the moment. @@ -192,6 +193,7 @@ function saveState(){ extension_settings.objective[currentChatId].tasks = globalTasks extension_settings.objective[currentChatId].checkFrequency = $('#objective-check-frequency').val() extension_settings.objective[currentChatId].chatDepth = $('#objective-chat-depth').val() + extension_settings.objective[currentChatId].hideTasks = $('#objective-hide-tasks').prop('checked') saveSettingsDebounced() } @@ -266,6 +268,11 @@ function onCheckFrequencyInput() { saveState() } +function onHideTasksInput(){ + $('#objective-tasks').prop('hidden',$('#objective-hide-tasks').prop('checked')) + saveState() +} + function loadSettings() { // Load/Init settings for chatId currentChatId = getContext().chatId @@ -290,6 +297,8 @@ function loadSettings() { updateUiTaskList() $('#objective-chat-depth').val(extension_settings.objective[currentChatId].chatDepth) $('#objective-check-frequency').val(extension_settings.objective[currentChatId].checkFrequency) + $('#objective-hide-tasks').prop('checked',extension_settings.objective[currentChatId].hideTasks) + onHideTasksInput() setCurrentTask() } @@ -304,14 +313,15 @@ jQuery(() => {
- - Automatically generate tasks for an objective. Will take a moment and populate tasks below +
+

-
- Messages until next AI task completion check 0 0 to disable auto completion checks + (0 = disabled)
+ Messages until next AI task completion check 0
`; @@ -320,6 +330,7 @@ jQuery(() => { $('#objective-generate').on('click', onGenerateObjectiveClick) $('#objective-chat-depth').on('input',onChatDepthInput) $("#objective-check-frequency").on('input',onCheckFrequencyInput) + $('#objective-hide-tasks').on('click', onHideTasksInput) loadSettings() eventSource.on(event_types.CHAT_CHANGED, () => { diff --git a/public/scripts/extensions/objective/style.css b/public/scripts/extensions/objective/style.css index 05c4eed93..6cfd8f419 100644 --- a/public/scripts/extensions/objective/style.css +++ b/public/scripts/extensions/objective/style.css @@ -1,12 +1,4 @@ #objective-counter { font-weight: 600; color: orange; -} - -/* [id^='objective-task-label-'] { - border: 1px solid var(--white30a); - border-radius: 10px; - padding: 7px; - align-items: center; -} */ - +} \ No newline at end of file