Sketcher: saved-state tracking, history fixes, undo/redo toolbar - #367
Merged
Conversation
… buttons - Mark the document as changed while the sketch is being edited (the sketcher uses its own HistoryManager which was disconnected from the document's saved-state tracking). Undoing back to the entry state restores the previous saved state. - Add MoveEntitiesCommand so dragging an entity creates an undoable command; previously entity moves bypassed the history entirely. - Coalesce the constraint-create + dialog-edit into a single history entry via a new HistoryManager.coalesce() that bypasses the time threshold. Skip the no-op CreateOrEditConstraintCommand when an existing constraint is found. - Apply the drag threshold in edit mode to prevent sub-pixel jitter between double-clicks from registering spurious moves. - Suppress the spurious "Rename Sketch" history entry triggered by programmatically setting the name row during set_sketch. - Add undo/redo buttons with dropdown history to the sketcher toolbar. Fixes Ctrl+S not working inside the sketcher.
This was referenced Aug 23, 2026
knipknap
added a commit
that referenced
this pull request
Aug 25, 2026
…ry-fixes Sketcher: saved-state tracking, history fixes, undo/redo toolbar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A set of fixes for the sketcher around document saved-state tracking and undo/redo history:
MoveEntitiesCommand; previously moving a complete line bypassed the history entirely (not undoable, did not mark doc as changed).HistoryManager.coalesce()forces coalescing with the previous command, bypassing the 0.5s time threshold. The no-opCreateOrEditConstraintCommand(when an existing constraint is found) is skipped from history.Testing
pixi run lintpasses