feat: unify workspace sidebar and create Foundry graph pages

This commit is contained in:
2026-11-05 23:57:45 +08:00
parent 6ca4b00d2c
commit 71bf8b0f5e
15 changed files with 417 additions and 238 deletions
+15
View File
@@ -0,0 +1,15 @@
import type { Board } from "./workspace";
export function readDemoBoards(workspace: string): Board[] {
try {
const stored = JSON.parse(localStorage.getItem("endoleap_demo_boards_" + workspace) || "null");
if (Array.isArray(stored)) return stored.map((board) => ({
...board, workspace_id: workspace, kind: "board", version: board.version || 1,
}));
} catch { /* Fall back to the sample pages when browser storage is invalid. */ }
return [
{ id: "morning", title: "城市清晨" },
{ id: "ideas", title: "灵感收集" },
{ id: "journey", title: "下一站,去哪里" },
].map((board) => ({ ...board, workspace_id: workspace, kind: "board", version: 1 }));
}