From 28cc3da3ccce3db84599745e82ef74ff5722c8ad Mon Sep 17 00:00:00 2001 From: Void Date: Tue, 10 Nov 2026 19:22:26 +0000 Subject: [PATCH] message: a long reply quote stays inside its column (own and received); demo gets a long quote to reply to The row around a bubble sized to its content in a right-aligned column, and the quote's nowrap text made that content 782px, so on a phone the column ran off the left edge. The row, column and bubble now carry minWidth 0 / maxWidth 100%, and ReplyContent minWidth 0 so the quote truncates. Starfire 390x844: own quote 782px at left -425 -> 332px at left 25; desktop inside the bubble. No test yet. Co-Authored-By: Claude Sonnet 5.5 --- src/app/components/message/Reply.css.ts | 1 + src/app/components/message/layout/Bubble.tsx | 8 ++++-- .../components/message/layout/layout.css.ts | 16 ++++++++++- src/preview-demo/fixtures.ts | 10 +++++++ src/preview-demo/server.ts | 28 +++++++++++-------- 5 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/app/components/message/Reply.css.ts b/src/app/components/message/Reply.css.ts index 7e5540fd..33af41a9 100644 --- a/src/app/components/message/Reply.css.ts +++ b/src/app/components/message/Reply.css.ts @@ -31,6 +31,7 @@ export const Reply = style({ }); export const ReplyContent = style({ + minWidth: 0, opacity: config.opacity.P300, selectors: { diff --git a/src/app/components/message/layout/Bubble.tsx b/src/app/components/message/layout/Bubble.tsx index 066a827f..d5293d2e 100644 --- a/src/app/components/message/layout/Bubble.tsx +++ b/src/app/components/message/layout/Bubble.tsx @@ -67,7 +67,11 @@ export const BubbleLayout = as<'div', BubbleLayoutProps>( {header && (
( {hideBubble ? ( children ) : ( - + number = Date.now): DemoServer => { ROOMS.forEach((room) => { stateOf.set(room.id, buildState(room)); + const lineIds: string[] = []; room.lines.forEach((l) => { + const event = mk( + 'm.room.message', + l.from, + { + msgtype: 'm.text', + body: l.body, + ...(l.html ? { format: 'org.matrix.custom.html', formatted_body: l.html } : {}), + ...(l.pose ? { [POSE_KEY]: l.pose } : {}), + ...(l.replyTo === undefined + ? {} + : { 'm.relates_to': { 'm.in_reply_to': { event_id: lineIds[l.replyTo] } } }), + }, + now() - l.minutesAgo * 60 * 1000 + ); + lineIds.push(event.event_id); timeline.push({ version: 1, roomId: room.id, - event: mk( - 'm.room.message', - l.from, - { - msgtype: 'm.text', - body: l.body, - ...(l.html ? { format: 'org.matrix.custom.html', formatted_body: l.html } : {}), - ...(l.pose ? { [POSE_KEY]: l.pose } : {}), - }, - now() - l.minutesAgo * 60 * 1000 - ), + event, }); }); });