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

Reorganize list widget layout and fix issues #31

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

goanpeca
Copy link
Contributor

@goanpeca goanpeca commented Apr 4, 2024

Part of #14


Comments from original issue that were fixed!

  1. Align plugin name and summary in the installed plugins section.
  2. Align installation info, Make a standard size? ( I know this button adjusts by the sizes on the drop down menus held within. Eliding may help here (see item below).

image

  1. Ensure author names are aligned. (maybe misaligned only with many authors and in the presence of an update button?)

image

  1. Ensure very long descriptions and author lists are not cut off.

image

  1. Elide version numbers when long.
    When users have a plugin dev version installed the Installation info button & section is very long. We probably want to elide this

image

  1. refactor code, one example is cleaning up the code that toggles which widgets are visible or not:
    Update plugin dialog design & functionality to add conda install napari#5198 (comment)

  2. Set height of each item.

        if item.widget.install_info_button.isExpanded():
            item.widget.setFixedHeight(int(height * SCALE))
        else:
            item.widget.setFixedHeight(int(height / SCALE))
        item.setSizeHint(item.widget.size())

Current State with this PR

Screenshot 2024-07-10 at 2 24 58 AM Screenshot 2024-07-10 at 2 21 44 AM

@goanpeca goanpeca self-assigned this Apr 5, 2024
@goanpeca goanpeca force-pushed the enh/layout-fixes branch from 64d5c34 to e4314fc Compare May 28, 2024 14:49
@jaimergp
Copy link
Contributor

jaimergp commented Jul 4, 2024

@goanpeca What's the status here? Is this PR still active or should it be closed?

@goanpeca goanpeca force-pushed the enh/layout-fixes branch 2 times, most recently from 99b8002 to afc28b5 Compare July 10, 2024 07:03
@goanpeca goanpeca marked this pull request as ready for review July 10, 2024 07:03
@goanpeca goanpeca force-pushed the enh/layout-fixes branch 2 times, most recently from f6ec87a to 59a2abc Compare July 10, 2024 07:11
@goanpeca
Copy link
Contributor Author

@goanpeca What's the status here? Is this PR still active or should it be closed?

Updated the PR, should be ready for review :)

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 94.69027% with 6 lines in your changes missing coverage. Please review.

Project coverage is 92.09%. Comparing base (7f90aa8) to head (35dd765).

Files Patch % Lines
napari_plugin_manager/qt_plugin_dialog.py 94.69% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   91.79%   92.09%   +0.30%     
==========================================
  Files          10       10              
  Lines        1669     1695      +26     
==========================================
+ Hits         1532     1561      +29     
+ Misses        137      134       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jaimergp jaimergp left a comment

Choose a reason for hiding this comment

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

I see a lot of moved blocks with no actual changes, can you add a couple of inline Github comments signaling which actual changes provide the fixes for the original issue. Thanks!

)
# Action Button
self.action_button = QPushButton(self)
self.action_button.setFixedWidth(70)
Copy link
Contributor Author

@goanpeca goanpeca Jul 12, 2024

Choose a reason for hiding this comment

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

Fixes 1

self.error_indicator.hide()

# --- Layout
# ------------------------------------------------
Copy link
Contributor Author

@goanpeca goanpeca Jul 12, 2024

Choose a reason for hiding this comment

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

