Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(conversation): align user rich text line height with LexicalRenderer (#13312)

Innei9b7beca85ebd
diff --git a/src/features/Conversation/Messages/User/components/RichTextMessage.tsx b/src/features/Conversation/Messages/User/components/RichTextMessage.tsx
index eed561031b2..55351d2918e 100644
--- a/src/features/Conversation/Messages/User/components/RichTextMessage.tsx
+++ b/src/features/Conversation/Messages/User/components/RichTextMessage.tsx
@@ -1,5 +1,6 @@
import { LexicalRenderer } from '@lobehub/editor/renderer';
import type { SerializedEditorState } from 'lexical';
+import type { CSSProperties } from 'react';
import { memo, useMemo } from 'react';
import { ActionTagNode } from '@/features/ChatInput/InputEditor/ActionTag/ActionTagNode';
@@ -9,6 +10,8 @@ interface RichTextMessageProps {
editorState: unknown;
}
+const LINE_HEIGHT = 1.6;
+const style: CSSProperties = { '--common-line-height': LINE_HEIGHT } as CSSProperties;
const EXTRA_NODES = [ActionTagNode, ReferTopicNode];
const RichTextMessage = memo<RichTextMessageProps>(({ editorState }) => {
@@ -20,7 +23,7 @@ const RichTextMessage = memo<RichTextMessageProps>(({ editorState }) => {
if (!value) return null;
- return <LexicalRenderer extraNodes={EXTRA_NODES} value={value} variant="chat" />;
+ return <LexicalRenderer extraNodes={EXTRA_NODES} style={style} value={value} variant="chat" />;
});
RichTextMessage.displayName = 'RichTextMessage';