feat(tree): checkpoint resource lifecycle work

提交当前顶层 mnote Git 工作区,范围集中在 04-tree-domain 的 resource/trash/filetree 生命周期、mnote-web resource_trash 路由、Convex/Next 兼容接口、sidebar/file-tree 客户端适配、smoke 脚本与对应设计/bug 记录。

不包含被 ignore 的 design/05-editor-mainline/reference-code/leptos-tiptap 嵌套仓库改动。新增 smoke 的测试密码改为运行时读取 MNOTE_E2E_PASSWORD,避免提交明文 credential assignment。
This commit is contained in:
lix-2026
2026-05-16 07:38:45 +08:00
parent 274779c0d8
commit 384da4e44c
85 changed files with 12570 additions and 394 deletions
@@ -179,6 +179,11 @@ pub enum TreeShellCommandEvent {
target_document_id: String,
file_count: u32,
},
ResourceLifecycle {
command_name: String,
resource_kind: String,
asset_id: String,
},
}
pub fn reduce_tree_shell_runtime(request: TreeShellRuntimeRequest) -> TreeShellRuntimeResult {
@@ -849,6 +854,26 @@ mod tests {
target_document_id: "doc:target".into(),
file_count: 2,
},
TreeShellCommandEvent::ResourceLifecycle {
command_name: "tree.resource.archive".into(),
resource_kind: "file".into(),
asset_id: "asset:a".into(),
},
TreeShellCommandEvent::ResourceLifecycle {
command_name: "tree.resource.restore".into(),
resource_kind: "file".into(),
asset_id: "asset:a".into(),
},
TreeShellCommandEvent::ResourceLifecycle {
command_name: "tree.resource.purge".into(),
resource_kind: "file".into(),
asset_id: "asset:a".into(),
},
TreeShellCommandEvent::ResourceLifecycle {
command_name: "tree.resource.rename".into(),
resource_kind: "file".into(),
asset_id: "asset:a".into(),
},
];
let encoded = serde_json::to_value(&events).expect("command events should serialize");
@@ -892,6 +917,30 @@ mod tests {
"commandName": "tree.resource.upload",
"targetDocumentId": "doc:target",
"fileCount": 2
},
{
"kind": "resourceLifecycle",
"commandName": "tree.resource.archive",
"resourceKind": "file",
"assetId": "asset:a"
},
{
"kind": "resourceLifecycle",
"commandName": "tree.resource.restore",
"resourceKind": "file",
"assetId": "asset:a"
},
{
"kind": "resourceLifecycle",
"commandName": "tree.resource.purge",
"resourceKind": "file",
"assetId": "asset:a"
},
{
"kind": "resourceLifecycle",
"commandName": "tree.resource.rename",
"resourceKind": "file",
"assetId": "asset:a"
}
])
);