Inspector number boxes edit as you type, and are one undo step per focus

The boxes wrote nothing until blur, so a spinner click showed nothing on
screen. Now every keystroke and step is an edit, and history holds the
step open from focus to blur, so typing 4 then 5 is seen as 4, then 45,
and undone once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Olive Vaughn 2026-09-30 01:35:52 -04:00
parent 277c0c3b63
commit 7aaf0a15bd
5 changed files with 82 additions and 25 deletions

View file

@ -23,6 +23,17 @@
(is (= 1 (count (:done h))))
(is (= {"v" 0} (:leaves (history/undo h {"v" 3}))))))
(deftest typing-into-a-field-is-one-step-however-slow
(let [h (-> nil
(history/record {"w" 1} {"w" 2} 0)
history/hold
(history/record {"w" 2} {"w" 4} 100)
(history/record {"w" 4} {"w" 45} 9000)
history/settle
(history/record {"w" 45} {"w" 46} 9100))]
(is (= 3 (count (:done h))) "the edit before focus and the one after blur stand apart")
(is (= {"w" 2} (:leaves (history/undo (:history (history/undo h {"w" 46})) {"w" 45}))))))
(deftest their-write-between-two-of-mine-keeps-them-apart
(let [h (-> nil
(history/record {"fps" 30} {"fps" 12} 0)