✨ Save and restore selection state in undo/redo#8652
Open
eureka928 wants to merge 3 commits intopenpot:developfrom
Open
✨ Save and restore selection state in undo/redo#8652eureka928 wants to merge 3 commits intopenpot:developfrom
eureka928 wants to merge 3 commits intopenpot:developfrom
Conversation
Save current selection IDs in commit-changes so undo entries can track what was selected before each action. Signed-off-by: eureka928 <meobius123@gmail.com>
Extend undo entry with selected-before and selected-after fields. On undo, restore selection to what it was before the action. On redo, restore selection to what it was after the action. Handles single entries, stacked entries, accumulated transactions, and undo groups. Fixes penpot#6007 Signed-off-by: eureka928 <meobius123@gmail.com>
Pass the captured selection state from commit data into the undo entry so it is stored alongside changes. Signed-off-by: eureka928 <meobius123@gmail.com>
2ec0872 to
4b84e94
Compare
Contributor
|
will look on it tomorrow |
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.
Related Ticket
#6007
Summary
Selection state is now saved alongside each undo entry and restored when performing undo/redo operations. Previously, undoing an action did not restore the selection, forcing users to manually reselect elements.
How it works:
selected-beforeis captured incommit-changes(before changes are applied to state)selected-afteris captured inappend-undo(after changes are applied)selected-before(what was selected before the action)selected-after(what was selected after the action)All three undo entry paths are handled:
add-undo-entry: new entries get both fieldsstack-undo-entry: keeps originalselected-before, updatesselected-afteraccumulate-undo-entry: keeps firstselected-before, updatesselected-afterselected-beforeand last item'sselected-afterSteps to reproduce
Checklist
developby default.CHANGES.mdfile, referencing the related GitHub issue, if applicable.