Skip to content

fix: report settled canvas zoom through latest callback - #5520

Merged
steve8708 merged 2 commits into
mainfrom
steve8708/fix-design-latest-zoom-callback
Sep 21, 2026
Merged

steve8708 merged 2 commits into
mainfrom
steve8708/fix-design-latest-zoom-callback

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Summary

  • keep the latest onZoomChange callback for debounced wheel settle
  • preserve the existing Design E2E host readout regression coverage

Validation

  • pnpm exec oxfmt --check templates/design/app/components/design/MultiScreenCanvas.tsx templates/design/app/components/design/MultiScreenCanvas.wheel.test.tsx
  • pnpm --filter design exec vitest run app/components/design/MultiScreenCanvas.wheel.test.tsx

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions
github-actions Bot temporarily deployed to pr-5520-design September 21, 2026 23:04 Destroyed
@steve8708
steve8708 merged commit 2b991fe into main Sep 21, 2026
48 checks passed
@steve8708
steve8708 deleted the steve8708/fix-design-latest-zoom-callback branch September 21, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant