Repository navigation
Replies: 6 comments
|
Please note that I included the output of |
|
I've vibecoded a patch here: https://github.com/adam-gaia/ansel. It works and fixes my issue, however I have not properly reviewed the code. Commit that matters for upstreaming: 8f3c277 I haven't used c in a long time and I'm new to the ansel codebase, so I'm not confident in my ability to review this myself to try and get an actual PR in right now. I hope it helps as a proof of concept. |
|
Thanks for digging into this, and for the patch! Your diagnosis matches what the log shows: each batched commit records its own undo entry, and Ctrl+Z only groups entries recorded within 0.5 s of the most recent one, so any drag (or pause) longer than that comes back as several undo steps. Holding one undo record open for the whole gesture is the right direction. Could you open a pull request against Don't worry about not having fully reviewed the code yourself, that's what the PR review is for. We'll go through it there. |
|
Following up after a closer look at the patch. First, your diagnosis is spot on, and so is the goal: one drag should be one undo step. Where I'd go a different way is the mechanism, not the idea of marking where a gesture starts. The patch keeps an undo record open between the start and the end of a gesture. That's global state, and it has to be closed on every possible way out; while it's open, it also changes how everything else behaves. That's what makes the patch so big: hooks on What I'd suggest instead is to keep the gesture boundary, but use it as a merge key rather than an open record:
With that, there's no end to handle at all: nothing stays open, no stale snapshot, no special cases for teardown, module removal or image/view changes. Ctrl+Z just works, because after an undo the top of the stack isn't the same gesture anymore, so the next commit pushes a new record. A widget that forgets to report its press simply falls back to today's behaviour, and a new widget only needs one call, on press. My rough guess is one or two hundred lines including the unit test, instead of 925, though I haven't written or measured anything yet. The 0.5 s grouping at Ctrl+Z time can stay as it is; that's a separate question. You mentioned the code was vibecoded and that you don't feel able to review it, so no pressure: if you'd like to rework it along these lines, great, and we'll help in the PR review. If you'd rather not, just say so. We can implement this version on our side, credit you in the commit, and use your PR as the reference for which widgets need covering. |
|
Thank you for the quick and thorough response! I've started to read through my vibecoded patch. I think I see what you are saying. It makes sense to not keep global state. I think I follow your outlined plan enough to at least give it a try. I'd like to take a couple days to try and tackle your suggested plan. If I can't get something at least worth your time to review by then, I'll fully pass it off to you. |
|
I'm moving this subject to discussions |
Uh oh!
There was an error while loading. Please reload this page.
Issue is actionnable and focused on a single problem
Search previous report
Computer's operating system
Linux
What GPU do you have ?
Nvidia
Ansel version
8bef690
Type of binary
Self-compiled (GCC or Clang)
What happened?
In the darkroom, using any slider creates multiple undo steps.
When adjusting a module slider by dragging it continuously, Ansel seems to record multiple intermediate slider positions as separate undo steps. For example, dragging Highlights from 0 to 100 in one continuous mouse gesture may produce undo steps such as 100 -> 83 -> 58 -> 11 -> 0.
The number and values of these intermediate undo steps depend on how quickly the slider is moved and whether the mouse is paused while held down. In that previous example, I paused for one second at 11, 58, and 83 while continuing to hold the mouse down.
My one-second testing pauses are exaggerated to replicate the behavior every time. This same issue still happens with much shorter pauses, and even when dragging slowly without deliberately pausing.
Expected behavior: one continuous slider drag from 0 to 100 should produce one undo step, restoring the slider directly from its final value (100) to its value before the drag (0), regardless of any pauses in the middle.
I've hit this bug in
The impact of this bug is a large usability issue for me personally. In a typical photo editing session after dragging sliders (slowly, without necessarily pausing), undo feels like a random walk along the slider back to the original position. I'll often hit undo too many times because I do not know how many history points were created.
For what it's worth, undo in the latest darktable release works as I expect it, without intermediate history steps.
Other than that, I really like ansel. Thanks for your work on it!
Does your problem occur with OpenCL enabled ?
Yes
Does your problem occur with OpenCL disabled ?
Yes
Previous Ansel version that use to work
No response
Output of ansel -d all
Backtrace
Upload screenshots
No response
Upload incriminated image files and XMP developments
No response
All reactions