You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ts: stockFlowViewToJson has two divergent implementations (@simlin/core vs src/diagram/view-conversion.ts) #821
stockFlowViewToJson (StockFlowView -> JsonView serialization) exists in two independent implementations, and callers within the same package use them inconsistently:
src/core/datamodel.ts:1366 -- the @simlin/core/datamodel implementation, used by:
src/diagram/view-conversion.ts:138 -- a separate diagram-local implementation, used by:
src/diagram/Editor.tsx:743 and :1918
src/diagram/project-controller.ts:835
So within src/diagram alone, project-controller.ts and Editor.tsx serialize views with one implementation while merge-live-view.ts uses the other.
Why it matters
Two copies of the same view-serialization logic will drift. Any divergence means the JSON a live-view merge produces can differ from the JSON a patch/save produces for the same view -- a subtle correctness hazard in exactly the code paths that recent flow-editing bugs (#812, #817, #818) went through. It also doubles the maintenance and test surface for every view-element field change (see #811 for fields already being dropped on view edits).
Reconcile to a single implementation (most likely keep the @simlin/core one, since core is the shared data-model layer and diagram already depends on it), diff the two implementations first to understand any intentional differences, and add round-trip tests before deleting the duplicate.
Context
Identified during the June 2026 flow-editing audit. Same class of problem as #624 (two divergent canonicalize implementations), but a different function.
Activity