feat: add zoom in/out buttons and keyboard shortcuts to Studio Canvas#59
Open
UmakanthKaspa wants to merge 7 commits intofrappe:developfrom
Open
feat: add zoom in/out buttons and keyboard shortcuts to Studio Canvas#59UmakanthKaspa wants to merge 7 commits intofrappe:developfrom
UmakanthKaspa wants to merge 7 commits intofrappe:developfrom
Conversation
Author
@0MUHAMMEDIRFAN Done. Breakpoints moved to toolbar. |
0MUHAMMEDIRFAN
approved these changes
May 6, 2025
ruchamahabal
requested changes
May 22, 2025
| setPanAndZoom(canvasProps, canvasEl, canvasContainerEl) | ||
| }) | ||
|
|
||
| function zoomIn() { |
Member
There was a problem hiding this comment.
- 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? |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





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