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
diagram: editing a view drops Vensim sketch details needed for MDL export #811
Editing a view in the app replaces the whole view, and the replacement is built from JSON that lacks several Vensim sketch details.
Any view edit, even a pan or zoom, silently drops them, so a later MDL export of an imported Vensim model loses fidelity.
Simulation results are not affected.
What is dropped
Per-element Vensim sketch data (ViewElementCompat: width, height, flag bits) and flow label data
The view's Vensim sketch segments and links (StockFlow.sketch_compat)
The view font
The group "is an MDL view marker" flag (the engine's JSON has it; src/core/datamodel.ts ignores it)
The view name (the engine's JSON has it; datamodel.ts ignores it)
Example
Import a Vensim .mdl, move one variable, export to .mdl: element sizes and the sketch's segments and links come out as defaults.
Not reproduced end to end; traced from json.rs, where converting a JSON view to the datamodel sets every one of these fields to None.
Fix
Recommended: when UpsertView replaces an existing view, carry these fields over from the old view (per element, matched by uid, as apply_upsert_view already does to share unchanged elements).
The TypeScript side then never needs to know about Vensim sketch details.
Alternative: add every field to the JSON types and round-trip them through datamodel.ts; more surface to keep in sync.
Pointers
src/simlin-engine/src/patch.rs: apply_upsert_view
src/simlin-engine/src/json.rs: From<View> for datamodel::View and the view-element conversion
changed the title [-]core: view-element fidelity fields dropped on view edits (ViewElementCompat, View.font, group MDL marker, View.name)[/-][+]diagram: editing a view drops Vensim sketch details needed for MDL export[/+]on Oct 12, 2026
Activity
[-]core: view-element fidelity fields dropped on view edits (ViewElementCompat, View.font, group MDL marker, View.name)[/-][+]diagram: editing a view drops Vensim sketch details needed for MDL export[/+]