diff --git a/src/web/features/chat/ChatPage.tsx b/src/web/features/chat/ChatPage.tsx index bcae78f..11ee400 100644 --- a/src/web/features/chat/ChatPage.tsx +++ b/src/web/features/chat/ChatPage.tsx @@ -1,7 +1,7 @@ -import { DeleteOutlined, MoreOutlined } from "@ant-design/icons"; +import { DeleteOutlined, MoreOutlined, PlusOutlined } from "@ant-design/icons"; import { Conversations } from "@ant-design/x"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { App, Spin } from "antd"; +import { App, Button, Spin } from "antd"; import { useMemo, useState } from "react"; import type { Conversation } from "../../../shared/api"; @@ -52,23 +52,30 @@ export function ChatPage() { return (
+
+ +
{isLoading ? ( ) : ( { - void createConversation(project.id, defaultModelId ?? undefined) - .then((conv) => { - void queryClient.invalidateQueries({ queryKey: CONVERSATIONS_KEY }); - setActiveConversationId(conv.id); - }) - .catch((err: Error) => { - void message.error(`创建会话失败:${err.message}`); - }); - }, - }} items={conversations} menu={(conv) => ({ items: [ @@ -85,6 +92,7 @@ export function ChatPage() { trigger: , })} onActiveChange={(key) => setActiveConversationId(key)} + rootClassName="app-chat-conversations-list" /> )}
diff --git a/src/web/styles.css b/src/web/styles.css index 57827b3..2f6c209 100644 --- a/src/web/styles.css +++ b/src/web/styles.css @@ -90,6 +90,16 @@ body { background: var(--ant-color-bg-container); } +.app-chat-conversations-header { + padding: var(--ant-padding-sm); + border-bottom: 1px solid var(--ant-color-border-secondary); +} + +.app-chat-conversations-list { + flex: 1; + min-height: 0; +} + .app-chat-panel { display: flex; flex: 1;