M-CHAT-A4 P1 | 切换会话后 scope 标签不更新 #58

Closed
opened 2026-06-06 17:52:50 +08:00 by wangdl · 1 comment
Owner

发现

AIChatPage sessions sheet 允许切换到不同 scope 的会话,但 entryContext 不变,导致:

  • scopeLabel 显示错误范围
  • scopeIcon 显示错误图标

修复方案

loadSession 时从 ChatSession.scopeType/scopeId 重建 ChatEntryContext:

func loadSession(_ id: String) async {
    let msgs = try await RagChatService.shared.getMessages(sessionId: id)
    // 从 session 的 scopeSnapshot 或查询 session 获取 scope 信息
    // 更新 entryContext
}

涉及文件

文件 变更
AIChatViewModel.swift loadSession 更新 entryContext
## 发现 AIChatPage sessions sheet 允许切换到不同 scope 的会话,但 `entryContext` 不变,导致: - scopeLabel 显示错误范围 - scopeIcon 显示错误图标 ### 修复方案 loadSession 时从 ChatSession.scopeType/scopeId 重建 ChatEntryContext: ```swift func loadSession(_ id: String) async { let msgs = try await RagChatService.shared.getMessages(sessionId: id) // 从 session 的 scopeSnapshot 或查询 session 获取 scope 信息 // 更新 entryContext } ``` ### 涉及文件 | 文件 | 变更 | |------|------| | AIChatViewModel.swift | loadSession 更新 entryContext |
wangdl added this to the M-CHAT:AI 会话 Scope 系统重构(iOS 侧) milestone 2026-06-06 17:52:50 +08:00
Author
Owner

修复

loadSession 从 ChatMessage.scopeSnapshot 重建 entryContext,确保 scope 标签正确。
同时修复了问候语区分 scope。

涉及: AIChatViewModel.swift

## 修复 loadSession 从 ChatMessage.scopeSnapshot 重建 entryContext,确保 scope 标签正确。 同时修复了问候语区分 scope。 涉及: AIChatViewModel.swift
Sign in to join this conversation.
No description provided.