新增: AI Chat多项增强(审批去重/编辑重发/导出/实体引用/会话置顶搜索)+任务推进链df-nodes落地

This commit is contained in:
2026-06-16 12:41:13 +08:00
parent 212a927eee
commit 7d5cd4c89a
62 changed files with 4576 additions and 248 deletions

View File

@@ -67,7 +67,9 @@ export async function switchConversation(id: string) {
}
state.messages = rawMsgs
.filter((m: any) => m.role !== 'tool')
// 过滤 tool 消息 + truncated 软删消息(UX-09:编辑某条 user 后其后消息标 truncated,
// 保留 DB 可追溯但从视图移除;前端无 status 字段故按原始 JSON 字段过滤)
.filter((m: any) => m.role !== 'tool' && m.status !== 'truncated')
.map((m: any, i: number) => ({
id: `loaded-${i}`,
role: m.role,
@@ -170,6 +172,15 @@ async function archiveConversation(id: string, archived: boolean) {
notifyConversationChanged()
}
/** 置顶/取消置顶(后端 + 本地侧栏排序同步;UX-17) */
async function setPinnedConversation(id: string, pinned: boolean) {
await aiApi.setPinnedConversation(id, pinned)
// 本地同步置顶态(排序 computed 读 pinned,立即重排)
const conv = state.conversations.find(c => c.id === id)
if (conv) conv.pinned = pinned
notifyConversationChanged()
}
/** 折叠/展开归档分组 */
function toggleArchivedFold() {
state.archivedCollapsed = !state.archivedCollapsed
@@ -190,6 +201,7 @@ export function useAiConversations() {
deleteConversation,
renameConversation,
archiveConversation,
setPinnedConversation,
toggleArchivedFold,
toggleSidebar,
}