From 1e25774541461c86da5c4af8efec792e2814eeb1 Mon Sep 17 00:00:00 2001 From: oleg Date: Fri, 29 Nov 2024 11:24:17 +0100 Subject: [PATCH] feat(editor): Canvas chat UI & UX improvements (#11924) --- packages/@n8n/chat/src/components/Input.vue | 25 ++-- packages/@n8n/chat/src/components/Message.vue | 6 +- packages/@n8n/chat/src/css/markdown.scss | 16 ++- .../nodes-langchain/utils/descriptions.ts | 2 +- .../components/CanvasChat/CanvasChat.test.ts | 124 ++++++++++-------- .../src/components/CanvasChat/CanvasChat.vue | 88 +++++++++---- .../components/ChatMessagesPanel.vue | 93 +++++++------ .../composables/useChatMessaging.ts | 63 ++++----- .../ExpressionEditorModalInput.vue | 2 +- .../InlineExpressionEditorInput.vue | 2 +- .../RunDataAi/AiRunContentBlock.vue | 7 +- .../src/components/RunDataAi/RunDataAi.vue | 18 +-- .../elements/buttons/CanvasChatButton.vue | 9 +- .../CanvasChatButton.test.ts.snap | 6 +- .../src/plugins/i18n/locales/en.json | 1 + packages/editor-ui/src/views/NodeView.v2.vue | 3 +- packages/editor-ui/src/views/NodeView.vue | 5 +- 17 files changed, 258 insertions(+), 212 deletions(-) diff --git a/packages/@n8n/chat/src/components/Input.vue b/packages/@n8n/chat/src/components/Input.vue index 4abfc76849c1d..1b9e0b96081d6 100644 --- a/packages/@n8n/chat/src/components/Input.vue +++ b/packages/@n8n/chat/src/components/Input.vue @@ -38,12 +38,12 @@ const isSubmitting = ref(false); const resizeObserver = ref(null); const isSubmitDisabled = computed(() => { - return input.value === '' || waitingForResponse.value || options.disabled?.value === true; + return input.value === '' || unref(waitingForResponse) || options.disabled?.value === true; }); const isInputDisabled = computed(() => options.disabled?.value === true); const isFileUploadDisabled = computed( - () => isFileUploadAllowed.value && waitingForResponse.value && !options.disabled?.value, + () => isFileUploadAllowed.value && unref(waitingForResponse) && !options.disabled?.value, ); const isFileUploadAllowed = computed(() => unref(options.allowFileUploads) === true); const allowedFileTypes = computed(() => unref(options.allowedFilesMimeTypes)); @@ -194,10 +194,13 @@ function adjustHeight(event: Event) {