Skip to content

fix(v3): clear dirty flag when undo returns to a saved state (v0.19)#88

Merged
mbreiser merged 1 commit into
mainfrom
fix/v3-dirty-after-undo
Jun 1, 2026
Merged

fix(v3): clear dirty flag when undo returns to a saved state (v0.19)#88
mbreiser merged 1 commit into
mainfrom
fix/v3-dirty-after-undo

Conversation

@mbreiser
Copy link
Copy Markdown
Contributor

@mbreiser mbreiser commented Jun 1, 2026

Small fix flagged during the Variables-panel review.

Bug: undo/redo snapshots captured text + selection but not the dirty flag, so undoing the only edit left "● edited" showing even though the document matched what was loaded.

Fix: snapshot dirty too (pushUndo captures pre-mutation state, so it records the correct pre-edit value) and restore it in restoreSnapshot. Undo back to the loaded state now clears the indicator; redo re-asserts it; undoing one of several edits keeps it (edits remain).

Footer v0.18 → v0.19. npm test green (arena 10 · v2 137 · v3 576). Browser-verified load → clean, edit → dirty, undo → clean, redo → dirty, partial-undo → dirty.

🤖 Generated with Claude Code

The undo/redo snapshots captured text + selection but not the `dirty` flag, so
undoing the only edit left "● edited" showing even though the document matched
what was loaded. Snapshot `dirty` too (pushUndo captures pre-mutation state, so
the snapshot records the correct pre-edit value) and restore it in
restoreSnapshot. Undo back to the loaded state now clears the indicator; redo
re-asserts it; undoing one of several edits keeps it (edits remain).

Footer v0.18 → v0.19. npm test green (arena 10 · v2 137 · v3 576);
browser-verified the load/edit/undo/redo/partial-undo indicator states.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mbreiser mbreiser merged commit fce69e5 into main Jun 1, 2026
2 checks passed
@mbreiser mbreiser deleted the fix/v3-dirty-after-undo branch June 1, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant