From a7c61d9306e4df2be9479f8c8ccd995cfb76e120 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 30 Nov 2025 00:32:08 +0800 Subject: [PATCH] =?UTF-8?q?ui:=20=E4=B8=8D=E5=86=8D=E4=B8=BA=E6=AF=8F?= =?UTF-8?q?=E4=B8=AA=E6=B6=88=E6=81=AF=E6=98=BE=E7=A4=BA=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=94=A8=E6=88=B7=20*=20=E5=90=88=E5=B9=B6=E6=98=BE=E7=A4=BA,?= =?UTF-8?q?=20=E4=BD=86=E4=B8=8D=E5=AE=8C=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/chat/ChatFragment.tsx | 1 + client/ui/chat/Message.tsx | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 89d2c23..70c76f8 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -469,6 +469,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC ], }) }} /> : { - userId: string - rawData: string - renderHTML: string - message: Data_Message - openUserInfoDialog: (user: User | string) => void -} - function prettyFlatParsedMessage(html: string) { const elements = new DOMParser().parseFromString(html, 'text/html').body.children // 纯文本直接处理 @@ -72,7 +64,16 @@ function prettyFlatParsedMessage(html: string) { return ret } -export default function Message({ userId, rawData, renderHTML, message, openUserInfoDialog, ...props }: Args) { +interface Args extends React.HTMLAttributes { + userId: string + noUserDisplay?: boolean + rawData: string + renderHTML: string + message: Data_Message + openUserInfoDialog: (user: User | string) => void +} + +export default function Message({ userId, rawData, renderHTML, message, openUserInfoDialog, noUserDisplay, ...props }: Args) { const isAtRight = Client.myUserProfile?.id == userId const [nickName, setNickName] = React.useState("") @@ -123,7 +124,7 @@ export default function Message({ userId, rawData, renderHTML, message, openUser {...props}>
{ @@ -168,7 +169,7 @@ export default function Message({ userId, rawData, renderHTML, message, openUser maxWidth: 'var(--whitesilk-widget-message-maxwidth)', // (window.matchMedia('(pointer: fine)') && "50%") || (window.matchMedia('(pointer: coarse)') && "77%"), minWidth: "0%", [isAtRight ? "marginRight" : "marginLeft"]: "55px", - marginTop: "-5px", + marginTop: noUserDisplay ? '5px' : "-5px", alignSelf: isAtRight ? "flex-end" : "flex-start", // boxShadow: isUsingFullDisplay ? 'inherit' : 'var(--mdui-elevation-level1)', // padding: isUsingFullDisplay ? undefined : "13px",