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
@@ -1,5 +1,6 @@
import { describe, expect, it } from "vitest";
import {
clearFileTreeClipboardPayload,
decodeFileTreeClipboardPayload,
encodeFileTreeClipboardPayload,
inferPasteTargetDocId,
@@ -11,8 +12,19 @@ describe("file-tree clipboard payload", () => {
const payload = { type: "mnote-file-tree" as const, version: 1 as const, action: "copy" as const, rowIds: ["doc:a", "asset:x"] };
const text = encodeFileTreeClipboardPayload(payload);
expect(decodeFileTreeClipboardPayload(text)).toEqual(payload);
const cutPayload = { ...payload, action: "cut" as const };
expect(decodeFileTreeClipboardPayload(encodeFileTreeClipboardPayload(cutPayload))).toEqual(cutPayload);
expect(
decodeFileTreeClipboardPayload(
encodeFileTreeClipboardPayload({ ...payload, action: "move" as any }),
),
).toBeNull();
expect(decodeFileTreeClipboardPayload("not-a-payload")).toBeNull();
});
it("可清空内存剪贴板", async () => {
await clearFileTreeClipboardPayload();
});
});
describe("inferPasteTargetDocId", () => {