Skip to content

Reset auto-applied presets flag and edit timestamp when restoring a snapshot with empty history - #21619

Open
jeffc wants to merge 2 commits into
darktable-org:masterfrom
jeffc:fix-undo-presets
Open

Reset auto-applied presets flag and edit timestamp when restoring a snapshot with empty history#21619
jeffc wants to merge 2 commits into
darktable-org:masterfrom
jeffc:fix-undo-presets

Conversation

@jeffc

@jeffc jeffc commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This fixes a bug I encountered when I do the following steps:

  1. Edit image A
  2. Copy image A's history stack (full or partial) and paste onto image B, which was previously unedited
  3. Undo that paste operation

Before this change, if I opened image B for editing, none of the my automatically-applied presets would be applied. This change resets the "auto-apply presets" flag and the edit timestamp when undoing the last remaining change in the history stack. This properly resets image B to an "unedited" state, and it properly gets presets applied when it's opened for editing.

@TurboGit TurboGit added this to the 5.8 milestone Jul 28, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending labels Jul 28, 2026
@TurboGit

Copy link
Copy Markdown
Member

B must have been just imported without having touched before, right?

@jeffc

jeffc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

It can't have been edited at all, but it can have ratings/labels assigned.

I noticed this bug in the course of my normal workflow:

First, I Import all the pictures from a shoot. Next, I cull down to the ones I want to edit (I use color labels for this) and tag. After that, I tend to just edit in order.

If I have a series of shots in basically identical lighting conditions with identical settings, I'll often want to do the basic exposure/color correction on the first one and then copy/paste that on to the rest in the series before doing final edits individually. Sometimes this works great, but other times I can tell from the lighttable previews that the edits from the first image don't work well on the others, so I'll hit undo. I noticed that when I did that and then went to any of the images that had gotten that paste/undo, they no longer had presets auto-applied.

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit

Copy link
Copy Markdown
Member

The patch seems correct but I'm wondering if it would be better to store the actual change status into the undo record and always reset it to previous status when doing undo/redo. I suppose this is cleaner as using the actual undo/redo support and will work in all cases without having to special case this status.

@jeffc

jeffc commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

The patch seems correct but I'm wondering if it would be better to store the actual change status into the undo record and always reset it to previous status when doing undo/redo. I suppose this is cleaner as using the actual undo/redo support and will work in all cases without having to special case this status.

I was trying to make the smallest possible change that I could and still fix the problem, and this was the best I could do. If you think that's a better answer I can take a swing at it!

@TurboGit

TurboGit commented Aug 2, 2026

Copy link
Copy Markdown
Member

Yes I think it is worth looking for adding the change status into the undo/redo record. Let me know if you need pointers. TIA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants