feat: 添加消息删除模式 - #209
Open
Georgyhongbo wants to merge 1 commit into
Open
Conversation
- 添加删除模式,支持选择单条/多条/全部消息删除 - 支持点击消息上的删除按钮直接进入删除模式并选中该消息 - 成组的 Assistant 消息自动全组选择/删除 - 删除的消息持久化过滤,不会在刷新/加载更多历史时再现 - 修复:非删除模式下保持原布局不变 - 修复:仅对临时客户端 ID 做指纹匹配避免误删 - 修复:消息删除记录在会话移除/重命名时正确清理/迁移
Contributor
|
PR要提交到dev分支的,别直接提交到main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add chat delete mode (UI only, no memory layer changes)
Summary
添加聊天消息删除模式,支持在界面上选择删除聊天消息,完全不触碰记忆层(后端数据库/Agent记忆),仅做前端过滤。
What does this PR change and why?
Important Note (初版说明)
这是删除模式的第一版,完全没有触碰记忆层
Target branch
develop(feature / fix - default)main(release/* or hotfix/* only)Type of change
Detailed change list
dashboard/src/pages/Chat/hooks/chatStore.ts
新增 DeleteModeState 用于管理删除模式和选中状态
新增 表面删除记录持久化
新增 消息指纹(用于流式消息 reload 后匹配)
更新 会话生命周期管理
dashboard/src/pages/Chat/components/MessageList.tsx
dashboard/src/pages/Chat/components/MessageBubble.tsx
dashboard/src/pages/Chat/components/AssistantTurnView.tsx
dashboard/src/pages/Chat/chatMessages.partial.less
dashboard/src/pages/Chat/index.tsx
Test plan
功能验证
单条删除:
多条选择:
全选删除:
成组 Assistant 消息:
非删除模式下布局无影响:
删除持久化隔离:
会话重命名/删除:
Checklist
CHANGELOG.md(if user-facing)Security / Safety Notes
完全不触碰记忆层:
不调用任何后端删除接口
后端数据库保持完整
Agent 记忆完全不受影响
只做前端 UI 隐藏,用户随时可以通过清除 localStorage 找回消息
这是第一版,后续可以考虑加上: