Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib/schema/fileOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export function createGraphFile(name?: string): GraphFile {
// Clean params from all nodes (remove internal UI params, empty values, dead params)
const cleanedNodes = nodes.map(n => cleanNodeForExport(n));

// Clean empty strings to null in settings so they round-trip correctly
// (empty strings are used internally for placeholder display but shouldn't be persisted)
const cleanedSettings = Object.fromEntries(
Object.entries(settings).map(([k, v]) => [k, v === '' ? null : v])
) as SimulationSettings;

return {
version: GRAPH_FILE_VERSION,
metadata: {
Expand All @@ -96,7 +102,7 @@ export function createGraphFile(name?: string): GraphFile {
codeContext: {
code
},
simulationSettings: settings
simulationSettings: cleanedSettings
};
}

Expand Down