feat(recycle-bin): 资产删除改为软删除并新增回收站模块 - #17
Open
zhangz1w3nCode wants to merge 1 commit into
Open
Conversation
将 6 类资产(智能体/技能/知识/工作流/节点/资源文件)以及技能子资源、工作流局部节点的删除从物理删除改为逻辑删除,并新增侧边栏「回收站」模块。
- 主进程 launch.cjs:9 处 delete IPC handler 改为将文件/目录移动到 .ocean/.trashbox/{模块}/{产物} 并写入 index.json;新增 list-trash / restore-trash / delete-trash-permanent / clear-trash 四个 IPC
- 渲染层 storage.ts:新增回收站读写函数与浏览器 localStorage 兜底;新增 trashStore、TrashItem 类型
- UI:新增 TrashPage(按模块分组筛选、恢复、彻底删除、批量操作),侧边栏接入「回收站」入口
- 文案:资产删除确认文案从「不可恢复」改为「删除后可在回收站恢复」
影响范围:六类主资产 + 技能子资源 + 工作流局部节点
测试:tsc 通过、pnpm build 通过、端到端测试 20/20 通过(删除→回收站→恢复→彻底删除)
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.
概述
将 Ocean 中各类资产的删除从物理删除改为逻辑删除(软删除),并新增侧边栏「回收站」业务模块。
背景
原先删除资产(智能体/技能/知识/工作流/节点/资源文件 6 类 + 技能子资源 + 工作流局部节点)均为物理删除,删后不可恢复。本次改为删除时把文件移动到
.ocean/.trashbox/{业务模块}/{产物}并写入索引,回收站支持查看、恢复、彻底删除、清空。主要变更
electron/launch.cjs:9 处 delete handler 改为软删除(移动 + 写 index.json);新增 4 个 IPC:list-trash / restore-trash / delete-trash-permanent / clear-trashelectron/preload.dev.cjs:暴露 4 个回收站 electronAPIsrc/utils/storage.ts:新增回收站读写函数 + 浏览器 localStorage 兜底 + electronAPI 类型声明src/types/index.ts:新增 TrashItem / TrashModule 类型TrashPage(按模块分组/筛选、恢复、彻底删除、批量操作、清空);侧边栏接入「回收站」(appStore / Sidebar / MainContent)验证
tsc通过、pnpm build通过说明
相关任务
.tasks/2026-08-17/TASKS/asset-soft-delete-recycle-bin/