-
-
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
Follow up to work that added refresh buttons to editors from the Variable Explorer #21556
Comments
@jitseniesen, could you take care of this one? |
I will have a look at it. |
@ccordoba12 I thought a bit about this and there is a fair amount of stuff to talk about.
The API of SpyderWidgetMixin stores the menus and toolbars in a global registry. I don't understand what that is good for. I'm afraid that this is actually harmful, because it means that there will always be a reference to the menus and toolbars so they will never be garbage collected, which probably means that the editors themselves and the data stored in them will also not be garbage collected (though I did not look in the details). Can somebody explain what the reason is for storing everything in a global registry as this is something that I have wondered about before. I actually thought about having all the editors inherit from a base class. Currently the implementations are all different and this would unify and simplify the code, and longer term allow us to add an API for plugins to add editors for other types. But I decided that this would be too much work for 6.0.
Currently, the toolbars and context menus of the different editors look as follows:
So there is definitely some room for improvements. Any specific suggestions?
I assume that you are talking about the buttons at the bottom ("Save and close" and "Close"). I will copy the spacing from the Python Path dialog and see how that works out.
Okay. |
It's done to easily get access to a menu or toolbar by its id from any other plugin or widget that inherits from SpyderWidgetMixin.
I agree that for the Variable Explorer editors that's not going to allow Python to garbage collect them after they are closed. To solve this and keep using the SpyderWidgetMixin API, I propose to add a
Ok, no problem.
I think @CAM-Gerlach can help you to review and decide on a nice ordering for actions in toolbars and menus, which could involve adding separators for the Dataframe toolbar because it has too many actions. So, please talk to him about that.
Correct. |
@ccordoba12 I see in |
Yes, I think that's a good idea.
Mac adds by default too much space between the content area and the buttons below it. So, we don't need to add more space (as it's necessary on Windows and Linux, hence the |
@ccordoba12 I did not notice this before but spyder/spyder/api/widgets/mixins.py Lines 618 to 625 in df5c5bd
I am going to change this and add |
@jitseniesen, that's a good idea, thanks for thinking about it.
I quickly looked at the other classes from which |
General thinkingCategories
Priorities
List of recommended changes
Namespace browser (Variable Explorer)
Array editor
Collections editor
DataFrame editor
Object Explorer
Final recommended arrangementNamespace browser (global Variable Explorer pane)
Array editor
Collections editor
DataFrame editor
Object explorer
|
@CAM-Gerlach Thanks for your clear and well-reasoned suggestions. They all make sense to me so I implemented them in the PR. There are a couple of further details (which I perhaps should have discussed before submitting the PR) Firstly, the dataframe editor currently has four buttons in the bottom left of the dialog window: I did not know what to do with the last button, Secondly, you indicated separators in the toolbar. Are these supposed to be visible in the UI? I don't know where in Spyder we use separators in the toolbar. Thirdly, in the Variable Explorer pane itself, the Refresh button is not at the front of the toolbar. Should I move it there? |
BTW, for others following, I had updated the above comment to incorporate @jitseniesen 's feedback and further adjustments following discussion with @ccordoba12 , @jitseniesen and @conradolandia . Specifically, here's a changelog:
|
This is a series of tasks that I think we should address after merging PR #21312:
SpyderWidgetMixin
and use its API to build actions, menus and toolbars. I think that's important because those widgets are quite complex now, so if we plan to add more functionality to them in the future, it'd be nice if we could do it in a more structured way. And using that API could help with that.The text was updated successfully, but these errors were encountered: