From 587dc8dfe89fa69e6f291a4543e9e4ad16fdaf81 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 17 Apr 2026 14:24:42 -0500 Subject: [PATCH] Squash carousel in chat messages, fix rounding (#10286) --- src/components/Post/Embed/index.tsx | 16 ++++++---------- src/components/Post/Embed/types.ts | 5 +---- src/components/dms/MessageItemEmbed.tsx | 4 ++-- src/components/images/Gallery/index.tsx | 12 ++++++++---- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/components/Post/Embed/index.tsx b/src/components/Post/Embed/index.tsx index c9dae73a7e..0c3106c1b9 100644 --- a/src/components/Post/Embed/index.tsx +++ b/src/components/Post/Embed/index.tsx @@ -39,12 +39,11 @@ import {PostPlaceholder as PostPlaceholderText} from './PostPlaceholder' import { type CommonProps, type EmbedProps, - PostEmbedViewContext, - QuoteEmbedViewContext, + type PostEmbedViewContext, } from './types' import {VideoEmbed} from './VideoEmbed' -export {PostEmbedViewContext, QuoteEmbedViewContext} from './types' +export {PostEmbedViewContext} from './types' export function Embed({embed: rawEmbed, ...rest}: EmbedProps) { const embed = parseEmbed(rawEmbed) @@ -164,11 +163,7 @@ function RecordEmbed({ @@ -229,9 +224,10 @@ export function QuoteEmbed({ linkDisabled, isWithinQuote: parentIsWithinQuote, allowNestedQuotes: parentAllowNestedQuotes, + viewContext, }: Omit & { embed: EmbedType<'post'> - viewContext?: QuoteEmbedViewContext + viewContext?: PostEmbedViewContext linkDisabled?: boolean }) { const moderationOpts = useModerationOpts() @@ -309,7 +305,7 @@ export function QuoteEmbed({ { + if (isWithinChat) { + return 120 + } if (bps.gtMobile) { return 300 } else if (bps.gtPhone) { @@ -111,10 +118,7 @@ export function Gallery({ } else { return 200 } - }, [bps]) - const isWithinQuote = - viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia - const hideBadges = isWithinQuote + }, [bps, isWithinChat]) /* * Container overflow styles