-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 UI/UX of the Run plugin configuration widgets #22141
PR: Improve UI/UX of the Run plugin configuration widgets #22141
Conversation
- Instead, show label with the current file name. - That helps to decrease the complexity of this dialog.
This also helps to decrease the complexity of that dialog.
- The name of that config is the "Custom" string localized. - If the config is not named differently, additional customizations will also be saved in "Custom". - Also, only show global configs (i.e. those created in Preferences) or the ones that correspond to the file currently displayed in RunDialog.
- For the dialog: * Move configuration name to the beginning. * Simplify layout of extension and context comboboxes. * Show localized executor name in dialog's title. * Prevent saving configs without a name. - For the conf page: * Don't show configs set for files. * Code style improvements. - Also, remove several unused constants.
Also, disable delete and clone buttons if there's no index selected in RunParametersTableView and add a test for this new functionality.
- Also, improve the main label of its config page and fix the name of one of its actions.
Also add test to cover that case.
- This widget is based on superqt's QCollapsible widget. - It has several style customizations on top to match our style.
…ialog - Also, move QLineEdit to name the config to the top and show it inside a QGroupBox. - And move extra spacing between QGroupBoxes to the style of the Preferences dialog.
- IPython console group: Remove grid layout to give more space to introduce command line options. - External terminal: Change text of of several widgets to make options easier to understand. - Profiler: Minor inheritance problems.
…leWidget - We use PointingHandCursor for that, which will better indicate to users that the button is clickable. - That requires a more recent version of superqt, which exposes that button publicly.
- Correctly display the entries of its comboboxes now that they are instances of SpyderComboBox. - Fix error in Python 3.10+ when centering RunDialog. - Fix error in its config page when an executor doesn't have parameters for specific files.
This is done to follow the same convention present in the Profiler and External Terminal plugins.
This will give more space to users to enter them.
- Remove extra margins added by the config dialog style that this dialog belongs to. - Make the dialog fit exactly to the size of the widgets inside it. - Increase inner padding. - Remove unnecessary widget that acted as container for the others. - Reorganize code for clarity.
The previous solution was not correct because it cropped the title of those QGroupBoxes for some font types.
Those extensions are correctly added by other plugins.
- That way those configurations will be displayed in the Run confpage, which will allow users to easily check what are the default parameters for each one. - Also, fix showing the last selected parameters for the file after opening the dialog.
- Simplify text for its opening label and buttons. - Add label to the left of the executor combobox to make clearer what it's about. - Don't show parameters table inside a QGroupBox to decrease its importance (they depend on the executor). - Add left and right horizontal margins to the parameters table to improve the table's left alignment.
- Show parameters name in the first column, then extension and finally context. - Reorganize parameters so that Python and IPython extensions are shown first and second by default. - Simplify column names. - If parameters are default, show a localized version of "Default" instead of its actual name. That's useful in case users switch between select different languages in the interface.
That way it'll be easier for users to understand that they can edit even the default configurations.
- Use localized version of "Default" string instead of the params name. - Don't allow to change the params name.
81744d7
to
b193699
Compare
To @dalthviz:
We discussed this with @conradolandia and agree with you. That's why I removed "Save globally" and moved the Delete button to the dialog button box at the bottom. To help users understand where to set global configurations, I added a new entry called like that to the Run menu:
No, it refers to deleting file configurations only. To clarify that, I changed the behavior of that button so that it's disabled for default or global configurations.
It should be fixed now by the change I mentioned above.
It's no longer a problem.
That's a great suggestion to make things consistent. I implemented it in one of my last commits.
It shouldn't be a problem anymore.
Thanks for noticing it. It should be fixed now. To @jitseniesen:
Great suggestion! I did that in one of my last commits (see updated screenshots in the OP). |
In addition to fixing the problems found in review, I took the opportunity to improve the design of the Run page in Preferences (see the updated OP). |
Gave another check and I think the difference between the local vs global configs is clearer now 👍 However, there are a couple of things that seem like bugs/I'm still not sure about:
So my guess is that it is not possible to override an existing local config? In fact, as things are right now, is not possible to select one of the already created configs/presets without creating a new config, right? If that is the case, probably more feedback about the error needs to be provided. Some ideas:
From the checks I have been doing, I would say that from the run dialog it would be nice to support the following operations:
Not sure how much of the these things are feasible/fall under the scope you had for this PR/the general functionality of the run dialog @ccordoba12 but sharing the ideas that came to mind while checking this |
- Show error status icon when name is empty or already taken. - Disable changing the config name if it's a saved one. - Show the same messages in both ExecutionParametersDialog and RunDialog.
- Show current text on their tooltips and use icons instead. - That allows us to organize the buttons in a horizontal layout, which is more compact and lean. - For this it was useful to extend the create_button method of SpyderConfigPage to simplify the creation of buttons in confpages. - Also, fix extra padding in tooltips of SidebarDialog.
It was doing nothing before.
This avoids an additional level of nesting that probably doesn't make much sense to users (as suggested in review).
This will allow users to easily understand where they need to go to set global configurations.
That allows to correctly delete confs that haven't been saved yet.
e8322fb
to
08ffabc
Compare
Thanks @dalthviz for the additional review! About your comments:
Good catch! It should be fixed now.
These problems were an oversight on my side. The thing is I added a validation so that users can't introduce repeated config names in the run dialog. But I forgot to skip it when the config name and the one shown in the preset combobox are the same. So, please test again.
This should be fixed now.
This is not possible anymore, i.e. with the changes done here. I think it was before, but then it gave users the odd impression that settings were not saved (see issue #20700, which was reported several times). However, to not force users to provide a name when they customize global parameters, @conradolandia and I decided it'd be a good idea to set
This should be possible now. Please check again. |
- To do that we automatically set a custom name for global configs. That way users will be able to customize those configs as many times as they want. - Don't run config name validations for global configs if they haven't been customized.
08ffabc
to
353e4bd
Compare
Gave this another check and seems like things are now working as expected. Will give the code another check but for the most part I would say that this looks good to me 👍 |
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 ! Left a couple of questions/comments but this LGTM 👍
Also, on a last manual check, I noticed that seems like you can create a global config with the same name of an already create per file config:
Not sure if this could be thought as a bug or not but letting you know. I'm approving this so feel free to merge if you think is ready @ccordoba12
spyder/app/utils.py
Outdated
# height or position) that other widgets can need to position relative to | ||
# it. | ||
# * **DO NOT** use it to access other plugins functionality through it. | ||
app.main_window = main |
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.
Rather than giving access to the whole main window shouldn't be created specific accessors? So, leaving this as app._main_window = main
and creating a set of functions to get the values needed so get_mainwindow_width
, get_mainwindow_height
, get_mainwindow_position
, etc?
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.
That's a very good idea! Thanks @dalthviz for the suggestion 👍🏽
I'll implement it before merging.
@@ -643,7 +643,6 @@ | |||
('run', [ | |||
'breakpoints', | |||
'configurations', | |||
'defaultconfiguration', |
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.
There is no need to bump the config version, right?
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.
This config option wasn't used anywhere. That's why I didn't bump CONF_VERSION
.
Co-authored-by: Daniel Althviz Moré <16781833+dalthviz@users.noreply.github.com>
Yep, that's correct. Since global configs take precedence over file ones, I think that validation is not appropriate and so I didn't implement it. Furthermore, it could be too restrictive for users given that they can create as many file configs as they want for as many files as possible. The good thing is that there is a subtle clue in If users let us know that's not enough, we can think about how to disambiguate them. But for now, I think that's ok. |
Also, use those accessors in RunDialog to center it when uncollapsing the custom config widget.
One last note: this PR also contains a couple of small fixes to our tests to deal with the Numpy 2.0 release (which is causing the failures in master). |
No, it's not. Please open a new issue about it and add to it a small video showing what you did to better understand your problem. |
Description of Changes
Run > Open run settings
. In addition, that dialog was modified so that it allows to only set run settings per file (just as in Spyder 5). That makes it simpler to understand and leaves creating global execution configs to the Run entry in Preferences.CollapsibleWidget
widget, which is based onQCollpasible
from SuperQt, and use it inRunDialog
. That required increasing our minimal constraint on SuperQt to>=0.6.2
.Visual changes
Configuration per file
Before
After
Preferences page
Before
After
Dialog to create global run configurations
Before
After
Issue(s) Resolved
Fixes #21878
Fixes #20700
Fixes #20569
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: @ccordoba12