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
PR: Improve UX of the Plots plugin #22029
Conversation
@dalthviz, could you review if the functionality of these changes is working as expected? Thanks! About the UI/UX changes, I already discussed them with the UX team and they agreed with them. |
Gave this a check and seems like the double click is changing the zoom factor value even when the option to Other than that seems like things are working 👍 |
Great catch @dalthviz! I disabled doing zooming in and out with double clicks when |
- That makes the zoom in/out buttons be enabled by default, which is a much better usability experience than having them disabled. - Adjust the plot scale factor according to the scaling of fitted image, so that zoom in/out works as expected. - Fix test_zoom_figure_viewer, which checked that functionality.
That simplifies the layout of that widget and it'll also allow us to change the order of thumbnails in it with drag and drop.
Also, increase default width of thumbnail bar to go with this change.
3ea1e40
to
1d9bcf4
Compare
Hello @ccordoba12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-05-15 17:07:28 UTC |
e2f2e19
to
307881a
Compare
Thanks for the additional review @dalthviz! After considering it carefully, I decided to push the following improvements to make the UX more intuitive:
I updated the OP with these new changes accordingly. |
Gave this another check and seems like now, besides the previous behavior (double double click need to effectivly change between zoom factors when changing between plots), there is also a possiblitity to make the zoom factor to get stuck in 100% 🤔: Edit: Could it be worthy to add some sort of test for the double click behavior? |
307881a
to
5a1c3f4
Compare
- Move it to the plugin toolbar and check it by default after every new plot is generated so the plot always fit in the pane. - Unchecking the action makes the plot to zoom in at its full size. - Clicking the zoom in/out buttons unchecks the action, which means the plot doesn't fit into the pane anymore. - Save the auto-fit state in the current thumbnail. This will be useful to restore the zoom level of each plot when loaded. - Remove the auto_fit_plotting option because it's no longer needed.
5a1c3f4
to
5a95c07
Compare
@dalthviz, I didn't understand that problem very well but I do now. So, I rewrote one of my previous commits to fix it. That removed the ability to zoom out to the previous size with a second double-click. But I think that's not so important now that I added the auto-fit button to the toolbar. So, please check again. |
Checked again and now I'm unable to reproduce the mentioned behaviors so seems like things are working as described 👍 The only suggestion that came to mind while checking the new behavior is to maybe add a shortcut for the new auto-fit button. |
Good idea. I set I also changed the shortcuts for save/close all plots to avoid issues in Eastern European keyboards. |
- Also, change shortcuts for save/close all plots to avoid issues in Eastern European languages. - Add clarifying comment the usage of timers to set the scrollbar values after a figure is loaded.
ef7a671
to
0f68022
Compare
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.
Thanks @ccordoba12 ! Things LGTM 👍 Maybe adding some sort of test could be nice to have but leaving this approved so feel free to merge
I added a couple of tests to cover the new auto-fit and zoom level per plot functionality, which I think are the most important ones added here. So, this is ready now. |
Description of Changes
Fit plots
action to the plugin toolbar and make plots be fitted automatically to the pane the first time they are generated. That makes the zoom in/out buttons be enabled by default, which is a much better usability experience than having them disabled.Fit plots
shows them at full size.Fit plots
and zoom level for every plot. That way, we'll be able to show each plot in the specific way users want to see them.Visual changes
Main toolbar
Before
After
Fit plots
buttonSeparate zoom level for each plot
Drag and drop
Zoom in on double click
Issue(s) Resolved
Fixes #21899.
Fixes #12158
Part of spyder-ide/ux-improvements#19
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: