From 626be664b87cbf0c8bf3b961994c12a01167bba9 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 04:37:53 +0200 Subject: [PATCH] Add scheduling for draft commits in App.tsx --- src/app/App.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index d4e0c0b2..b9bb6946 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -645,6 +645,24 @@ export function App({ store, initialStatusMessage }: AppProps) { } }; + const scheduleDraftCommit = (applyChange: () => void) => { + window.setTimeout(() => { + applyChange(); + }, 0); + }; + + const handleNumberInputPointerUp = (_event: ReactPointerEvent, applyChange: () => void) => { + scheduleDraftCommit(applyChange); + }; + + const handleNumberInputKeyUp = (event: ReactKeyboardEvent, applyChange: () => void) => { + if (!isCommitIncrementKey(event.key)) { + return; + } + + scheduleDraftCommit(applyChange); + }; + const handleSaveDraft = () => { const result = store.saveDraft(); setPersistenceMessage(