From b7a83dcbcd4d9d04257bc79a172bcaea5662d7c2 Mon Sep 17 00:00:00 2001 From: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:46:16 -0800 Subject: [PATCH] feat: Add a placeholder for image attachments in conversations view (#8969) We analyze an image to get it's height and width. On the frontend, we would show a placeholder with the corresponding width and height until the images are loaded properly. --------- Co-authored-by: Shivam Mishra --- .../widgets/conversation/Message.vue | 3 ++- .../conversation/bubble/ImageAudioVideo.vue | 19 +++++++++++++++---- app/models/attachment.rb | 4 +++- .../conversations/attachments.json.jbuilder | 2 ++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index e6890535b..8c57b6fc2 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -577,7 +577,8 @@ export default { > img, > video { - @apply rounded-lg; + /** ensure that the bubble radius and image radius match*/ + @apply rounded-[0.4rem]; } > video { diff --git a/app/javascript/dashboard/components/widgets/conversation/bubble/ImageAudioVideo.vue b/app/javascript/dashboard/components/widgets/conversation/bubble/ImageAudioVideo.vue index 22ea61405..a105b63aa 100644 --- a/app/javascript/dashboard/components/widgets/conversation/bubble/ImageAudioVideo.vue +++ b/app/javascript/dashboard/components/widgets/conversation/bubble/ImageAudioVideo.vue @@ -2,20 +2,23 @@