koxudaxi / poetry-pycharm-plugin

A PyCharm plugin for poetry

Home Page:https://koxudaxi.github.io/poetry-pycharm-plugin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error dialogs are unusable on macOS 11

agatti opened this issue · comments

Describe the bug

First off, I'm not sure whether this is a problem specific to the plugin or to PyCharm itself. Feel free to close this as invalid right away if it's the latter case.

Anyway, the poetry lock/update/upgrade error dialog is unusable. Text cannot be copied from the dialog, all text is wrapped and centred, and things are so narrow that it is actually kind of difficult to figure out what's going on (remember, cannot even copy and paste the content elsewhere to read it properly).

To Reproduce

Steps to reproduce the behavior:

  1. Edit pyproject.toml in the currently loaded project to add an unknown dependency or an invalid version.
  2. Let the plugin update the project (either lock or update, doesn't matter).
  3. Wait for the error dialog to show up.

Expected behavior

A more usable error dialog, I guess - something close to what it used to be in macOS 10.15. I am not sure whether this can be easily achieved by using a different dialog class in the plugin or not, or if a whole new modal dialog should be designed and implemented instead...

Screenshots

Screenshot 2021-05-15 at 15 01 00

Environments:

  • IDE: PyCharm Professional 2021.1.1
  • OS: macOS 11.3.1
  • Poetry Version 1.1.6
  • Plugin version 1.1.3

For comparison, when performing poetry project updates outside PyCharm and then letting it install the dependencies from the updated project using the top banner on a project file - this one for clarity:

Screenshot 2021-05-15 at 15 18 25

the error looks like this:

Screenshot 2021-05-15 at 15 16 27

which is arguably more usable than what I'd get when updating the project from the plugin itself.

Thank you for creating this issue.

I can't reproduce this problem. 😢
Because I can't update my macOS.

I want to hear some information to resolve this information.

Well, PyCharm shows that dialog from here: https://github.com/JetBrains/intellij-community/blob/c5bb04fa149441b0f07472ba9e116d87c9577fc9/python/src/com/jetbrains/python/packaging/PyPackageManagerUI.java#L61 - I guess ProgressManager shows the second dialog in case of an exception being thrown and fetching the information needed to fill it from the InstallTask static class in the same file.

Maybe the plugin could use the same mechanism to trigger a project lock/upgrade when pyproject.toml changes? Using Messages.showErrorDialog for large amounts of (formatted) text is not really the best choice on macOS 11, sadly.

@agatti
Thank you for giving great hint.
The poetry plugin was created from Pipenv integration in PyCharm.
I checked the code of Pipenv.
https://github.com/JetBrains/intellij-community/blob/3661d0cc581bb4c21c0b85f0b599821d312c4ce7/python/src/com/jetbrains/python/sdk/pipenv/pipenv.kt#L387
The code was changed.
I will fix the code the same as the code of Pipenv.
Screenshot from 2021-05-16 22-39-19

@agatti
I have sent a new version to Jetbrains Market.
You can install the new version after they will approve the plugin within 2-days.

But, you can download it following this link.
https://github.com/koxudaxi/poetry-pycharm-plugin/releases/tag/1.1.4

@koxudaxi I just got the new version through JetBrains updates - works a treat, thanks a lot!

Thank you for your response.
I closed this issue.