优化: 批A前端(timer所有权+会话族+审批conv-scoped+FilePreview+失败反馈)
A1-B1 timer所有权:新建 useTimerOwnership composable(每实例独立ref+onUnmounted清理)+ useToast _timer 下沉 + Ideas debounce 补清理(治跨实例串扰) A1-B2 FilePreview:reqSeq 双计数器守卫(loadFile/loadDiff 最新seq才写,防乱序覆盖)+ mermaid securityLevel strict + filePath 比对(防跨文件SVG注入) A1-B3 会话族:load_more 滚顶加载接线(switch透传has_more/earliest_seq+prepend去重+scrollTop恢复)+ switch失败保留视图+报错(仅对话不存在才create-new)+ new/delete失败反馈(withConvOp helper收敛)+ delete清ai_messages孤儿 A1-B5前端契约:isToolFailure 三处加 success===false 判定(useToolCard/ToolResultBody/ToolCard,git只读失败不再绿框) A2-B10 审批conv-scoped:pendingApprovals 补conversationId + cleanup 按convId filter + 移除全局清(AiError不再误清其他conv)+ :676 dir auth filter方向修 usage打标前端:is_estimated 字段+事件透传+MessageList『估算』角标(详情面板说明) A2-B9前端:clearChat try/catch 错误气泡
This commit is contained in:
@@ -301,6 +301,19 @@ export const aiApi = {
|
||||
return invoke('ai_conversation_switch', { conversationId })
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载更早历史消息(G3.5 滚顶分页)。
|
||||
* beforeSeq=当前已加载最早消息的 seq(游标,后端返 earliest_seq),返回更早的 PAGE_SIZE 条。
|
||||
* 返 messages JSON 数组 + has_more(是否还有更早)+ earliest_seq(新游标,null=已到尽头)。
|
||||
*/
|
||||
loadMoreMessages(conversationId: string, beforeSeq: number): Promise<{
|
||||
messages: string
|
||||
has_more: boolean
|
||||
earliest_seq: number | null
|
||||
}> {
|
||||
return invoke('ai_conversation_load_more', { conversationId, beforeSeq })
|
||||
},
|
||||
|
||||
/** 删除对话 */
|
||||
deleteConversation(conversationId: string): Promise<void> {
|
||||
return invoke('ai_conversation_delete', { conversationId })
|
||||
|
||||
Reference in New Issue
Block a user