From c2a851c7560a0f50f826d9c6709f4bca23ce8155 Mon Sep 17 00:00:00 2001 From: Muhsin <12408980+muhsin-k@users.noreply.github.com> Date: Mon, 20 Apr 2026 13:36:26 +0400 Subject: [PATCH] refactor(voice): read call state from message.call on the frontend - VoiceCall bubble, voice.js helper, ConversationCard, and the store mutation all switch from message.content_attributes.data to message.call. - Message.vue gains a `call` prop that's provided through useMessageContext for the bubble. - UPDATE_MESSAGE_CALL_STATUS mutation now updates message.call.status, matched by provider_call_id. - content_attributes.data is still emitted by the backend for this commit; backend-side trim lands in a follow-up. --- .../components-next/message/Message.vue | 1 + .../message/bubbles/VoiceCall.vue | 10 ++-- .../widgets/conversation/ConversationCard.vue | 9 ++- app/javascript/dashboard/helper/voice.js | 8 +-- .../store/modules/conversations/index.js | 10 +--- .../conversations/specs/mutations.spec.js | 60 +++++++++++++------ 6 files changed, 59 insertions(+), 39 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index 3de9d2d04..d738bfcc6 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -113,6 +113,7 @@ const props = defineProps({ validator: value => Object.values(MESSAGE_STATUS).includes(value), }, attachments: { type: Array, default: () => [] }, + call: { type: Object, default: null }, // eslint-disable-line vue/no-unused-properties content: { type: String, default: null }, contentAttributes: { type: Object, default: () => ({}) }, contentType: { diff --git a/app/javascript/dashboard/components-next/message/bubbles/VoiceCall.vue b/app/javascript/dashboard/components-next/message/bubbles/VoiceCall.vue index 5a7d39a4e..a270882ac 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/VoiceCall.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/VoiceCall.vue @@ -1,7 +1,7 @@