a-b-street / abstreet

Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
https://a-b-street.github.io/docs/
Apache License 2.0
7.7k stars 342 forks source link

Impossible/impracticable to undo automated filter placement in Design LTN tool #1116

Open andrewphilipsmith opened 1 year ago

andrewphilipsmith commented 1 year ago

How to reproduce

Advanced -> Automatically place modal filters -> stop the most shortcuts (bute-force)

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 https://github.com/a-b-street/abstreet/blob/70002600991c4611d3d905da59173c0b74cee2a6/apps/ltn/src/logic/auto_filters.rs#L105) (~= the number of interior roads in the neighbourhood). This can be > 100, making it impracticable for the user to undo this change later.

dabreegster commented 1 year ago

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).

dabreegster commented 1 year ago

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.