From f375a2f3cc5a5c30506d7001103efcb3071d570c Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 25 Oct 2026 00:21:06 +0200 Subject: [PATCH] fix(collab): a quoted message wraps to two lines instead of pushing its bubble out of the chat The quote inside a reply sat on one line with an ellipsis, and that unbroken line set the bubble's minimum width, so a long quote pushed the bubble past the edge of the chat and cut its words off. It wraps now and is cut after two lines, on desktop and on the phone. --- client/src/components/Collab/CollabChatBubble.tsx | 12 +++++++++++- client/src/components/Collab/CollabParts.test.tsx | 2 ++ client/src/mobile/screens/trip/tabs/MCollabChat.tsx | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/client/src/components/Collab/CollabChatBubble.tsx b/client/src/components/Collab/CollabChatBubble.tsx index 3d6dff521..0b4fc95ee 100644 --- a/client/src/components/Collab/CollabChatBubble.tsx +++ b/client/src/components/Collab/CollabChatBubble.tsx @@ -140,7 +140,17 @@ export function ChatBubble({ > {reply.name} -
+ {/* Wrapped and cut after two lines: a quote kept on one line set the bubble's width and pushed it out of the chat. */} +
{reply.text}
diff --git a/client/src/components/Collab/CollabParts.test.tsx b/client/src/components/Collab/CollabParts.test.tsx index 33b661622..821351378 100644 --- a/client/src/components/Collab/CollabParts.test.tsx +++ b/client/src/components/Collab/CollabParts.test.tsx @@ -26,6 +26,8 @@ describe('the Collab pieces', () => { expect(quoted.parentElement?.getAttribute('style')).toContain('background: var(--bg-card)'); expect(screen.getByText('Anna')).toBeInTheDocument(); expect(screen.getByText('Train?')).toBeInTheDocument(); + // A long quote wraps instead of setting the bubble's width (it pushed the bubble out of the chat). + expect(screen.getByText('Train?').getAttribute('style')).toContain('white-space: normal'); }); it('FE-COLLAB-PARTS-002: a face is the picture, else the first letter; day, reactions and time draw their children', () => { diff --git a/client/src/mobile/screens/trip/tabs/MCollabChat.tsx b/client/src/mobile/screens/trip/tabs/MCollabChat.tsx index 3334ba05f..46d25a829 100644 --- a/client/src/mobile/screens/trip/tabs/MCollabChat.tsx +++ b/client/src/mobile/screens/trip/tabs/MCollabChat.tsx @@ -331,7 +331,7 @@ function ChatBubbleRow({ msg, own, showHeader, isLastInGroup, marginTop, is12h, {hasReply && (
{msg.reply_username}
-
{msg.reply_text?.slice(0, 80)}
+
{msg.reply_text?.slice(0, 80)}
)} {msg.text}