fix(undo): a step is bounded by the gesture, not by 350 ms #23
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
linux
packaging
performance
question
tech-debt
ui
windows
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ben/openDither!23
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/undo-gestures"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #15.
The frame hook folded history by wall-clock time, which was meant to make one
slider drag one step and instead swallowed any other control edited inside the
window: drag contrast, let go, drag brightness within a third of a second, and one
Ctrl+Ztook both back.A step is bounded by the gesture that made it now:
pointer comes up — the release itself ends it, so the next drag cannot join in,
and however long the drag took it stays one step;
The split happens at the document as it stood at the end of the previous frame,
so a control whose change arrives in the same frame as the hand-over still gets
a step of its own. One split per frame is the contract: two more controls in
that same frame share the step they land in;
number, a menu command), and never fires in the middle of one.
The checkpoint the split uses is only trusted while a change is actually pending
(a flag the hook sets, not an inferred comparison), and it is guarded by
Snapshot::same_as, so an edit that changed nothing records nothing. A load, apreset and a new document settle the document they install as the place undo
starts from.
Four more halves of the same bug came out of the checks: a press on a slider that
does not move,
Clear(two steps, the first one undoing to nothing), an edit madewhile the animation plays (never recorded at all), and opening a project
(recorded a step against the reset state and marked the document unsaved).
Checks
cargo test --release: 256 passed (4 new: changes-nothing, same-framehand-over, load leaving no checkpoint, and a project load not recording a step —
each verified to fail without its fix)
--audit: 558 checks, 558 passed, 1 skipped--controls: 62 checked, 0 failed--uitest: 111 checks, 111 passed (6 new: two drags, a 450 ms drag, Clear,undo during playback, animation frames not being steps, and a typed edit
followed by a drag)
--selftest: 456 renders, 0 failurescargo fmt --check: cleanClear, stale checkpoints, project load); the sixth round found nothing and
approved the merge