feat: Display story replies with attachment and context label (#13356)
Fixes https://github.com/chatwoot/chatwoot/issues/13354 Fixes https://linear.app/chatwoot/issue/CW-6394/story-responses-are-not-being-shown-in-the-ui When someone replies to your Instagram story, agents in Chatwoot only see the reply text with no story image and no indication that it was a story reply. This makes it impossible to understand what the customer is responding to the message looks like a random text with no context. For example, if a customer replies "Love this!" to your story, the agent just sees "Love this!" with no way to know which story triggered the conversation. This PR fixes the issue by storing the story attachment and adding a context label. <img width="1408" height="2052" alt="CleanShot 2026-01-27 at 19 19 38@2x" src="https://github.com/user-attachments/assets/341afea9-98e3-4e47-b2fa-ef77fe32851f" />
This commit is contained in:
@@ -303,6 +303,7 @@ const componentToRender = computed(() => {
|
||||
const instagramSharedTypes = [
|
||||
ATTACHMENT_TYPES.STORY_MENTION,
|
||||
ATTACHMENT_TYPES.IG_STORY,
|
||||
ATTACHMENT_TYPES.IG_STORY_REPLY,
|
||||
ATTACHMENT_TYPES.IG_POST,
|
||||
];
|
||||
if (instagramSharedTypes.includes(props.contentAttributes.imageType)) {
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useMessageContext } from '../provider.js';
|
||||
import Icon from 'next/icon/Icon.vue';
|
||||
import BaseBubble from 'next/message/bubbles/Base.vue';
|
||||
|
||||
import MessageFormatter from 'shared/helpers/MessageFormatter.js';
|
||||
import { MESSAGE_VARIANTS } from '../constants';
|
||||
import { MESSAGE_VARIANTS, ATTACHMENT_TYPES } from '../constants';
|
||||
|
||||
const emit = defineEmits(['error']);
|
||||
const { variant, content, attachments } = useMessageContext();
|
||||
const { t } = useI18n();
|
||||
const { variant, content, contentAttributes, attachments } =
|
||||
useMessageContext();
|
||||
|
||||
const attachment = computed(() => {
|
||||
return attachments.value[0];
|
||||
});
|
||||
|
||||
const isStoryReply = computed(() => {
|
||||
return contentAttributes.value?.imageType === ATTACHMENT_TYPES.IG_STORY_REPLY;
|
||||
});
|
||||
|
||||
const hasImgStoryError = ref(false);
|
||||
const hasVideoStoryError = ref(false);
|
||||
|
||||
@@ -38,6 +45,9 @@ const onVideoLoadError = () => {
|
||||
|
||||
<template>
|
||||
<BaseBubble class="p-3 overflow-hidden" data-bubble-name="ig-story">
|
||||
<p v-if="isStoryReply" class="mb-1 text-xs text-n-slate-11">
|
||||
{{ t('COMPONENTS.FILE_BUBBLE.INSTAGRAM_STORY_REPLY') }}
|
||||
</p>
|
||||
<div v-if="content" v-dompurify-html="formattedContent" class="mb-2" />
|
||||
<img
|
||||
v-if="!hasImgStoryError"
|
||||
|
||||
@@ -52,6 +52,7 @@ export const ATTACHMENT_TYPES = {
|
||||
EMBED: 'embed',
|
||||
IG_POST: 'ig_post',
|
||||
IG_STORY: 'ig_story',
|
||||
IG_STORY_REPLY: 'ig_story_reply',
|
||||
};
|
||||
|
||||
export const CONTENT_TYPES = {
|
||||
|
||||
@@ -273,7 +273,8 @@
|
||||
"FILE_BUBBLE": {
|
||||
"DOWNLOAD": "Download",
|
||||
"UPLOADING": "Uploading...",
|
||||
"INSTAGRAM_STORY_UNAVAILABLE": "This story is no longer available."
|
||||
"INSTAGRAM_STORY_UNAVAILABLE": "This story is no longer available.",
|
||||
"INSTAGRAM_STORY_REPLY": "Replied to your story:"
|
||||
},
|
||||
"LOCATION_BUBBLE": {
|
||||
"SEE_ON_MAP": "See on map"
|
||||
|
||||
Reference in New Issue
Block a user