This PR enhances undo/redo history logic. The main changes are:
changed the debouncedAdd function to throttledAdd. Now it instantly adds an item to history and until the throttle time ends, executing it again will only modify the previously added item. After the time ends, launching throttledAdd will add a new element.
Before these changes debouncedAdd function was adding an element to history after the debounce time
fixed cursor positioning when undoing text. Now cursor is positioned at the beginning of the text that was undone
Details
This PR enhances undo/redo history logic. The main changes are:
debouncedAdd
function tothrottledAdd
. Now it instantly adds an item to history and until the throttle time ends, executing it again will only modify the previously added item. After the time ends, launchingthrottledAdd
will add a new element. Before these changesdebouncedAdd
function was adding an element to history after the debounce timeRelated Issues
https://github.com/Expensify/App/issues/39255
Manual Tests
Linked PRs