This new layout organization fixes:

  1. Align plugin name and summary in the installed plugins section.

  2. Align installation info, Make a standard size? ( I know this button adjusts by the sizes on the drop down menus held within. Eliding may help here (see item below).

  3. Ensure author names are aligned. (maybe misaligned only with many authors and in the presence of an update button?)

self.info_widget = QWidget(self)
self.info_widget.setLayoutDirection(Qt.LeftToRight)
self.info_widget.setObjectName("info_widget")
self.info_widget.setFixedWidth(180)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes

  1. Align installation info, Make a standard size? ( I know this button adjusts by the sizes on the drop down menus held within. Eliding may help here (see item below).

self.install_info_button.setLayoutDirection(Qt.RightToLeft)

# Remove any extra margins
self.install_info_button.setFixedWidth(180)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes

  1. Align installation info, Make a standard size? ( I know this button adjusts by the sizes on the drop down menus held within. Eliding may help here (see item below).

if item.widget.install_info_button.isExpanded():
item.widget.setFixedHeight(int(height * SCALE))
item.widget.setFixedHeight(self._initial_height + 35)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes

  1. Set height of each item.

@goanpeca
Copy link
Contributor Author

@jaimergp added the comments :)

@goanpeca goanpeca requested a review from jaimergp July 12, 2024 16:16
@jaimergp
Copy link
Contributor

Thanks @goanpeca. @dalthviz, can you confirm the proposed changes address the items presented in #14? Thanks!

@dalthviz
Copy link
Member

Gave this a check on Windows and seems like the listed items from #14 that are being mentioned here get a fix here indeed 👍 However, not totally sure if the behavior of the layout after some interactions with the Installation Info widget and the way the version label is getting elided are expected. Just in case, a preview of how those things were behaving for me:

plugin_dialog_layout

@jaimergp
Copy link
Contributor

Yea, looks like the extra button in the top panel (Update X.Y.Z) makes things behave a bit differently 🤔

@goanpeca
Copy link
Contributor Author

Eliding indeed is no working as expected, definitely a bug on my side :)

Thanks for the review @dalthviz indeed weird behavior 😆 on resize, taking a look at it now.

@psobolewskiPhD
Copy link
Member

Only thing I noticed was a flicker when you filter while it's still fetching:
image
Screenshot doesn't show it well, but type zarr into filter, the description of the plugin flickers.

@goanpeca
Copy link
Contributor Author

goanpeca commented Jul 17, 2024

@dalthviz added some dummy version to test the elide I think it is working, it just needs to be longer to be elided. Also added a fix for the resizing behavior bug you found. Could you check again :) ?

napari

@psobolewskiPhD I cannot seem to reproduce the flickering :(

@psobolewskiPhD psobolewskiPhD linked an issue Jul 17, 2024 that may be closed by this pull request
@dalthviz
Copy link
Member

Gave this another check and seems like the resize behavior I mentioned above is not reproducible anymore 👍 I still see the version string being cut in two lines from my side but seems like that is expected due to the version string length, if I'm understanding correctly, right?:

plugin_resize_elide_behavior

Also, related with the flickering behavior, I tried filtering things multiple times while the available plugins list seemed like still being populated. For comparison, couple of GIF showing the behaviors (changes here vs latest release - 0.1.0a2 vs latest main - 5027417):

Version Preview
This PR plugins_filter
0.1.0a2 plugins_filter_010a2
main (5027417) plugins_filter_main

I see with the changes here and with latest main a little freeze when filtering things, maybe is worthy to create an issue to track that? Related more specifically with the flickering, I think I'm able to see that behavior in all the versions that I checked. Maybe that is related with changes caused due to other plugins being loaded which change the width used for other fields like author and then cause the plugin description space to be shorter? Maybe creating an issue for that could be worthy too? 🤔

@goanpeca
Copy link
Contributor Author

Hi @dalthviz thanks for the check again. Now I understand that the version is split in 2 lines... which is odd but, I know how to fix it :)

Will push a fix. Thanks again for the thorough reviews¡

@goanpeca
Copy link
Contributor Author

goanpeca commented Jul 17, 2024

So, the issue is that the eliding logic which is based for text, will split on given characters like a dot or a comma, or a dash etc. That is why you see the version split in 2 lines. So one "solution" would be to replace a normal dot by a different type of symbol. I tried a few and found one that could work :)

Thoughts @jaimergp, @dalthviz, @psobolewskiPhD ?

One dot leader ․

See https://www.amp-what.com/unicode/search/dot

Screenshot 2024-07-17 at 5 57 10 PM

Also created a new issue to track the flickering

@jaimergp
Copy link
Contributor

So one "solution" would be to replace a normal dot by a different type of symbol. I tried a few and found one that could work :)

lmao hahah love it

@goanpeca
Copy link
Contributor Author

This one is ready. Will continue opening smaller more concise issues to handle any remaining from #14

@goanpeca goanpeca merged commit 6a17eca into napari:main Jul 19, 2024
12 checks passed
@goanpeca goanpeca deleted the enh/layout-fixes branch July 19, 2024 15:52
@goanpeca goanpeca added the enhancement New feature or request label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some clipped descriptions
5 participants