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

Switch SearchResult display to model/view paradigm #290

Merged

Conversation

gselzer
Copy link
Collaborator

@gselzer gselzer commented Aug 16, 2023

This PR converts the search result QTreeWidget to use Qt's model/view paradigm - not only is this a better separation of concerns, but it also makes it easier to do things like adding icons to search results.

@gselzer gselzer added the enhancement New feature or request label Aug 16, 2023
@gselzer gselzer added this to the 0.2.0 milestone Aug 16, 2023
@gselzer gselzer requested a review from ctrueden August 16, 2023 20:17
@gselzer gselzer self-assigned this Aug 16, 2023
@gselzer gselzer linked an issue Aug 16, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Patch coverage: 87.35% and project coverage change: -0.24% ⚠️

Comparison is base (94271a1) 88.51% compared to head (2d95b4f) 88.28%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
- Coverage   88.51%   88.28%   -0.24%     
==========================================
  Files          53       53              
  Lines        4912     4925      +13     
==========================================
  Hits         4348     4348              
- Misses        564      577      +13     
Files Changed Coverage Δ
src/napari_imagej/widgets/widget_utils.py 81.06% <34.78%> (-7.45%) ⬇️
src/napari_imagej/java.py 93.93% <66.66%> (-0.20%) ⬇️
src/napari_imagej/widgets/napari_imagej.py 74.50% <69.56%> (-0.33%) ⬇️
src/napari_imagej/widgets/result_tree.py 91.66% <92.15%> (ø)
tests/widgets/test_result_tree.py 90.90% <97.43%> (-2.17%) ⬇️
src/napari_imagej/types/converters/images.py 95.31% <100.00%> (ø)
src/napari_imagej/utilities/_module_utils.py 83.62% <100.00%> (ø)
tests/utils.py 96.61% <100.00%> (+0.03%) ⬆️
tests/widgets/test_napari_imagej.py 100.00% <100.00%> (+1.29%) ⬆️
tests/widgets/widget_utils.py 96.15% <100.00%> (+0.69%) ⬆️

... and 1 file with indirect coverage changes

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

@gselzer gselzer marked this pull request as ready for review August 17, 2023 14:15
@gselzer gselzer force-pushed the 284-search-results-should-show-icons-to-help-disambiguate branch 3 times, most recently from 2db5d2e to 2d95b4f Compare August 17, 2023 19:56
We aren't implementing this behavior anymore (it's the default with
QTreeView), so we don't need to test it.
...jpype is so smart!
@gselzer gselzer force-pushed the 284-search-results-should-show-icons-to-help-disambiguate branch from 2d95b4f to 5d97895 Compare September 20, 2024 20:55
On MacOS, this prevents the categories from being highlighted
We haven't coded this behavior, so let's not test it!
@gselzer gselzer force-pushed the 284-search-results-should-show-icons-to-help-disambiguate branch from 5d97895 to 173e336 Compare September 20, 2024 21:04
@gselzer
Copy link
Collaborator Author

gselzer commented Sep 20, 2024

This PR now loads all icons stored as resources within jars. It does not yet load icons from the web, mostly due to performance implications. Filed #296 to track that item.

@ctrueden
Copy link
Member

@gselzer Can you give an example of an icon referenced via a remote URL in this way?

@gselzer
Copy link
Collaborator Author

gselzer commented Sep 23, 2024

For example, the user icons from SearchResults pulled from forum.image.sc

@gselzer gselzer force-pushed the 284-search-results-should-show-icons-to-help-disambiguate branch from 1d509d4 to 1ee96af Compare September 30, 2024 14:30
@gselzer gselzer force-pushed the 284-search-results-should-show-icons-to-help-disambiguate branch from 1ee96af to 9b2d5a1 Compare September 30, 2024 14:50
@gselzer gselzer merged commit 7052365 into main Sep 30, 2024
8 checks passed
@gselzer gselzer deleted the 284-search-results-should-show-icons-to-help-disambiguate branch September 30, 2024 16:00
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.

Search results should show icons to help disambiguate
2 participants