Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
Void
3898239ec4 Bound the reply preview: min-width 0 on its flex parents, 2-line clamp, break long words and urls
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m7s
On a 360px phone the reply quote above a message was unbounded and overflowed the screen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:33:44 +00:00
2 changed files with 26 additions and 2 deletions

View file

@ -31,6 +31,7 @@ export const Reply = style({
});
export const ReplyContent = style({
minWidth: 0,
opacity: config.opacity.P300,
selectors: {
@ -39,3 +40,19 @@ export const ReplyContent = style({
},
},
});
export const ReplyText = style({
display: '-webkit-box',
WebkitBoxOrient: 'vertical',
WebkitLineClamp: 2,
overflow: 'hidden',
minWidth: 0,
maxWidth: '100%',
overflowWrap: 'anywhere',
wordBreak: 'break-word',
});
export const ReplyWrap = style({
minWidth: 0,
maxWidth: '100%',
});

View file

@ -101,7 +101,14 @@ export const Reply = as<'div', ReplyProps>(
const bodyJSX = body ? scaleSystemEmoji(trimReplyFromBody(body)) : fallbackBody;
return (
<Box direction="Row" gap="200" alignItems="Center" {...props} ref={ref}>
<Box
className={css.ReplyWrap}
direction="Row"
gap="200"
alignItems="Center"
{...props}
ref={ref}
>
{threadRootId && (
<ThreadIndicator as="button" data-event-id={threadRootId} onClick={onClick} />
)}
@ -119,7 +126,7 @@ export const Reply = as<'div', ReplyProps>(
onClick={onClick}
>
{replyEvent !== undefined ? (
<Text size="T300" truncate>
<Text size="T300" className={css.ReplyText}>
{badEncryption ? <MessageBadEncryptedContent /> : bodyJSX}
</Text>
) : (