fix: report settled canvas zoom through latest callback - #5520
Conversation
There was a problem hiding this comment.
Builder reviewed your changes and has a few items to flag 🟡
Review Details
Incremental Code Review Summary
The latest PR head retains the focused callback-freshness fix in MultiScreenCanvas.tsx: the debounced wheel/pinch settle path reads onZoomChangeRef.current, preventing a pending gesture from notifying an obsolete host callback after a Design Editor re-render. The updated diff contains no changes that invalidate the core approach, and the existing timer/unmount cleanup remains intact.
Risk assessment: Standard (shared UI interaction/state behavior). One independent review found no new issue. A second identified a low-severity React concurrency concern: assigning the ref during render can theoretically expose a callback from an interrupted render to an already-scheduled timer; a layout effect would restrict the ref to committed props. This is theoretical and was filtered from inline comments by the review system. The prior low-severity test-coverage suggestion remains unaddressed but was not resubmitted as a duplicate.
🧪 Browser testing: Attempted FULL verification because no prior per-test browser results were available. The dev server was healthy, but all 13 planned cases were couldnt_verify because executor sessions had no Chrome/browser automation tools.
Summary
onZoomChangecallback for debounced wheel settleValidation
pnpm exec oxfmt --check templates/design/app/components/design/MultiScreenCanvas.tsx templates/design/app/components/design/MultiScreenCanvas.wheel.test.tsxpnpm --filter design exec vitest run app/components/design/MultiScreenCanvas.wheel.test.tsx