feat(页面): 聊天页面集成智能摘要功能
- 在工具栏添加智能摘要按钮 - 优化主内容区背景色样式 - 调整底部输入框背景样式
This commit is contained in:
parent
94d97ace04
commit
7d7678084f
@ -13,6 +13,7 @@ import { PromptOptimizer } from '@/components/features/PromptOptimizer';
|
|||||||
import { LinkPreviewModal } from '@/components/features/LinkPreviewModal';
|
import { LinkPreviewModal } from '@/components/features/LinkPreviewModal';
|
||||||
import { ExportDropdown } from '@/components/features/ExportDropdown';
|
import { ExportDropdown } from '@/components/features/ExportDropdown';
|
||||||
import { ShareModal } from '@/components/features/ShareModal';
|
import { ShareModal } from '@/components/features/ShareModal';
|
||||||
|
import { SummaryButton } from '@/components/features/SummaryGenerator';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { useConversation, useConversations } from '@/hooks/useConversations';
|
import { useConversation, useConversations } from '@/hooks/useConversations';
|
||||||
import { useStreamChat, type ChatMessage } from '@/hooks/useStreamChat';
|
import { useStreamChat, type ChatMessage } from '@/hooks/useStreamChat';
|
||||||
@ -441,7 +442,7 @@ export default function ChatPage({ params }: PageProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen">
|
<div className="flex min-h-screen bg-[var(--color-bg-secondary)]">
|
||||||
{/* 侧边栏 */}
|
{/* 侧边栏 */}
|
||||||
<Sidebar
|
<Sidebar
|
||||||
isOpen={sidebarOpen}
|
isOpen={sidebarOpen}
|
||||||
@ -451,7 +452,7 @@ export default function ChatPage({ params }: PageProps) {
|
|||||||
{/* 主内容区 */}
|
{/* 主内容区 */}
|
||||||
<main
|
<main
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex-1 flex flex-col min-h-screen transition-all duration-300',
|
'flex-1 flex flex-col min-h-screen transition-all duration-300 bg-[var(--color-bg-secondary)]',
|
||||||
sidebarOpen ? 'ml-[var(--sidebar-width)]' : 'ml-0'
|
sidebarOpen ? 'ml-[var(--sidebar-width)]' : 'ml-0'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@ -557,6 +558,17 @@ export default function ChatPage({ params }: PageProps) {
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* 智能摘要按钮 */}
|
||||||
|
<SummaryButton
|
||||||
|
conversationId={chatId}
|
||||||
|
messages={messages.map(m => ({
|
||||||
|
role: m.role,
|
||||||
|
content: m.content,
|
||||||
|
}))}
|
||||||
|
hasSummary={!!conversation?.summary}
|
||||||
|
existingSummary={conversation?.summary}
|
||||||
|
/>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setShareModalOpen(true)}
|
onClick={() => setShareModalOpen(true)}
|
||||||
className="flex items-center gap-2 px-3 py-1.5 text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] rounded-lg transition-colors"
|
className="flex items-center gap-2 px-3 py-1.5 text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] rounded-lg transition-colors"
|
||||||
@ -659,12 +671,7 @@ export default function ChatPage({ params }: PageProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 固定底部输入框 */}
|
{/* 固定底部输入框 */}
|
||||||
<div
|
<div className="sticky bottom-0 pt-4 z-20 bg-[var(--color-bg-secondary)]">
|
||||||
className="sticky bottom-0 pt-4 z-20"
|
|
||||||
style={{
|
|
||||||
background: `linear-gradient(to top, var(--color-bg-secondary) 0%, var(--color-bg-secondary) 80%, transparent 100%)`
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="max-w-[900px] mx-auto px-4 pb-4 pl-[60px]">
|
<div className="max-w-[900px] mx-auto px-4 pb-4 pl-[60px]">
|
||||||
{isStreaming && (
|
{isStreaming && (
|
||||||
<div className="flex justify-center mb-3">
|
<div className="flex justify-center mb-3">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user