Bug 446889 - Layer visibility changes should not be included in the undo stack (or behavior should be optional)
Summary: Layer visibility changes should not be included in the undo stack (or behavio...
Status: REOPENED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: 5.0.0-beta5
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-12-12 17:07 UTC by tomtomtomreportingin
Modified: 2022-11-29 00:34 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2021-12-12 17:07:58 UTC
SUMMARY
With 5.0 there was a significant change in undo behavior: Layer visibility changes are now included in the undo stack.  Currently there's no option to change this behavior, and I don't think the workflow disadvantages of this behavior was discussed enough in https://krita-artists.org/t/take-layer-state-into-account-in-the-undo-history/11040

For example, here is one practical set of steps that is impossible to quickly do in Krita 5, that I encountered last night:
1. Create a rough sketch (layer 1)
2. Create a clean sketch (layer 2) over the rough sketch
3. Perform additional tweaks on the clean sketch
4. For comparison, hide the rough sketch and undo to the clean sketch in step 2
5. Redo back to the clean sketch of step 3

In Krita 5, problems start occuring at step 4, as it will also undo the hiding of the rough sketch. Unhiding the rough sketch after that will then clear the redo stack, essentially causing data loss, making step 5 also impossible.

Therefore, it would be nice if this change in behavior was optional.
Comment 1 Tiar 2021-12-12 17:21:52 UTC
I would like that too. It bugs me a bit, because sometimes I want to see how the changes look like without some other layer being visible (for example when I accidentally paint on a layer below the most visible ones and I want to undo all marks on that layer but not make any more undos - now I can only do it blindly, because if I hide the top layer, undo will make it visible again). It's not a huge deal, but it is an annoyance. And I agree with Tomtomtom regarding the usecase as well.
Comment 2 Halla Rempt 2021-12-13 08:07:14 UTC
Huh: layer visibility explicitly and intentionally should not be in the undo stack:

commit 0c53270b078ae04c51a1f58b8291031c6a46305b
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Tue Jan 12 11:00:46 2021 +0300

    Fix modified state of the image after changing layer visibility
    
    Now KisDocument has a special field imageModifiedWithoutUndo, which
    records the fact if modifying the image without undo, e.g. by changing
    layer visibility. This field ca be reset only by saving the image,
    not by changing the state if the undo stack.
    
    BUG:389876

So, this is a regression.
Comment 3 Halla Rempt 2021-12-13 08:07:52 UTC

*** This bug has been marked as a duplicate of bug 389876 ***
Comment 4 Halla Rempt 2021-12-13 13:22:24 UTC
I'm still not sure about a setting for this, but after discussion with Dmitry, it's different from 389876, so reopening
Comment 5 Lynx3d 2021-12-13 22:50:59 UTC
A layer blocking the view on what you want to undo is sometimes an issue for me too.
Often you can work around that by using "isolate current layer", but sometimes it's very hard to see/judge without layer compositing, not to mention you must not get confused what layer it really was you were (accidentally) painting on.

I was wondering, since "Isolate Active Group" mostly makes the "soloing layer" feature (or whatever shift-clicking the visibility icon is called, it's not even mentioned in the manual) obsolete, and the latter also messes badly with the undo stack in 5.x.

So, could we have temporary visibility overrides instead that don't get added to the undo stack or saved with document? Basically, if you shift-click on the visibility icon, it would toggle visibility and turns it blue (or whatever color that stands out) to indicate this is not the actual document state but just a viewing option.
That would really help me with the dilemma that depending on the situation, toggling layer visibility is intended as image state change or just a display option, like showing/hiding guides, grid, assistants (some of my layers can be called guides, I guess).
Comment 6 tomtomtomreportingin 2021-12-14 19:07:49 UTC
A few KA users share some quick thoughts on this behavior change here: https://krita-artists.org/t/hurdles-of-a-photoshop-guy/33221/11
Comment 7 dragonnetstorm 2022-02-19 14:56:03 UTC
From the looks of it we're split 50/50 on this behavior. Suggestion: toggle that switches undo stack to non-layer ("legacy") behavior only. 
I personally alter layer behavior quite often, and once set don't want it changed, but might want to change underlying artwork within said layer. (bad brush stroke, etc) The "perfect lines" are often harder to redo than dragging a layer to a new position for me personally.
Comment 8 Halla Rempt 2022-06-20 14:10:33 UTC
The problem is that old behaviour, where these changes weren't in the undo stack caused unavoidable bugs so it's not simply a matter of adding a switch between the current and the old behaviour.
Comment 9 Dmitry Kazakov 2022-11-28 15:10:11 UTC
The main issue of the bug is that is reset "redo state" now. Ideally, we should check if we can preserve redo state on fully annihilated visibility state changes.
Comment 10 tomtomtomreportingin 2022-11-29 00:34:53 UTC
I wouldn't describe the stack annihilation as the "main" issue. It's surely significant, but I would describe the main part of the problem is that that many users expect layer visibility operations to be purely visual rather than having a functional effect on the undo stack. As I state in the original report, it is not possible to complete step 4 in the described case, regardless if something is implemented to preserve the redo state or not.