Raise physical canvas capacity and keep region==canvas rules consistent.

Pass view kind into membership so metro maps are not capped at core=80, add region-scoped neighbor projection, and align UI/tests with one physical canvas per region.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-09 23:23:09 +08:00
parent a9a45d39d4
commit 75d03f5f9b
8 changed files with 342 additions and 157 deletions

View file

@ -1574,7 +1574,11 @@ export function TopologyPage() {
}
return views.find((v) => !isWorldFlatViewName(v.name)) || null;
}
return views[0] || null;
// Region / 根图: the physical view is the canvas. Custom siblings are rare
// extras — never prefer them over physical for the default open target.
const physical =
views.find((v) => String(v.kind) === "physical") || null;
return physical || views[0] || null;
}, []);
const goRegion = useCallback(
@ -2084,11 +2088,12 @@ export function TopologyPage() {
folder.external_ref === "ume:world" || folder.name === "UME World";
const drillFolder = isWorldDrillFolder(folder);
const umeNav = isUmeWorldNavFolder(folder);
// Region === canvas: hide physical/custom view rows; only child regions.
// Region === canvas: hide the physical primary row (region click opens it),
// but keep sibling custom canvases visible (e.g. MCP LPG-Full next to 根图).
// UME World container: only「世界地图」as a sibling view.
const canvasRegion = isRegionCanvasFolder(folder, String(treeRoot?.id || ""));
const visibleViews = canvasRegion
? []
? (folder.views || []).filter((v) => String(v.kind) !== "physical")
: containerFolder
? (folder.views || []).filter((v) => isWorldFlatViewName(v.name))
: folder.views || [];

View file

@ -360,7 +360,8 @@ export default function TopologyReactFlowView(props: TopologyReactFlowViewProps)
connectionLineStyle={{ stroke: "#38bdf8", strokeWidth: 2 }}
defaultEdgeOptions={{ type: "straight", labelShowBg: false }}
proOptions={{ hideAttribution: true }}
minZoom={isWorldFlatCanvas ? 0.002 : 0.05}
// Composed metro canvases can span 40k–70k; default 0.05 clips fitView.
minZoom={isWorldFlatCanvas || nodes.length >= 400 ? 0.002 : 0.05}
maxZoom={isWorldFlatCanvas ? 12 : 4}
nodesDraggable={
isWorldFlatCanvas