diff --git a/BillNote_frontend/src/pages/HomePage/components/MarkdownHeader.tsx b/BillNote_frontend/src/pages/HomePage/components/MarkdownHeader.tsx index 631dc3b..4cccbba 100644 --- a/BillNote_frontend/src/pages/HomePage/components/MarkdownHeader.tsx +++ b/BillNote_frontend/src/pages/HomePage/components/MarkdownHeader.tsx @@ -1,7 +1,7 @@ 'use client' import { useEffect, useState } from 'react' -import { Copy, Download, BrainCircuit, MessageSquare } from 'lucide-react' +import { Copy, Download, BrainCircuit, MessageSquare, PanelRight, Maximize2 } from 'lucide-react' import { Button } from '@/components/ui/button' import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select' import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip' @@ -28,8 +28,8 @@ interface NoteHeaderProps { onDownload: () => void createAt?: string | Date setShowTranscribe: (show: boolean) => void - showChat?: boolean - setShowChat?: (show: boolean) => void + showChat?: false | 'half' | 'full' + setShowChat?: (mode: false | 'half' | 'full') => void } export function MarkdownHeader({ @@ -188,22 +188,40 @@ export function MarkdownHeader({ {setShowChat && ( - - - - - - 基于笔记内容的 AI 问答 - - +
+ + + + + + 侧边问答(半屏) + + + + + + + + 全屏问答 + + +
)} diff --git a/BillNote_frontend/src/pages/HomePage/components/MarkdownViewer.tsx b/BillNote_frontend/src/pages/HomePage/components/MarkdownViewer.tsx index a9e8d6a..68e5887 100644 --- a/BillNote_frontend/src/pages/HomePage/components/MarkdownViewer.tsx +++ b/BillNote_frontend/src/pages/HomePage/components/MarkdownViewer.tsx @@ -61,7 +61,7 @@ const MarkdownViewer: FC = ({ status }) => { const retryTask = useTaskStore.getState().retryTask const isMultiVersion = Array.isArray(currentTask?.markdown) const [showTranscribe, setShowTranscribe] = useState(false) - const [showChat, setShowChat] = useState(false) + const [showChat, setShowChat] = useState(false) const [viewMode, setViewMode] = useState<'map' | 'preview'>('preview') const svgRef = useRef(null) // 多版本内容处理 @@ -221,6 +221,13 @@ const MarkdownViewer: FC = ({ status }) => {
{selectedContent && selectedContent !== 'loading' && selectedContent !== 'empty' ? ( <> + {/* 全屏问答模式:隐藏 markdown,ChatPanel 占满 */} + {showChat === 'full' && currentTask ? ( +
+ +
+ ) : ( + <>
= ({ status }) => {
)} - {showChat && currentTask && ( -
+ {/* 侧边问答模式:markdown + ChatPanel 各占一半 */} + {showChat === 'half' && currentTask && ( +
)} + + )} ) : (