Impossible/impracticable to undo automated filter placement in Design LTN tool
andrewphilipsmith opened this issue · 2 comments
How to reproduce
- In the Design LTN tool, select a large-ish neighbourhood
- Try automatically placing filters using the following option:
Advanced -> Automatically place modal filters -> stop the most shortcuts (bute-force)
- Attempt to undo the placement of the filter
Expected behaviour
The user should be able to undo the filter placement with a single undo.
Actual behaviour
The user may need to select undo > 100 times in order to return to the state before automatically placing the filter.
(It seems that an edit is made and undone for each candidate filter (see
abstreet/apps/ltn/src/logic/auto_filters.rs
Line 105 in 7000260
This was a problem introduced by #1085. It's possible we need to rethink the MapEdits
structure with flat commands right now, and be able to batch them together. Maybe something like EditCmd::Multiple(Vec<EditCmd>)
(ignoring the recursive type problem).
Ah, I slightly misread the issue -- a related problem is the use of the freehand filter tool. The user can introduce a bunch of new filters with one logical operation, but then has to undo filters individually (in an arbitrary order). That's another case where we'd want to logically batch edits.