Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(demo): restore nested mind map branches

tianma-ife2fda4f9a897
diff --git a/apps/api/src/demo-seed-data.test.mjs b/apps/api/src/demo-seed-data.test.mjs
index f5d1c33e..0045f8d2 100644
--- a/apps/api/src/demo-seed-data.test.mjs
+++ b/apps/api/src/demo-seed-data.test.mjs
@@ -42,7 +42,10 @@ describe("demo seed catalog", () => {
for (const [kind, memoId] of examples) {
const memo = DEMO_SEED_MEMOS.find((candidate) => candidate.id === memoId);
expect(memo).toBeDefined();
- expect(parseDiagramDocument(memo?.markdown)).toMatchObject({ kind });
+ const diagram = parseDiagramDocument(memo?.markdown);
+ expect(diagram).toMatchObject({ kind });
+ const cellIds = [...(diagram?.nodes ?? []), ...(diagram?.edges ?? [])].map((cell) => cell.id);
+ expect(new Set(cellIds).size).toBe(cellIds.length);
}
}
});
diff --git a/apps/api/src/demo-seed-data.ts b/apps/api/src/demo-seed-data.ts
index 3f932f20..f59bd4c6 100644
--- a/apps/api/src/demo-seed-data.ts
+++ b/apps/api/src/demo-seed-data.ts
@@ -172,19 +172,19 @@ export const DEMO_MIND_MAP_DIAGRAM_ZH: DiagramDocument = {
{ id: "create-share", label: "发布与分享", x: 520, y: 480, width: 112, height: 36, shape: "topic", parentId: "create" },
],
edges: [
- { id: "root-capture", source: "root", target: "capture" },
- { id: "root-organize", source: "root", target: "organize" },
- { id: "root-connect", source: "root", target: "connect" },
- { id: "root-create", source: "root", target: "create" },
- { id: "capture-clip", source: "capture", target: "capture-clip" },
- { id: "capture-quick", source: "capture", target: "capture-quick" },
- { id: "capture-files", source: "capture", target: "capture-files" },
- { id: "organize-notebooks", source: "organize", target: "organize-notebooks" },
- { id: "organize-tags", source: "organize", target: "organize-tags" },
- { id: "connect-links", source: "connect", target: "connect-links" },
- { id: "connect-mcp", source: "connect", target: "connect-mcp" },
- { id: "create-writing", source: "create", target: "create-writing" },
- { id: "create-share", source: "create", target: "create-share" },
+ { id: "edge-root-capture", source: "root", target: "capture" },
+ { id: "edge-root-organize", source: "root", target: "organize" },
+ { id: "edge-root-connect", source: "root", target: "connect" },
+ { id: "edge-root-create", source: "root", target: "create" },
+ { id: "edge-capture-clip", source: "capture", target: "capture-clip" },
+ { id: "edge-capture-quick", source: "capture", target: "capture-quick" },
+ { id: "edge-capture-files", source: "capture", target: "capture-files" },
+ { id: "edge-organize-notebooks", source: "organize", target: "organize-notebooks" },
+ { id: "edge-organize-tags", source: "organize", target: "organize-tags" },
+ { id: "edge-connect-links", source: "connect", target: "connect-links" },
+ { id: "edge-connect-mcp", source: "connect", target: "connect-mcp" },
+ { id: "edge-create-writing", source: "create", target: "create-writing" },
+ { id: "edge-create-share", source: "create", target: "create-share" },
],
};
@@ -210,19 +210,19 @@ export const DEMO_MIND_MAP_DIAGRAM_EN: DiagramDocument = {
{ id: "create-share", label: "Publish & share", x: 520, y: 480, width: 112, height: 36, shape: "topic", parentId: "create" },
],
edges: [
- { id: "root-capture", source: "root", target: "capture" },
- { id: "root-organize", source: "root", target: "organize" },
- { id: "root-connect", source: "root", target: "connect" },
- { id: "root-create", source: "root", target: "create" },
- { id: "capture-clip", source: "capture", target: "capture-clip" },
- { id: "capture-quick", source: "capture", target: "capture-quick" },
- { id: "capture-files", source: "capture", target: "capture-files" },
- { id: "organize-notebooks", source: "organize", target: "organize-notebooks" },
- { id: "organize-tags", source: "organize", target: "organize-tags" },
- { id: "connect-links", source: "connect", target: "connect-links" },
- { id: "connect-mcp", source: "connect", target: "connect-mcp" },
- { id: "create-writing", source: "create", target: "create-writing" },
- { id: "create-share", source: "create", target: "create-share" },
+ { id: "edge-root-capture", source: "root", target: "capture" },
+ { id: "edge-root-organize", source: "root", target: "organize" },
+ { id: "edge-root-connect", source: "root", target: "connect" },
+ { id: "edge-root-create", source: "root", target: "create" },
+ { id: "edge-capture-clip", source: "capture", target: "capture-clip" },
+ { id: "edge-capture-quick", source: "capture", target: "capture-quick" },
+ { id: "edge-capture-files", source: "capture", target: "capture-files" },
+ { id: "edge-organize-notebooks", source: "organize", target: "organize-notebooks" },
+ { id: "edge-organize-tags", source: "organize", target: "organize-tags" },
+ { id: "edge-connect-links", source: "connect", target: "connect-links" },
+ { id: "edge-connect-mcp", source: "connect", target: "connect-mcp" },
+ { id: "edge-create-writing", source: "create", target: "create-writing" },
+ { id: "edge-create-share", source: "create", target: "create-share" },
],
};