feat: initial working version of project manager

This commit is contained in:
2026-01-21 15:02:34 +01:00
parent 4c76c62a3e
commit bdbaab25a4
10 changed files with 267 additions and 34 deletions

View File

@@ -109,6 +109,7 @@ export class GraphManager extends EventEmitter<{
const serialized = {
id: this.graph.id,
settings: $state.snapshot(this.settings),
meta: this.graph.meta,
nodes,
edges
};
@@ -304,7 +305,7 @@ export class GraphManager extends EventEmitter<{
this.status = 'loading';
this.id = graph.id;
logger.info('loading graph', $state.snapshot(graph));
logger.info('loading graph', graph);
const nodeIds = Array.from(new Set([...graph.nodes.map((n) => n.type)]));
await this.registry.load(nodeIds);

View File

@@ -11,7 +11,7 @@
import { setupKeymaps } from "../keymaps";
type Props = {
graph: Graph;
graph?: Graph;
registry: NodeRegistry;
settings?: Record<string, any>;
@@ -85,7 +85,11 @@
manager.on("save", (save) => onsave?.(save));
manager.load(graph);
$effect(() => {
if (graph) {
manager.load(graph);
}
});
</script>
<GraphEl {keymap} />