Skip to content

Commit

Permalink
feat(assistant): inject 'insert' button when displaying a task result
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc authored and juliusknorr committed Aug 7, 2024
1 parent 2996339 commit eacd109
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/Assistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,19 @@ export default {
emit('text:translate-modal:show', { content: this.selection || '' })
},
async openResult(task) {
window.OCA.Assistant.openAssistantTask(task)
window.OCA.Assistant.openAssistantTask(task, {
isInsideViewer: true,
actionButtons: [
{
type: 'primary',
title: t('text', 'Insert result'),
label: t('text', 'Insert result'),
onClick: (lastTask) => {
this.insertResult(lastTask)
},
},
],
})
},
async insertResult(task) {
this.$editor.commands.insertContent(task.output.output)
Expand Down

0 comments on commit eacd109

Please sign in to comment.