-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
fix(editor): Implement canvas zoom UX improvements #7376
Conversation
elsmr
commented
Oct 6, 2023
- Fix pinch-to-zoom
- Support command + scroll to zoom
- Improve accuracy of zooming (scroll more = zoom more)
- Zoom limits
- Zoom relative to mouse position
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Files matching
Make sure to check off this list before asking for review. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #7376 +/- ##
=======================================
Coverage 33.40% 33.41%
=======================================
Files 3389 3389
Lines 206627 206654 +27
Branches 22307 22308 +1
=======================================
+ Hits 69032 69055 +23
- Misses 136477 136481 +4
Partials 1118 1118
☔ View full report in Codecov by Sentry. |
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.
You made my day @elsmr! This already makes things magnitudes better 💯
Apart from clamping the maximum zoom level a bit more, the only major thing I would still like to address is to try and make targeted pinch-zooming a bit easier to use, by focusing on the zoom start position.
What I mean by this is:
- In Miro, you can pretty carelessly pinch-zoom to an edge of a sticky note, and it adjusts the zoom center to compensate for the offset:
Screen.Recording.2023-10-07.at.8.23.02.mov
- For comparison, when doing this in our editor, you tend to lose track of the object you were zooming in on:
Screen.Recording.2023-10-07.at.8.23.32.mov
This can be "validated" by cmd-zooming with the mouse scrollwheel: if you scroll the wheel a bit slower and try holding the pointer on the top of the targeted element as it gets closer, you won't drift as far.
@mieky good find, It was already kind of zooming towards the mouse position, but the math was off because I was not taking into account opened sidebars, top bars etc. Works the same as in your Miro screen recording now 🎉! |
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.
I love it! Such a difference it makes. Had a cursory glance at the code – not really familiar with the details of our canvas code but looks well thought out. Also nice job getting rid of an extra dependency while at it.
Kudos for such a noticeable improvement, Elias! 🚀
1 flaky test on run #2448 ↗︎
Details:
cypress/e2e/24-ndv-paired-item.cy.ts • 1 flaky test
Review all test suite changes for PR #7376 ↗︎ |
✅ All Cypress E2E specs passed |
* master: (42 commits) fix(editor): Make workflow history button available only for dev builds (#7392) refactor: Upgrade to pnpm 8.9 (no-changelog) (#7393) ci: Identify NPM releases as `stable` (no-changelog) fix(editor): Implement canvas zoom UX improvements (#7376) feat(core): Switch binary filesystem mode to nested path structure (#7307) fix(editor): Fix completions for `.json` on quoted node name in Code node (#7382) fix(Notion Node): Handle empty values correctly for Notion selects + multi selects (#7383) feat(editor): Make PDF and Audio binary-data viewable in the UI (#7367) fix(Google Sheets Node): Fix "Maximum call stack size exceeded" error on too many rows (#7384) refactor(core): Refactor nodes loading (no-changelog) (#7283) fix(core): Add an option to enable postgres ssl with default certs (#6889) feat(editor): Workflow history [WIP]- Add restore and clone into new workflow actions (no-changelog) (#7359) fix(HTML Node): Update property fields to not use expressions on drag (#7379) fix: Add role check for upgrade path (#7374) fix(editor): Remove excess margin below run data editor (#7372) fix(Google Drive Trigger Node): Add Shared Drives support (#7369) feat(core): Add Job Summary to Worker response (#7360) feat(Execute Workflow Node): Run once for each item mode (#7289) refactor(core): Move `copyInputItems` to node helpers (no-changelog) (#7299) refactor(core): Create controller for binary data (no-changelog) (#7363) ... # Conflicts: # cypress/e2e/5-ndv.cy.ts
# [1.11.0](https://github.com/n8n-io/n8n/compare/[email protected]@1.11.0) (2023-10-11) ### Bug Fixes * **core:** Add an option to enable postgres ssl with default certs ([#6889](#6889)) ([789e1e7](789e1e7)) * **core:** Fix error on missing paired item data ([#7399](#7399)) ([47e8953](47e8953)) * **core:** Missing pairing info ([#7326](#7326)) ([e2c3c7a](e2c3c7a)) * **core:** Prevent object deletion request on no prefix match ([#7366](#7366)) ([63e11e4](63e11e4)) * **editor:** Fix completions for `.json` on quoted node name in Code node ([#7382](#7382)) ([86e7ec7](86e7ec7)) * **editor:** Implement canvas zoom UX improvements ([#7376](#7376)) ([7e06b31](7e06b31)) * **editor:** Make workflow history button available only for dev builds ([#7392](#7392)) ([7ed466d](7ed466d)) * **editor:** Remove excess margin below run data editor ([#7372](#7372)) ([3fa2764](3fa2764)) * **editor:** Sanitize HTML binary-data before rendering in the UI ([#7400](#7400)) ([2b075bf](2b075bf)) * **editor:** Use display option's @Version specifier ([#7351](#7351)) ([afbf0c3](afbf0c3)) * **Google BigQuery Node:** Location default to jobReference ([#7354](#7354)) ([97bb703](97bb703)) * **Google Drive Trigger Node:** Add Shared Drives support ([#7369](#7369)) ([3e7a4d3](3e7a4d3)) * **Google Sheets Node:** Fix "Maximum call stack size exceeded" error on too many rows ([#7384](#7384)) ([732b15a](732b15a)) * **HTML Node:** Update property fields to not use expressions on drag ([#7379](#7379)) ([77643e5](77643e5)) * **Notion Node:** Handle empty values correctly for Notion selects + multi selects ([#7383](#7383)) ([fbcd1d4](fbcd1d4)) * **Set Node:** Increase search priority ([#7358](#7358)) ([e5ad1e7](e5ad1e7)) * **Webhook Node:** Backward compatible form-data parsing for non-array files ([#7385](#7385)) ([6479eb1](6479eb1)) ### Features * **core:** Add Job Summary to Worker response ([#7360](#7360)) ([b8608ce](b8608ce)) * **core:** Integrate object store as binary data manager ([#7253](#7253)) ([1a661e6](1a661e6)) * **core:** Switch binary filesystem mode to nested path structure ([#7307](#7307)) ([0847623](0847623)) * **editor:** Make PDF and Audio binary-data viewable in the UI ([#7367](#7367)) ([8187be1](8187be1)) * **editor:** Support autologin for upgrade path ([#7316](#7316)) ([1dfa052](1dfa052)) * **Execute Workflow Node:** Run once for each item mode ([#7289](#7289)) ([c8c14ca](c8c14ca)) * **Item Lists Node:** Split merge binary data ([#7297](#7297)) ([965db8f](965db8f)) * **Loop Over Items (Split in Batches) Node:** Automatically add a loop + rename ([#7228](#7228)) ([7b773cc](7b773cc)) * **Notion Node:** Fetch child blocks recursively ([#7304](#7304)) ([193181a](193181a)) Co-authored-by: netroy <[email protected]>
Got released with |
# [1.11.0](https://github.com/n8n-io/n8n/compare/[email protected]@1.11.0) (2023-10-11) ### Bug Fixes * **core:** Add an option to enable postgres ssl with default certs ([#6889](#6889)) ([789e1e7](789e1e7)) * **core:** Fix error on missing paired item data ([#7399](#7399)) ([47e8953](47e8953)) * **core:** Missing pairing info ([#7326](#7326)) ([e2c3c7a](e2c3c7a)) * **core:** Prevent object deletion request on no prefix match ([#7366](#7366)) ([63e11e4](63e11e4)) * **editor:** Fix completions for `.json` on quoted node name in Code node ([#7382](#7382)) ([86e7ec7](86e7ec7)) * **editor:** Implement canvas zoom UX improvements ([#7376](#7376)) ([7e06b31](7e06b31)) * **editor:** Make workflow history button available only for dev builds ([#7392](#7392)) ([7ed466d](7ed466d)) * **editor:** Remove excess margin below run data editor ([#7372](#7372)) ([3fa2764](3fa2764)) * **editor:** Sanitize HTML binary-data before rendering in the UI ([#7400](#7400)) ([2b075bf](2b075bf)) * **editor:** Use display option's @Version specifier ([#7351](#7351)) ([afbf0c3](afbf0c3)) * **Google BigQuery Node:** Location default to jobReference ([#7354](#7354)) ([97bb703](97bb703)) * **Google Drive Trigger Node:** Add Shared Drives support ([#7369](#7369)) ([3e7a4d3](3e7a4d3)) * **Google Sheets Node:** Fix "Maximum call stack size exceeded" error on too many rows ([#7384](#7384)) ([732b15a](732b15a)) * **HTML Node:** Update property fields to not use expressions on drag ([#7379](#7379)) ([77643e5](77643e5)) * **Notion Node:** Handle empty values correctly for Notion selects + multi selects ([#7383](#7383)) ([fbcd1d4](fbcd1d4)) * **Set Node:** Increase search priority ([#7358](#7358)) ([e5ad1e7](e5ad1e7)) * **Webhook Node:** Backward compatible form-data parsing for non-array files ([#7385](#7385)) ([6479eb1](6479eb1)) ### Features * **core:** Add Job Summary to Worker response ([#7360](#7360)) ([b8608ce](b8608ce)) * **core:** Integrate object store as binary data manager ([#7253](#7253)) ([1a661e6](1a661e6)) * **core:** Switch binary filesystem mode to nested path structure ([#7307](#7307)) ([0847623](0847623)) * **editor:** Make PDF and Audio binary-data viewable in the UI ([#7367](#7367)) ([8187be1](8187be1)) * **editor:** Support autologin for upgrade path ([#7316](#7316)) ([1dfa052](1dfa052)) * **Execute Workflow Node:** Run once for each item mode ([#7289](#7289)) ([c8c14ca](c8c14ca)) * **Item Lists Node:** Split merge binary data ([#7297](#7297)) ([965db8f](965db8f)) * **Loop Over Items (Split in Batches) Node:** Automatically add a loop + rename ([#7228](#7228)) ([7b773cc](7b773cc)) * **Notion Node:** Fetch child blocks recursively ([#7304](#7304)) ([193181a](193181a)) Co-authored-by: netroy <[email protected]>