akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 202 forks source link

Operations should only add undo stacks if necessary #705

Closed mbfraga closed 1 year ago

mbfraga commented 2 years ago

Expected Behavior

Some operations will currently add undo stacks even though they may lead to no-ops. For example: if you try to shift a top-most item, you will get an undo stack even though it's a no-op.

Man culprits

Proposal to fix

When running a potential operation do the following steps:

  1. Pre-process an operation over all candidates and find the affected node/instance and any data needed for the operation.
  2. If there are no valid ops, return out.
  3. Otherwise add an undo stack and execute the operations.

Steps to Reproduce (for bugs)

  1. Add a few times
  2. Click on the last item added (topmost)
  3. Press Ctrl+Up several times (each will add an undo stack)
  4. Undo multiple times until you see a change