diff --git a/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue b/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue index 4ff819d6e..f7d091ec8 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue @@ -1,5 +1,14 @@ - + - + -import { ref } from 'vue'; +import { ref, inject } from 'vue'; import CopilotEditor from 'dashboard/components/widgets/WootWriter/CopilotEditor.vue'; import CaptainLoader from 'dashboard/components/widgets/conversation/copilot/CaptainLoader.vue'; -defineProps({ +const props = defineProps({ showCopilotEditor: { type: Boolean, default: false, @@ -16,6 +16,10 @@ defineProps({ type: String, default: '', }, + placeholder: { + type: String, + default: undefined, + }, }); const emit = defineEmits([ @@ -26,8 +30,15 @@ const emit = defineEmits([ 'send', ]); +const requestEditorHeight = inject('requestEditorHeight', () => {}); + const copilotEditorContent = ref(''); +// The loader needs no room of its own, the suggestion asks for its own +const onStateEnter = () => { + if (props.isGeneratingContent) requestEditorHeight(0); +}; + const onFocus = () => { emit('focus'); }; @@ -47,46 +58,49 @@ const onSend = () => { - - - + + - - - - {{ $t('CONVERSATION.REPLYBOX.COPILOT_THINKING') }} - + + + + + {{ $t('CONVERSATION.REPLYBOX.COPILOT_THINKING') }} + + - - + +