style: 引用消息文本溢出

This commit is contained in:
Wxw-Gu committed 2026-10-15 15:37:05 +08:00
1 parent 0d78ad3f54
commit a799fc1490
4 files changed
+186 -4

No files matched your search

@@ -382,12 +382,18 @@ function QuoteBubble({
}): JSX.Element {
const quotedText = data.quotedContent || data.content || '[引用消息]'
const replyText = data.content || data.title || ''
const quotedSender = data.quotedSender || data.sender || ''
// 空白 sender 不渲染:否则只剩下 `.quoted-sender::after` 的冒号,看着像乱码。
const quotedSender = String(data.quotedSender || data.sender || '').trim()
const hasQuotedImage = Boolean(data.quotedImageMd5 || data.quotedImageDatName)
// 引用框里只放一行(超出用省略号),全文交给 hover 的 title 兜底。
const quotedTitle = quotedSender ? `${quotedSender}: ${quotedText}` : quotedText
return (
<div className="quote-message">
<div className={`quoted-message${hasQuotedImage ? ' quoted-message-image' : ''}`}>
<div
className={`quoted-message${hasQuotedImage ? ' quoted-message-image' : ''}`}
title={quotedTitle}
>
{quotedSender && <span className="quoted-sender">{quotedSender}</span>}
{hasQuotedImage ? (
<ImageBubble
+10 -2
View File
@@ -1739,8 +1739,11 @@
}
.quoted-sender {
flex: 0 1 auto;
// 名字优先:两个 flex 项都按比例收缩时,长引用会把名字压成半个字(只剩一个冒号),
// 所以名字固定不参与收缩,只用 max-width 限制它最多占六成,剩下的留给正文。
flex: 0 0 auto;
min-width: 0;
max-width: 60%;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
@@ -1752,7 +1755,12 @@
}
.quoted-text {
flex: 0 0 auto;
// 收缩全部落在正文上(名字已固定),单行省略;全文由引用框的 title 兜底。
flex: 0 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.quote-reply {