From 8e30ad41fe43a981bdb658b6f43d8da25ccb0927 Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Tue, 30 Jun 2026 17:37:22 -0400 Subject: [PATCH 1/4] Add improve button to text outputs to allow for iteration Signed-off-by: Lukas Schaefer --- .../AssistantTextProcessingForm.vue | 33 +++++++++ src/components/fields/TextInput.vue | 67 ++++++++++++------- 2 files changed, 74 insertions(+), 26 deletions(-) diff --git a/src/components/AssistantTextProcessingForm.vue b/src/components/AssistantTextProcessingForm.vue index c3006e8b..9103550e 100644 --- a/src/components/AssistantTextProcessingForm.vue +++ b/src/components/AssistantTextProcessingForm.vue @@ -215,6 +215,7 @@ import { saveLastSelectedTaskType } from '../assistant.js' const TEXT2TEXT_TASK_TYPE_ID = 'core:text2text' const CHAT_TASK_TYPE_ID = 'chatty-llm' +const TEXT2TEXT_IMPROVE_TASK_TYPE_ID = 'core:text2text:improve' export default { name: 'AssistantTextProcessingForm', @@ -253,6 +254,24 @@ export default { return { providedCurrentTaskId: () => this.selectedTaskId, streaming: () => this.streaming, + improveOutput: (content) => { + if (!this.showImproveWithNewInstructionsButton) { + return + } + this.$emit('new-task') + this.mySelectedTaskTypeId = TEXT2TEXT_IMPROVE_TASK_TYPE_ID + this.$nextTick(() => { + this.$refs?.assistantFormInputs?.setDefaultValues(true) + this.$nextTick(() => { + this.myInputs = { + ...this.myInputs, + input: content, + } + saveLastSelectedTaskType(this.mySelectedTaskTypeId) + }) + }) + }, + canImproveOutput: () => this.showImproveWithNewInstructionsButton, } }, props: { @@ -460,6 +479,20 @@ export default { actionButtonsToShow() { return this.hasOutput ? this.actionButtons : [] }, + contextWriteTaskType() { + const taskType = this.taskTypes.find(tt => tt.id === TEXT2TEXT_IMPROVE_TASK_TYPE_ID) + if (taskType === undefined) { + return null + } + if (this.taskTypeIdList !== null && !this.taskTypeIdList.includes(TEXT2TEXT_IMPROVE_TASK_TYPE_ID)) { + return null + } + return taskType + }, + showImproveWithNewInstructionsButton() { + return this.hasOutput + && this.contextWriteTaskType !== null + }, showRunningEmptyContent() { return this.showSyncTaskRunning && this.myOutputs === null }, diff --git a/src/components/fields/TextInput.vue b/src/components/fields/TextInput.vue index 8372ce86..88ae7c52 100644 --- a/src/components/fields/TextInput.vue +++ b/src/components/fields/TextInput.vue @@ -22,23 +22,33 @@ :title="title" @submit="hasValue && $emit('submit', $event)" @update:model-value="$emit('update:value', $event)" /> - - - - {{ t('assistant', 'Getting results...') }} - - - {{ t('assistant', 'Copy') }} - - +
+ + {{ t('assistant', 'Improve') }} + + + + + {{ t('assistant', 'Getting results...') }} + + + {{ t('assistant', 'Copy') }} + + +
Date: Wed, 1 Jul 2026 09:29:15 -0400 Subject: [PATCH 2/4] Use events instead of provide and rename button to Improve this text Signed-off-by: Lukas Schaefer --- src/components/AssistantFormOutputs.vue | 9 +++- .../AssistantTextProcessingForm.vue | 45 ++++++++++--------- src/components/fields/TaskTypeField.vue | 12 ++++- src/components/fields/TaskTypeFields.vue | 13 +++++- src/components/fields/TextField.vue | 9 +++- src/components/fields/TextInput.vue | 13 ++++-- 6 files changed, 70 insertions(+), 31 deletions(-) diff --git a/src/components/AssistantFormOutputs.vue b/src/components/AssistantFormOutputs.vue index 4a997af2..00bad9df 100644 --- a/src/components/AssistantFormOutputs.vue +++ b/src/components/AssistantFormOutputs.vue @@ -21,8 +21,10 @@ :optional-shape-options="selectedTaskType.optionalOutputShapeEnumValues ?? null" :values="outputs" :show-advanced="showAdvanced" + :can-improve-output="canImproveOutput" @update:values="$emit('update:outputs', $event)" - @update:show-advanced="$emit('update:show-advanced', $event)" /> + @update:show-advanced="$emit('update:show-advanced', $event)" + @improve="$emit('improve', $event)" /> @@ -70,11 +72,16 @@ export default { type: Boolean, default: false, }, + canImproveOutput: { + type: Boolean, + default: false, + }, }, emits: [ 'update:outputs', 'update:show-advanced', + 'improve', ], computed: { diff --git a/src/components/AssistantTextProcessingForm.vue b/src/components/AssistantTextProcessingForm.vue index 9103550e..9ed93390 100644 --- a/src/components/AssistantTextProcessingForm.vue +++ b/src/components/AssistantTextProcessingForm.vue @@ -123,7 +123,9 @@ v-model:show-advanced="showAdvanced" v-model:outputs="myOutputs" :inputs="myInputs" - :selected-task-type="selectedTaskType" /> + :selected-task-type="selectedTaskType" + :can-improve-output="canImproveOutput" + @improve="onImprove" />