-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Do not reset zoom when switching between workspaces #9233
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9233 +/- ##
========================================
Coverage 74.16% 74.17%
========================================
Files 428 428
Lines 44964 44971 +7
Branches 3918 3919 +1
========================================
+ Hits 33348 33356 +8
+ Misses 11616 11615 -1
🚀 New features to boost your workflow:
|
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.
LGTM as fix
However I would propose to get rid of triggering resize event on windows as potentially it may lead to unnecessary layout changes in other UI elements.
My idea here is to wrap onResize with useCallback depending on fitCanvas.
And wrap setLayoutConfig calling this callback in zero setTimeout after setting the state. Not sure about if we really need setTimeout. As this is not related directly to this PR is up to you to implement or not.
|
Motivation and context
An improvement requested by the data annotation team: switching between workspaces (standard and review) caused the zoom level to reset, which was not user-friendly. This PR addresses the issue.
How has this been tested?
Checklist
develop
branchLicense
Feel free to contact the maintainers if that's a concern.