Overview
The zoom interface has controls for debugging the zoom which was added as part of the PoC. There's now a designed version of this interface ready to be implemented. This issue will also remove the debugging controls that were from the PoC.
Note: there's another issue for improving the mouse panning: #3458535: Middle click + drag doesn't work correctly if middle click is inside preview iframe.
Proposed resolution
Implement the simplified zoom interface.


User interface changes
Smooth zoom with pinch and using the slider!

| Comment | File | Size | Author |
|---|---|---|---|
| #26 | pinch zoom example.gif | 7.17 MB | jessebaker |
| #7 | Screenshot 2024-07-26 at 9.08.31 AM.png | 75.31 KB | gauravvvv |
| #7 | Screenshot 2024-07-26 at 9.06.09 AM.png | 165.16 KB | gauravvvv |
| #4 | Screenshot 2024-07-24 at 9.39.18 AM.png | 39.34 KB | gauravvvv |
| Screenshot 2024-07-23 at 12.49.42 PM.png | 2.75 KB | lauriii |
Issue fork experience_builder-3463307
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments
Comment #2
gauravvvv commentedComment #4
gauravvvv commentedBased on the image in the issue description, the range slider for zoom should not include additional values like X, and Y points or the "debug to scroll" button. Do I need to hide these in the current tray or create a new one for the range slider? Thank you.
Comment #5
lauriiiCould we add a "debug" prop to the component to show these things? In a future issue, we could consider toggling that based on an environment variable (or something else) but for now it could be something that developers would have to turn on manually within code.
Comment #6
gauravvvv commentedComment #7
gauravvvv commentedI have added a prop debug, if it is true then it will display the X, Y coordinates and "Debug: scroll to middle" button and on debug false it will only display the zoom range slider.
Debug: false

Debug: True

Comment #8
wim leersThose screenshots look great, @Gauravvvv! 🤩
Keeping at , but IMHO this should be integrated with
AppConfiguration(introduced by #3452582) — see MR review.Comment #9
wim leersMerged in upstream, CI should be green again 👍
Comment #10
lauriiiThis looks pretty nice! It would be super cool if we could slightly smoothen the transition when zooming. This can be a follow-up but could be worked on here too in case you're interested in this 😊
Comment #11
gauravvvv commentedAddressed feedback on using
AppConfigurationas well smoothen the transition when zoomingComment #14
wim leersUnit tests and E2E tests are failing … 😅
Comment #15
gauravvvv commentedComment #16
gauravvvv commentedComment #17
wim leersStill not passing tests … 😅 why are you marking this ? 🤔
Comment #18
gauravvvv commentedHi @Wim Leers, I changed the status to needs review before the test results.
Comment #20
jessebaker commentedComment #21
jessebaker commentedThis is now ready for review. I picked up from the work by @gauravvvv and implemented the suggestion from @lauriii in #10. Zoom controls now exist in their own React component and an array of tests have been added (and the existing tests cleaned up as a result of me getting absolutely stuck on a weird race condition that seemingly was nothing to do with this issue!)
Comment #22
bnjmnmLooking good - got some nits and bits in the MR that I'm sure can be addressed pretty easily.
Comment #23
gauravvvv commentedComment #24
wim leersAwesome progress here! 👏
Can we get an updated GIF in the issue summary to showcase that awesomeness? 🙏😇
Also: AFAICT this is ready for review! 😄
Comment #25
balintbrewsJust adding a comment here to note that there is some testing code added in #3463618: Include component props form in undo (commit in MR: 5aa96e) which should be updated once this issue lands and we have the
loadURLandWaitForXBLoadedcommand available.Comment #26
jessebaker commentedComment #28
bnjmnmComment #29
bnjmnmComment #30
hooroomooRemoved the debugging controls from the PoC and updated the IS accordingly. I don't think there is really a need for them right now and we can easily add them back if that changes in the future.
Comment #31
hooroomooComment #33
bnjmnmComment #34
lauriiiSo nice to see this improvement land! 🚀 🎉