fix(data): 清理旧数据并保护服务端写入

This commit is contained in:
Script Generator
2026-07-02 09:30:50 +08:00
parent 28e0c6de19
commit 916bd17a48
38 changed files with 1346 additions and 194 deletions

View File

@@ -70,18 +70,10 @@ const STARTER_QUESTIONS = getFallbackHelpSuggestions();
type WenfanConversation = WenfanConversationRecord<ChatMessage>;
const INITIAL_CONVERSATIONS: WenfanConversation[] = [
{ id: 'history-product-create', title: '怎么新建产品?', messages: INITIAL_MESSAGES },
{ id: 'history-version-requirements', title: '怎么把需求纳入版本?', messages: INITIAL_MESSAGES },
{ id: 'history-dev-task-submit', title: '开发任务怎么提测?', messages: INITIAL_MESSAGES },
{ id: 'history-test-bug', title: '测试用例失败后怎么提 Bug', messages: INITIAL_MESSAGES },
{ id: 'history-activity-log', title: '日志记录会记录哪些行为?', messages: INITIAL_MESSAGES },
];
export default function WenfanXiaobaoPage() {
const [messages, setMessages] = useState<ChatMessage[]>(INITIAL_MESSAGES);
const [input, setInput] = useState('');
const [conversations, setConversations] = useState<WenfanConversation[]>(INITIAL_CONVERSATIONS);
const [conversations, setConversations] = useState<WenfanConversation[]>([]);
const [activeConversationId, setActiveConversationId] = useState<string | null>(null);
const visibleHistory = useMemo(() => conversations.slice(0, 12), [conversations]);