Zooming the canvas needs perf. improvements

Created on 27 March 2025, about 2 months ago

Overview

When the canvas is zoomed, the overlay has to update to ensure that the overlay correctly matches the zoomed size of the elements.

This operation can get really slow when there are loads of components and regions and slots on the page.

Proposed resolution

At a high level I think the solution is
a) debounce the call to dispatch(canvasViewPortZoomDelta(e.deltaY) in Canvas.tsx so the scale in the redux store is updated less frequently
b) directly update the transform: scale value on the data-testid="xb-canvas-scaling" div when zooming so the zoom still happens immediately
c) also update the scale when the scale value in the redux store is updated (so that zooming using the UI etc will still work).

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

🇬🇧United Kingdom jessebaker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024