feat: add topology view mode with router icons and link-style edges

Canvas-global nodeViewMode (bubble/card/topology) can be set at create or via prefs; topology draws NE routers with straight blue center links and exposes router icon to agents.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-12 22:35:53 +08:00
parent 200c8bd450
commit 74f0d8e78a
15 changed files with 322 additions and 103 deletions

View file

@ -276,8 +276,12 @@ CREATE INDEX IF NOT EXISTS idx_snapshots_canvas ON snapshots(canvas_id);
};
}
createCanvas(title?: string, rootText?: string): MutableGraph {
const g = createEmptyGraph(title ?? "未命名画布", rootText);
createCanvas(
title?: string,
rootText?: string,
prefsOverride?: Partial<CanvasMeta["prefs"]>,
): MutableGraph {
const g = createEmptyGraph(title ?? "未命名画布", rootText, prefsOverride);
this.persistGraph(g, true);
this.cache.set(g.canvas.id, g);
return g;