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

@ -123,6 +123,7 @@ function promoteChildrenOnDelete(g: MutableGraph, nodeId: string): Op[] {
export function createEmptyGraph(
title = "未命名画布",
rootText?: string,
prefsOverride?: Partial<CanvasPrefs>,
): MutableGraph {
const canvasId = newId("c");
const nodeId = newId("n");
@ -137,6 +138,7 @@ export function createEmptyGraph(
showHoverCard: true,
inspectorMode: "selection",
nodeViewMode: "card",
...prefsOverride,
};
const canvas: CanvasMeta = {
id: canvasId,