4-10 树域 Rust 家族化

This commit is contained in:
lix-2026
2026-04-24 06:10:18 +08:00
parent 41e958769e
commit 94631f3636
49 changed files with 5751 additions and 557 deletions
+145
View File
@@ -137,6 +137,7 @@ describe("buildSidebarInitialData", () => {
expect(payload.activeWorkspaceId).toBe("ws_1");
expect(payload.kernelSidebarProjection?.projection).toBe("sidebar_tree");
expect(payload.kernelFileTreeProjection?.projection).toBe("file_tree");
expect(payload.kernelSidebarTree?.map((item) => item.id)).toEqual(["doc_1"]);
expect(payload.mindmapDocs).toEqual(["doc_1"]);
expect(payload.mindmapAssetChildren).toEqual({
@@ -251,6 +252,78 @@ describe("buildSidebarInitialData", () => {
],
edges: [],
},
kernel_file_tree_projection: {
projectionId: "kernel_projection:file_tree:root",
projection: "file_tree",
rootNodeId: null,
items: [
{
rowId: "doc:doc_1",
rowKind: "document",
nodeId: "doc_1",
parentNodeId: null,
nodeType: "page",
projectionKind: "file_tree",
title: "页面 1",
depth: 0,
position: 1,
childCount: 1,
expandable: true,
expandedByDefault: true,
capabilities: [
"expand",
"open",
"drag",
"drop",
"select",
"create-child",
"rename",
"archive",
"restore",
"context-menu",
"reorder",
],
resourceMeta: {
resourceKind: "document",
documentId: "doc_1",
workspaceId: "ws_1",
iconHint: "page",
},
iconHint: "page",
},
{
rowId: "index:doc_1",
rowKind: "index",
nodeId: "index:doc_1",
parentNodeId: "doc_1",
nodeType: "index",
projectionKind: "file_tree",
title: "index.md",
depth: 1,
position: 0,
childCount: 0,
expandable: false,
expandedByDefault: false,
capabilities: ["open", "select", "context-menu"],
resourceMeta: {
resourceKind: "index",
documentId: "doc_1",
workspaceId: "ws_1",
iconHint: "index",
},
iconHint: "index",
},
],
edges: [
{
id: "edge:doc_1:index:doc_1:parent_of",
edgeType: "parent_of",
workspaceId: "ws_1",
fromNodeId: "doc_1",
toNodeId: "index:doc_1",
},
],
},
trashed_documents: [],
media_assets: [],
trashed_media_assets: [],
@@ -349,6 +422,78 @@ describe("buildSidebarInitialData", () => {
},
},
],
kernelFileTreeProjection: {
projectionId: "kernel_projection:file_tree:root",
projection: "file_tree",
rootNodeId: null,
items: [
{
rowId: "doc:doc_1",
rowKind: "document",
nodeId: "doc_1",
parentNodeId: null,
nodeType: "page",
projectionKind: "file_tree",
title: "页面 1",
depth: 0,
position: 1,
childCount: 1,
expandable: true,
expandedByDefault: true,
capabilities: [
"expand",
"open",
"drag",
"drop",
"select",
"create-child",
"rename",
"archive",
"restore",
"context-menu",
"reorder",
],
resourceMeta: {
resourceKind: "document",
documentId: "doc_1",
workspaceId: "ws_1",
iconHint: "page",
},
iconHint: "page",
},
{
rowId: "index:doc_1",
rowKind: "index",
nodeId: "index:doc_1",
parentNodeId: "doc_1",
nodeType: "index",
projectionKind: "file_tree",
title: "index.md",
depth: 1,
position: 0,
childCount: 0,
expandable: false,
expandedByDefault: false,
capabilities: ["open", "select", "context-menu"],
resourceMeta: {
resourceKind: "index",
documentId: "doc_1",
workspaceId: "ws_1",
iconHint: "index",
},
iconHint: "index",
},
],
edges: [
{
id: "edge:doc_1:index:doc_1:parent_of",
edgeType: "parent_of",
workspaceId: "ws_1",
fromNodeId: "doc_1",
toNodeId: "index:doc_1",
},
],
},
trashedDocuments: [],
trashedMediaAssets: [],
trashedMindmapAssets: [],