-
Notifications
You must be signed in to change notification settings - Fork 54
feat: add zoom in/out buttons and keyboard shortcuts to Studio Canvas #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: add zoom in/out buttons and keyboard shortcuts to Studio Canvas #59
Conversation
@0MUHAMMEDIRFAN Done. Breakpoints moved to toolbar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| setPanAndZoom(canvasProps, canvasEl, canvasContainerEl) | ||
| }) | ||
| function zoomIn() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Builder uses cmd + & cmd - to do so. Those are the standard zoom in & out shortcuts and we should stick to it: https://github.com/frappe/builder/blob/8d45e36f04e8a78ab2a74e85d81dfbab54d0e1de/frontend/src/utils/useBuilderEvents.ts#L400
- Code for keyboard shortcuts is in
useStudioEventscomposable. So it should be there. Copy builder's logic instead of redoing it here.
|
Does it make sense to move all controls above the canvas? |





This pull request improves the Studio Canvas by adding:
Zoom In and Zoom Out buttons
Keyboard shortcuts:
+or=to zoom in-or_to zoom out0to reset (fit to screen)Shows tooltips with shortcuts on the zoom buttons
Zoom level is saved in local storage and restored when the page reloads
Zoom shortcuts only work when the mouse is inside the canvas
Prevents zooming while typing in input fields
Demo Video:
Screencast.from.2025-05-03.20-56-13.webm
Closes: #58