-
Notifications
You must be signed in to change notification settings - Fork 996
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
Make it easier to see the available wheels per package release #15087
base: main
Are you sure you want to change the base?
Make it easier to see the available wheels per package release #15087
Conversation
cc @di is this along the lines you were thinking of for filtering? |
Can be filtered using input or select elements.
I've added the controller, which is relatively generic for filtering any list using input / select elements. I've also styled the input & select elements. See the screenshot and video attached. I'd appreciate feedback on:
2023-12-21.23-09-26.mp4 |
<p> | ||
Showing | ||
<span data-filter-list-target="shown"></span> | ||
of | ||
<span data-filter-list-target="total"></span> | ||
files. | ||
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be fairly tricky to translate because it a) includes embedded HTML and b) needs to handle pluralizations c) the pluralized value is being determined on the frontend after the HTML has already been rendered, so Jinja's {% pluralize %}
tag won't work here.
I think we might want to define these strings into the JS source instead, which will allow us to use ngettext
on them there, but we don't currently do that in this codebase I believe, so it will probably require figuring out how to start doing that.
This looks great, although translations are going to be tricky here, I think we can figure it out. One other thing to note: we should make sure this degrades gracefully when JS is unavailable/disabled (essentially, it should fall back to the current existing behavior). |
Fixed tests. Added some missing translation blocks. Slightly improved js.
I've added tests for the The remaining work is the new approach to translations in js. I'm willing to explore it, if I can get some pointers as to how you want it to work? |
Sorry for the delay, I went on leave and forgot to respond. I also am not sure where to start either, but here's some pointers:
How I imagine it would work:
|
# Conflicts: # warehouse/locale/messages.pot # warehouse/packaging/views.py
Labelling as |
Just wanted to comment here, though it may be out of scope: It'd be nice if the applied filters could be reflected in the URL query params, e.g. That'd make it really neat for sharing the filtered list as a link. |
…-wheels # Conflicts: # warehouse/packaging/models.py
Hi @di @miketheman, do you think this change is still useful given the change in #15606? My take is that it would still be useful to be able to quickly filter the list of wheels. Once the JS translations PR #15612 is resolved, I'm happy to get this PR updated to use the js translations. |
# Conflicts: # tests/unit/packaging/test_views.py # warehouse/packaging/models.py # warehouse/packaging/views.py # warehouse/static/sass/layout-helpers/_columns.scss
Serialize in html attribute to JSON instead of custom format. Add ability to copy filter url and filter from querystring. Update tests.
I've updated this PR to use the recently-merged JS translations. I also added the ability to copy the url to the page with the filters in the querystring, and load the filters from the querystring. I decided not to use the 'pretty tags' from #15606, as it made it hard to work out which part of the wheel filename was being matched. |
# Conflicts: # warehouse/locale/messages.pot
@di This PR is no longer blocked. |
As described in the issue: "For non pure python, it's often challenging to be able to determine if a wheel is available for a given Python implementation, abi, and platform. Currently, a user has to wade through a long list of wheel file names and decipher their meaning."
This change aims to add these interface elements:
I would appreciate feedback on whether this is a reasonable approach or not?
I'm willing to adapt to whatever make sense.
So far I've parsed the filenames and populated the select elements.
My next step will be to create a Stimulus controller that uses the input element and the 3 select elements to filter the list of wheel files.
Closes #14549