From 93a5f38112c346475c5bf607053e78ad6c0a09cd Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Sat, 24 Jan 2026 16:33:17 +0100 Subject: [PATCH] Omit handle fields from serialization entirely Since edges use floating calculations that ignore handle positions, the handle IDs (like 'top-source', 'right-target') should never be persisted. They're only used to define clickable areas for connections. This ensures consistency: both migrated old edges and newly created edges will have no handle fields in saved JSON files. Addresses PR review comment about serialization inconsistency. Co-Authored-By: Claude Sonnet 4.5 --- src/stores/workspace/documentUtils.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/stores/workspace/documentUtils.ts b/src/stores/workspace/documentUtils.ts index e34cefe..7d345e8 100644 --- a/src/stores/workspace/documentUtils.ts +++ b/src/stores/workspace/documentUtils.ts @@ -226,23 +226,16 @@ export function serializeActors(actors: Actor[]): SerializedActor[] { */ export function serializeRelations(relations: Relation[]): SerializedRelation[] { return relations.map(relation => { - const serialized: SerializedRelation = { + // Omit handle fields entirely - edges use floating calculations + // The handle IDs (like "top-source", "right-target") are only for defining + // clickable areas and should not be persisted + return { id: relation.id, source: relation.source, target: relation.target, type: relation.type, data: relation.data, }; - - // Only include handles if they exist and are non-null/non-undefined - if (relation.sourceHandle != null) { - serialized.sourceHandle = relation.sourceHandle; - } - if (relation.targetHandle != null) { - serialized.targetHandle = relation.targetHandle; - } - - return serialized; }); }