From f2054e703aa01b276a6981dfa9585a1ed685b928 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 10 Dec 2025 23:13:04 +0530 Subject: [PATCH] fix: Handle rich message signatures & attachment overflow (#13045) --- .../components/ActionButtons.vue | 26 +++--- .../components/AttachmentPreviews.vue | 2 +- .../components/ComposeNewConversationForm.vue | 14 +-- .../components/MessageEditor.vue | 11 +-- .../components/widgets/WootWriter/Editor.vue | 2 +- .../widgets/conversation/ReplyBox.vue | 14 ++- app/javascript/dashboard/constants/editor.js | 11 ++- .../dashboard/helper/editorHelper.js | 89 ++++++++++++------ .../helper/specs/editorHelper.spec.js | 91 +++++++++++++++++++ 9 files changed, 197 insertions(+), 63 deletions(-) diff --git a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue index 92c5850de..cb1f9d99d 100644 --- a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue +++ b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue @@ -7,7 +7,7 @@ import { vOnClickOutside } from '@vueuse/components'; import { ALLOWED_FILE_TYPES } from 'shared/constants/messages'; import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents'; import FileUpload from 'vue-upload-component'; -import { extractTextFromMarkdown } from 'dashboard/helper/editorHelper'; +import { INBOX_TYPES } from 'dashboard/helper/inbox'; import Button from 'dashboard/components-next/button/Button.vue'; import WhatsAppOptions from './WhatsAppOptions.vue'; @@ -50,12 +50,6 @@ const EmojiInput = defineAsyncComponent( () => import('shared/components/emoji/EmojiInput.vue') ); -const signatureToApply = computed(() => - props.isEmailOrWebWidgetInbox - ? props.messageSignature - : extractTextFromMarkdown(props.messageSignature) -); - const { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox, @@ -80,12 +74,20 @@ const isRegularMessageMode = computed(() => { return !props.isWhatsappInbox && !props.isTwilioWhatsAppInbox; }); +const isVoiceInbox = computed(() => props.channelType === INBOX_TYPES.VOICE); + +const shouldShowSignatureButton = computed(() => { + return ( + props.hasSelectedInbox && isRegularMessageMode.value && !isVoiceInbox.value + ); +}); + const setSignature = () => { - if (signatureToApply.value) { + if (props.messageSignature) { if (sendWithSignature.value) { - emit('addSignature', signatureToApply.value); + emit('addSignature', props.messageSignature); } else { - emit('removeSignature', signatureToApply.value); + emit('removeSignature', props.messageSignature); } } }; @@ -101,7 +103,7 @@ watch( () => props.hasSelectedInbox, newValue => { nextTick(() => { - if (newValue && props.isEmailOrWebWidgetInbox) setSignature(); + if (newValue && !isVoiceInbox.value) setSignature(); }); }, { immediate: true } @@ -220,7 +222,7 @@ useKeyboardEvents(keyboardEvents); />