diff --git a/experiment_designer_v3.html b/experiment_designer_v3.html
index b327de0..cfb16c4 100644
--- a/experiment_designer_v3.html
+++ b/experiment_designer_v3.html
@@ -1332,7 +1332,7 @@
v3 Experiment Designer
@@ -1457,7 +1457,11 @@ Import error
if (!experiment || !experiment._doc) return null;
return {
text: experiment._doc.toString(),
- selection: selection ? JSON.parse(JSON.stringify(selection)) : null
+ selection: selection ? JSON.parse(JSON.stringify(selection)) : null,
+ // Capture the dirty flag too, so undoing back to the loaded state
+ // clears "● edited" (and redo re-asserts it). pushUndo snapshots
+ // BEFORE the mutation, so this records the pre-edit dirty value.
+ dirty: dirty
};
}
@@ -1479,6 +1483,7 @@ Import error
try {
experiment = parseV3Protocol(snap.text);
selection = snap.selection;
+ setDirty(!!snap.dirty);
renderAll();
} catch (err) {
showError('Undo/redo restore failed', err.message);