diff --git a/app/canvas/[id]/page.tsx b/app/canvas/[id]/page.tsx
index 9a03257..2b349f7 100644
--- a/app/canvas/[id]/page.tsx
+++ b/app/canvas/[id]/page.tsx
@@ -516,7 +516,11 @@ export default function CanvasEditorPage({ params }: PageProps) {
{panelMode === 'chat' ? (
// AI 对话内容
- setIsPanelOpen(false)} />
+ setIsPanelOpen(false)}
+ onOpenFileList={() => setPanelMode('fileList')}
+ />
) : (
// 文件列表
diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx
index 0601e1d..087868a 100644
--- a/components/canvas/CanvasChatPanel.tsx
+++ b/components/canvas/CanvasChatPanel.tsx
@@ -27,6 +27,7 @@ interface CanvasChatPanelProps {
chatId: string;
initialMessages?: ChatMessage[];
onClose?: () => void;
+ onOpenFileList?: () => void;
}
// 建议卡片数据 - 已移除
@@ -55,7 +56,7 @@ function extractImageUrls(text: string): string[] {
return urls;
}
-export function CanvasChatPanel({ chatId, initialMessages = [], onClose }: CanvasChatPanelProps) {
+export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenFileList }: CanvasChatPanelProps) {
const [input, setInput] = useState("");
const [attachments, setAttachments] = useState([]);
const [selectedModelId, setSelectedModelId] = useState("");
@@ -326,7 +327,13 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose }: Canva
-
{/* 无限画布 */}
- {
+ {
+ e.preventDefault();
+ e.stopPropagation();
const newId = crypto.randomUUID();
- window.location.href = `/canvas/${newId}`;
+ router.push(`/canvas/${newId}`);
}}
type="button"
title="无限画布"
>
- 无限画布
-
+ 无限画布
+
{/* 我的图册 */}
- {
+ e.preventDefault();
+ e.stopPropagation();
+ router.push("/gallery");
+ }}
+ type="button"
+ title="我的图册"
>
- 我的图册
-
+ 我的图册
+
{/* 分隔线 (如果有链接或图册按钮,且是管理员) */}
{isAdmin && (
@@ -280,13 +300,20 @@ export function TopNavbar({
{/* 系统设置(仅管理员可见)*/}
{isAdmin && (
- {
+ e.preventDefault();
+ e.stopPropagation();
+ router.push("/settings");
+ }}
+ type="button"
title="系统设置"
>
-
+
)}