From f6bef532520a703f66757759a37cf0f166cddc00 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 22 Dec 2025 19:45:35 +0530 Subject: [PATCH] feat: add force align to message component --- .../dashboard/components-next/message/Message.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index 4445e9352..17cd47887 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -130,6 +130,11 @@ const props = defineProps({ senderId: { type: Number, default: null }, senderType: { type: String, default: null }, sourceId: { type: String, default: '' }, // eslint-disable-line vue/no-unused-properties + forceAlignTo: { + type: String, + default: null, + validator: value => value === null || ['left', 'right'].includes(value), + }, }); const emit = defineEmits(['retry']); @@ -212,12 +217,16 @@ const isBotOrAgentMessage = computed(() => { * @returns {import('vue').ComputedRef<'left'|'right'|'center'>} The computed orientation */ const orientation = computed(() => { + if (props.messageType === MESSAGE_TYPES.ACTIVITY) return ORIENTATION.CENTER; + + if (props.forceAlignTo) { + return props.forceAlignTo === 'left' ? ORIENTATION.LEFT : ORIENTATION.RIGHT; + } + if (isBotOrAgentMessage.value) { return ORIENTATION.RIGHT; } - if (props.messageType === MESSAGE_TYPES.ACTIVITY) return ORIENTATION.CENTER; - return ORIENTATION.LEFT; });