M-CHAT-A8 P1 | 会话列表不按当前 scope 过滤 #62

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

发现

AIChatPage sessions sheet 的 .task 调用 listSessions() 无参数,始终加载全部会话。

当用户在 material scope 下时,会话列表应过滤显示当前 scope 的会话:

// 当前: 无过滤
RagChatService.shared.listSessions()

// 应为: 按 scope 过滤
if let ctx = entryContext, ctx.scopeType != .global {
    RagChatService.shared.listSessions(scopeType: ctx.scopeType.rawValue, scopeId: ctx.scopeId)
} else {
    RagChatService.shared.listSessions()
}

涉及文件

文件 变更
AIChatPage.swift sessions sheet 的 .task 加上 scope 过滤
## 发现 AIChatPage sessions sheet 的 `.task` 调用 `listSessions()` 无参数,始终加载全部会话。 当用户在 material scope 下时,会话列表应过滤显示当前 scope 的会话: ```swift // 当前: 无过滤 RagChatService.shared.listSessions() // 应为: 按 scope 过滤 if let ctx = entryContext, ctx.scopeType != .global { RagChatService.shared.listSessions(scopeType: ctx.scopeType.rawValue, scopeId: ctx.scopeId) } else { RagChatService.shared.listSessions() } ``` ### 涉及文件 | 文件 | 变更 | |------|------| | AIChatPage.swift | sessions sheet 的 .task 加上 scope 过滤 |
wangdl added this to the M-CHAT:AI 会话 Scope 系统重构(iOS 侧) milestone 2026-06-06 17:54:05 +08:00
Author
Owner

修复

ViewModel 新增 sessionListFilter 计算属性。
sessions sheet 的 .task 根据当前 scope 过滤: 有 scope → listSessions(scopeType:scopeId:),global → 全局列表。

涉及: AIChatViewModel.swift + AIChatPage.swift

## 修复 ViewModel 新增 sessionListFilter 计算属性。 sessions sheet 的 .task 根据当前 scope 过滤: 有 scope → listSessions(scopeType:scopeId:),global → 全局列表。 涉及: AIChatViewModel.swift + AIChatPage.swift
Sign in to join this conversation.
No description provided.