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
@@ -31,6 +31,58 @@ const baseSidebarData: SidebarInitialData = {
updated_at: null,
},
],
kernelFileTreeProjection: {
projectionId: "kernel_projection:file_tree:root",
projection: "file_tree",
rootNodeId: null,
items: [
{
rowId: "doc:root",
rowKind: "document",
nodeId: "root",
parentNodeId: null,
nodeType: "page",
projectionKind: "file_tree",
title: "Root",
depth: 0,
position: 0,
childCount: 2,
expandable: true,
expandedByDefault: true,
capabilities: ["expand", "open", "select"],
resourceMeta: {
resourceKind: "document",
documentId: "root",
workspaceId: "ws_1",
iconHint: "page",
},
iconHint: "page",
},
{
rowId: "index:root",
rowKind: "index",
nodeId: "index:root",
parentNodeId: "root",
nodeType: "index",
projectionKind: "file_tree",
title: "index.md",
depth: 1,
position: 0,
childCount: 0,
expandable: false,
expandedByDefault: false,
capabilities: ["open", "select"],
resourceMeta: {
resourceKind: "index",
documentId: "root",
workspaceId: "ws_1",
iconHint: "index",
},
iconHint: "index",
},
],
edges: [],
},
kernelSidebarProjection: {
projectionId: "kernel_projection:sidebar_tree:workspace_root",
projection: "sidebar_tree",
@@ -172,6 +224,13 @@ describe("tree-stream/tree-delta", () => {
items: [],
edges: [],
},
kernelFileTreeProjection: {
projectionId: "kernel_projection:file_tree:root",
projection: "file_tree",
rootNodeId: null,
items: [],
edges: [],
},
kernelSidebarTree: [],
trashedDocuments: [],
trashedMediaAssets: [],
@@ -28,6 +28,11 @@ function cloneSidebarData(data: SidebarInitialData): SidebarInitialData {
...data,
workspaces: [...data.workspaces],
documents: [...data.documents],
kernelFileTreeProjection: {
...data.kernelFileTreeProjection,
items: [...data.kernelFileTreeProjection.items],
edges: [...data.kernelFileTreeProjection.edges],
},
kernelSidebarProjection: {
...data.kernelSidebarProjection,
items: [...data.kernelSidebarProjection.items],
@@ -51,6 +51,13 @@ describe("tree-stream/protocol", () => {
active_workspace_id: "ws_1",
workspaces: [],
documents: [],
kernel_file_tree_projection: {
projectionId: "kernel_projection:file_tree:root",
projection: "file_tree",
rootNodeId: null,
items: [],
edges: [],
},
kernel_sidebar_projection: {
projectionId: "kernel_projection:sidebar_tree:workspace_root",
projection: "sidebar_tree",
@@ -101,6 +108,13 @@ describe("tree-stream/protocol", () => {
active_workspace_id: "ws_1",
workspaces: [],
documents: [],
kernel_file_tree_projection: {
projectionId: "kernel_projection:file_tree:root",
projection: "file_tree",
rootNodeId: null,
items: [],
edges: [],
},
kernel_sidebar_projection: {
projectionId: "kernel_projection:sidebar_tree:workspace_root",
projection: "sidebar_tree",
@@ -121,6 +135,9 @@ describe("tree-stream/protocol", () => {
expect(snapshot).toMatchObject({
activeWorkspaceId: "ws_1",
kernelFileTreeProjection: {
projection: "file_tree",
},
kernelSidebarProjection: {
projection: "sidebar_tree",
},