From 4eab17155e4a285ed46225d19c5ca513623aedd9 Mon Sep 17 00:00:00 2001 From: gaoziman <2942894660@qq.com> Date: Sun, 21 Dec 2025 02:47:13 +0800 Subject: [PATCH] =?UTF-8?q?style(=E5=AD=97=E4=BD=93):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E7=B3=BB=E7=BB=9F=E4=BD=BF=E7=94=A8=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 ChatInput 和 MessageBubble 中的固定字体大小类 - MarkdownRenderer 标题和内容使用 em 相对单位 - 表格字体大小改为相对单位保持比例 - 聊天输入框添加 z-20 层级避免被代码块遮挡 --- src/app/chat/[id]/page.tsx | 2 +- src/components/features/ChatInput.tsx | 2 +- src/components/features/MessageBubble.tsx | 8 ++++---- src/components/markdown/MarkdownRenderer.tsx | 20 ++++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/chat/[id]/page.tsx b/src/app/chat/[id]/page.tsx index a8c482b..8c98a30 100644 --- a/src/app/chat/[id]/page.tsx +++ b/src/app/chat/[id]/page.tsx @@ -490,7 +490,7 @@ export default function ChatPage({ params }: PageProps) { {/* 固定底部输入框 */}
0 ? '添加描述(可选)...' : placeholder} - className="w-full border-none outline-none text-base text-[var(--color-text-primary)] bg-transparent py-2 placeholder:text-[var(--color-text-placeholder)]" + className="w-full border-none outline-none text-[var(--color-text-primary)] bg-transparent py-2 placeholder:text-[var(--color-text-placeholder)]" />
diff --git a/src/components/features/MessageBubble.tsx b/src/components/features/MessageBubble.tsx index cc9e810..90dc2be 100644 --- a/src/components/features/MessageBubble.tsx +++ b/src/components/features/MessageBubble.tsx @@ -152,7 +152,7 @@ export function MessageBubble({ message, user, thinkingContent, isStreaming, err })} )} -
+
{message.content || ((uploadedImages && uploadedImages.length > 0) || (uploadedDocuments && uploadedDocuments.length > 0) ? '(附件)' : '')}
{/* 悬停显示复制按钮 */} @@ -216,7 +216,7 @@ export function MessageBubble({ message, user, thinkingContent, isStreaming, err {thinkingExpanded && (
-
+                
                   {thinkingContent}
                 
@@ -228,13 +228,13 @@ export function MessageBubble({ message, user, thinkingContent, isStreaming, err {error && (
-
{error}
+
{error}
)} {/* 主要内容 */}
-
+
{message.content ? ( ) : isStreaming ? ( diff --git a/src/components/markdown/MarkdownRenderer.tsx b/src/components/markdown/MarkdownRenderer.tsx index 191a500..a185c70 100644 --- a/src/components/markdown/MarkdownRenderer.tsx +++ b/src/components/markdown/MarkdownRenderer.tsx @@ -48,31 +48,31 @@ const markdownComponents = { ); }, - // 标题 + // 标题 - 使用相对单位保持与全局字体的比例 h1({ children }: { children?: React.ReactNode }) { return ( -

+

{children}

); }, h2({ children }: { children?: React.ReactNode }) { return ( -

+

{children}

); }, h3({ children }: { children?: React.ReactNode }) { return ( -

+

{children}

); }, h4({ children }: { children?: React.ReactNode }) { return ( -

+

{children}

); @@ -95,7 +95,7 @@ const markdownComponents = { }, li({ children }: { children?: React.ReactNode }) { return ( -
  • +
  • {children}
  • ); @@ -136,7 +136,7 @@ const markdownComponents = { // 引用 blockquote({ children }: { children?: React.ReactNode }) { return ( -
    +
    {children}
    ); @@ -153,7 +153,7 @@ const markdownComponents = { table({ children }: { children?: React.ReactNode }) { return (
    - +
    {children}
    @@ -182,14 +182,14 @@ const markdownComponents = { }, th({ children }: { children?: React.ReactNode }) { return ( - + {children} ); }, td({ children }: { children?: React.ReactNode }) { return ( - + {children} );