Fix plugin-only memory settings and UI flow

This commit is contained in:
Youzini-afk
2026-03-24 11:42:10 +08:00
parent 00ae535873
commit 7b68eebb9e
8 changed files with 276 additions and 48 deletions

View File

@@ -328,9 +328,15 @@ export function getNodeEdges(graph, nodeId) {
*/
export function buildAdjacencyMap(graph) {
const adj = new Map();
const activeNodeIds = new Set(
graph.nodes.filter((node) => !node.archived).map((node) => node.id),
);
for (const edge of graph.edges) {
if (!isEdgeActive(edge)) continue;
if (!activeNodeIds.has(edge.fromId) || !activeNodeIds.has(edge.toId)) {
continue;
}
if (!adj.has(edge.fromId)) adj.set(edge.fromId, []);
adj.get(edge.fromId).push({
@@ -358,9 +364,15 @@ export function buildAdjacencyMap(graph) {
*/
export function buildTemporalAdjacencyMap(graph) {
const adj = new Map();
const activeNodeIds = new Set(
graph.nodes.filter((node) => !node.archived).map((node) => node.id),
);
for (const edge of graph.edges) {
if (!isEdgeActive(edge)) continue;
if (!activeNodeIds.has(edge.fromId) || !activeNodeIds.has(edge.toId)) {
continue;
}
if (!adj.has(edge.fromId)) adj.set(edge.fromId, []);
adj.get(edge.fromId).push({