Bug 395386

Summary: [Move Tool] regression: no undo
Product: [Applications] krita Reporter: David REVOY <info>
Component: Tools/MoveAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: 7achoneus, brice.taillefer4, halla, isaaczuniga, konrad.papala, takiro-kde, tonyc
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description David REVOY 2018-06-14 18:16:49 UTC
Hi,
I spent the production of Pepper&Carrot episode 25 in Krita 4.0.0appimage because of various regression in the point releases (mainly a dangerous one about autosave failing). I'm updating my setup now, and something I immediately saw is the regression about the Move tool: it is no longer possible to use Undo (Ctrl+Z), better using move tool breaks the undo shortcut.

To reproduce:
=============
1. Open a default canvas.
2. Add a new layer.
3. Take the freehand painting tool, paint three stroke on it.
4. Press 'T' to switch to move tool and move the layer.
5. Press Ctrl+Z to undo.

Result:
=======
You can't undo the action of the Move tool. It also break the possibility to undo your three painting stroke before that. The key become very dangerous as it breaks the undo history work-flow.

Notes:
======
This bug appeared at Krita 4.0.1appimage and is still in all point release after that and in today's Git~master.

Workaround: 
===========
1. Open the docker "Undo History" and click manually on the history items on the list to go back in the previous steps; only the shortcut key is broken after a Move Tool operation.
2. Press "Esc" after MoveTool transformation: this key does like an Undo for the MoveTool but it is hard to discover and not user friendly.
3. Keep Krita 4.0.0appimage :-P
Comment 1 Isaac Zuniga 2018-06-14 22:49:40 UTC
Confirmed:

I have this issue too. I have video showing it off here: https://drive.google.com/file/d/1Uy_RzcLdV7VLcdiVoQR5V6rVUkvdnTTL/view?usp=sharing

Perhaps this could be a new tool/functionality that is currently a work in progress?
Comment 2 David REVOY 2018-06-15 07:10:32 UTC
Thank you @Isaac for taking the time to record a video about it.
I'm switching the ticket to 'CONFIRMED'. I discussed about it yesterday with @Quiralta and he was able to also reproduce it.

It looks like the move tool totally inhibit the "Undo" action during the action. One of the main problem: there is no user feedback on canvas an unfinished action is 'in progress'. So the Undo key just appears broken. Here are the hidden three option to unlock Undo stack avec a MoveTool action:

1. Switch to another tool (eg. switch to Freehand painting) then Undo works again.
2. Press <Esc> key on keyboard then Undo works again. 
3. Pressing <ENTER> key bake the action and Undo works again.

Proposal to solve this issue
============================
Option 1: Information
-> Add an overlay notification in the corner of the canvas: 
   "Move Tool action in progress"
   "<Enter> to validate - <Esc> to cancel"

Option 2: Undo==Cancel
-> During a MoveTool action, pressing <Ctrl+Z> resets the position. 
   <Ctrl+Z>==Current <Esc> key behavior.
   As it was in 4.0.0 and all version prior that.
   (That my favorite)

Option 3: Implement Undo history steps within MoveTool action (each position on release).
-> Suggested in another long bug report, but I don't like that. It is always problematic.
   Move tool goes from a point A to a point B, imo. No need In-betweens steps. 
   (or in this case, <Enter> to bake position is good enough)
Comment 3 Takiro Ryo 2018-06-15 17:50:31 UTC
Same here. It also does not appear in the undo history docker anymore, which often was a way to work around similar issues.
Comment 4 Quiralta 2018-07-06 17:02:05 UTC
*** Bug 396260 has been marked as a duplicate of this bug. ***
Comment 5 konrados 2018-07-13 16:32:55 UTC
I just want to say that *Option 2: Undo==Cancel* is the most obvious and intuitive one :) So here is my up vote for it. If... this counts, probably not, but there it is anyway! :) Because it's soooo obvious.
Comment 6 William Thorup 2018-07-18 17:05:49 UTC
This was throwing me off quite a bit after updating Krita this morning. I hope there is an adjustment to this in the next update.

It seems that David's option 3 is would be considered the "traditional" way of doing it, as it seems other programs like Gimp and Photoshop do it this way.

But I think the confirmation method would work as well if David's option 2 is implemented.  ctrl+z/Esc to cancel, any other action would confirm the transform.
Comment 7 konrados 2018-07-19 12:41:51 UTC
Actually, when I read about "Option 2: Undo==Cancel" it seemed so obvious, that  I commented immediately. Now after reading the whole text, option 3 seems even better, indeed :)
Comment 8 Halla Rempt 2018-08-29 13:34:16 UTC
I'm pretty sure the problem starts here:

commit f094f600e2e12f03181bb05ad291af6768a71b18
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Wed Apr 4 16:06:12 2018 +0300

    Disable handling Ctrl+Z as "cancel" action in KisToolMove
    
    Basically, we shouldn't cancel the stroke on undo in "continued"
    tool actions. Instead the user should use "Esc" key for that.
    
    Otherwise the previous command (the one that came before the
    current action) will be undone, which is not what the user wants.
    
    Ideally we should finally implement an undo system for the move tool,
    but it is still a todo.
    
    CCBUG:392014
Comment 9 Halla Rempt 2018-08-29 13:34:44 UTC

*** This bug has been marked as a duplicate of bug 392014 ***