Skip to content

Fix Undo restoring values into the wrong config set - #10611

Open
zubSero wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
zubSero:fix/10588-config-undo-set
Open

zubSero wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
zubSero:fix/10588-config-undo-set

Conversation

@zubSero

@zubSero zubSero commented Nov 27, 2026 •

Copy link
Copy Markdown

Fixes #10588.

Description of the problem being solved:

An undo state on the Configuration tab didn't record which config set it belonged to. If you ticked something in set A, switched to set B and pressed Ctrl+Z, B stayed active and got A's values written into it.

The undo state now remembers its set. Undo and Redo switch back to that set before restoring, and a state that belongs to a deleted set is skipped. Set ids get reused after a delete, so the state keeps the set itself and not only its id. Otherwise undoing far enough would write a deleted set's values into a newer set that got the same id.

The issue also mentions placeholders. Those are worked out again after the inputs are restored, so the undo state doesn't need to store them.

This was part of #10585. I split it out so it can be reviewed on its own.

Steps taken to verify a working solution:

  • Added tests for undoing after a switch (A becomes active again and B is unchanged, Redo goes back to B) and for a state of a deleted set, including the case where a new set reuses the deleted set's id. They fail on dev.

An undo state did not record which config set it was taken from, so Undo after switching sets wrote the previous set's values into the current one. The state now carries its set, Undo and Redo switch back to it, and a state of a deleted set is skipped.
Set ids are reused after a delete, so an undo state of the deleted set
could be restored into a newer set with the same id. The undo state now
keeps the set itself and is skipped when the id belongs to another set.
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.

Undo after switching configuration sets restores values into the wrong set

1 participant