From c87401e10b85797e542f87bab280c58c8ce3565d Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 2 Apr 2026 20:29:50 +0200 Subject: [PATCH] Wrap light and sound emitter changes in draft commit scheduling --- src/app/App.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index 2c48b3f0..d6c13bca 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -4296,7 +4296,7 @@ export function App({ store, initialStatusMessage }: AppProps) { onChange={(event) => { const nextColorHex = event.currentTarget.value; setPointLightColorDraft(nextColorHex); - applyPointLightChange({ colorHex: nextColorHex }); + scheduleDraftCommit(() => applyPointLightChange({ colorHex: nextColorHex })); }} /> @@ -4356,7 +4356,7 @@ export function App({ store, initialStatusMessage }: AppProps) { onChange={(event) => { const nextColorHex = event.currentTarget.value; setSpotLightColorDraft(nextColorHex); - applySpotLightChange({ colorHex: nextColorHex }); + scheduleDraftCommit(() => applySpotLightChange({ colorHex: nextColorHex })); }} /> @@ -4528,7 +4528,11 @@ export function App({ store, initialStatusMessage }: AppProps) { onChange={(event) => { const nextAudioAssetId = event.currentTarget.value.trim(); setSoundEmitterAudioAssetIdDraft(nextAudioAssetId); - applySoundEmitterChange({ audioAssetId: nextAudioAssetId.length === 0 ? null : nextAudioAssetId }); + scheduleDraftCommit(() => + applySoundEmitterChange({ + audioAssetId: nextAudioAssetId.length === 0 ? null : nextAudioAssetId + }) + ); }} > @@ -4611,7 +4615,7 @@ export function App({ store, initialStatusMessage }: AppProps) { onChange={(event) => { const nextAutoplay = event.currentTarget.checked; setSoundEmitterAutoplayDraft(nextAutoplay); - applySoundEmitterChange({ autoplay: nextAutoplay }); + scheduleDraftCommit(() => applySoundEmitterChange({ autoplay: nextAutoplay })); }} /> @@ -4624,7 +4628,7 @@ export function App({ store, initialStatusMessage }: AppProps) { onChange={(event) => { const nextLoop = event.currentTarget.checked; setSoundEmitterLoopDraft(nextLoop); - applySoundEmitterChange({ loop: nextLoop }); + scheduleDraftCommit(() => applySoundEmitterChange({ loop: nextLoop })); }} /> @@ -4760,7 +4764,7 @@ export function App({ store, initialStatusMessage }: AppProps) { onChange={(event) => { const nextEnabled = event.currentTarget.checked; setInteractableEnabledDraft(nextEnabled); - applyInteractableChange({ enabled: nextEnabled }); + scheduleDraftCommit(() => applyInteractableChange({ enabled: nextEnabled })); }} />