Skip to content
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 of Plugins page in Preferences #21101

Merged
merged 20 commits into from
Jul 28, 2023

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Jul 5, 2023

Description of Changes

  • Add a new ElementsTable widget to make easier for users to understand what plugins they'd like to turn on/off.

    Before

    image

    After

    imagen

  • Allow external plugins to be disabled in that page.

  • Use different icons and improve description for several plugins.

  • Sort entries in that table by plugin name but in a localized way. That meant adding a new dependency called pyuca, which can sort non-English strings correctly.

  • Highlight entire row of the shortcuts table in Preferences.

Issue(s) Resolved

Fixes #17464.

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

@ccordoba12
Copy link
Member Author

@CAM-Gerlach, could you review the plugin descriptions changed in this PR? Thanks!

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ccordoba12 ! Give this a check locally and seems like is working as expected (even the external plugins enable/disable functionality!) 👍

Left a comment regarding the plugins API changes which probably require an API version bump (and the respective updates in the different resources and external plugins repos). Besides that, seems to me that implementing a way to search for plugin entries with the new widget could be worthy. Other than that this LGTM 👍

"""
raise NotImplementedError('A plugin name must be defined!')

def get_description(self):
@staticmethod
def get_description():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this changes base methods (get_description and get_icon) for the plugins seems like the API version should be updated?:

"""
Spyder API Version.
The API version should be modified according to the following rules:
1. If a module/class/method/function is added, then the minor version
must be increased.
2. If a module/class/method/function is removed, renamed or changes its
signature, then the major version must be increased.
3. Whenever possible, deprecation marks and alerts should be employed in
order to inform developers of breaking-compatibility changes in a
future API release. In such case, the minor version should be increased
and once the deprecated APIs disappear then the major version should be
updated.
"""
VERSION_INFO = (0, 9, 1)
__version__ = '.'.join(map(str, VERSION_INFO))

Also, since this changes de API maybe could be worthy to also eventualy update the related plugin resources (docs, example repo, plugins repos, etc) so maybe creating issues in the respective repos could be worthy to keep track of this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this changes base methods (get_description and get_icon) for the plugins seems like the API version should be updated?

Yep, you're right. I'll push a commit to bump our API version.

Also, since this changes de API maybe could be worthy to also eventualy update the related plugin resources (docs, example repo, plugins repos, etc) so maybe creating issues in the respective repos could be worthy to keep track of this change?

I think the best we can do for now is to document the API changes in our changelog (I'll also add an entry there), so that plugin authors and ourselves remember what's been added/removed in version 6. Then, when we finally release it, we could do what you propose (I think right now it's premature to do that because more API could be necessary).

@ccordoba12
Copy link
Member Author

ccordoba12 commented Jul 10, 2023

Besides that, seems to me that implementing a way to search for plugin entries with the new widget could be worthy.

Agreed. I'll add that functionality when using ElementsTable to build the list of detected environments in Preferences > Main Interpreter

Other than that this LGTM 👍🏽

Great!


Also, pinging @jitseniesen about this one because it requires changes to external plugins to be compatible with Spyder 6 (see the entry I added in New API features in the Spyder 6 changelog).

This will help us to display a set of elements with title, description,
icon and an associated widget (e.g. a checkbox)
…nstantiation

Also, improve description of some plugins and add new icons for others.
- I saw that these changes are necessary after using the widget for the
Plugins config page.
- Wrap description text in case it's too long.
- Add some left padding to items to make icons look centered.
- Increase size of the column widget so that widgets are not so close to
the right border.
- Adjust columns and rows size in showEvent/resizeEvent so that the
widget looks good at different sizes.
Also, improve some docstrings of methods changed in the new API
Also, use it in the Plugins config page to show which ones are core
plugins.
…lements

This simplifies its construction a bit.
Also, use that option to center additional_info in ElementsTable.
Instead, I replaced that with the new fonts API.
Also, sort external and internal plugins alphabetically for easy
searching.
We need to use the Pyuca package for that, so I added it as a new
dependency.
Also, add entry to the Spyder 6 changelog describing them and other
entries with the new features merged since alpha1.
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay; I got a big backlog of GitHub notifications and didn't see this. Here's my UI text pass.

General common changes:

  • Focus on clearly describing the user-facing functionality rather than lower-level implementation details (which will be mostly of interest to those already aware of them)
  • Use more consistent framing and verbiage
  • Use clearer, more idiomatic and more concise phrasing
  • Describe additional key points of several features

spyder/api/plugin_registration/_confpage.py Outdated Show resolved Hide resolved
spyder/api/plugin_registration/_confpage.py Outdated Show resolved Hide resolved
spyder/api/plugins/new_api.py Outdated Show resolved Hide resolved
spyder/plugins/breakpoints/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/switcher/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/toolbar/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/tours/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/variableexplorer/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/workingdirectory/plugin.py Outdated Show resolved Hide resolved
Copy link
Member Author

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CAM-Gerlach for your suggestions! I agree with most of them, except for the ones I left a comment for below.

spyder/api/plugin_registration/_confpage.py Outdated Show resolved Hide resolved
spyder/plugins/completion/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/ipythonconsole/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/maininterpreter/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/preferences/plugin.py Outdated Show resolved Hide resolved
Copy link
Member Author

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last suggestion, then it should be ready for me.

spyder/plugins/completion/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/outlineexplorer/plugin.py Outdated Show resolved Hide resolved
spyder/plugins/preferences/plugin.py Outdated Show resolved Hide resolved
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI text LGTM, thanks (including your last suggestion)

@ccordoba12
Copy link
Member Author

@dalthviz, are you ok with merging this one?

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
@CAM-Gerlach
Copy link
Member

Before/after in table format

Before After
imagen imagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is not possible to disable external plugins
3 participants