-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Show message if version list truncated #6276
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
Conversation
@@ -367,7 +369,7 @@ def project_versions(request, project_slug): | |||
version_filter = request.GET.get('version_filter', '') | |||
if version_filter: | |||
inactive_versions = inactive_versions.filter(verbose_name__icontains=version_filter) | |||
inactive_versions = inactive_versions[:100] | |||
inactive_versions = inactive_versions[:max_inactive_versions] |
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.
Feels like the length check should be done here, before we truncate it. Otherwise won't the template never show additional versions because it's already cut off at max_inactive_versions
total?
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.
The message is shown because there will be 100 inactive versions and the check checks >=
. It is an extra query to do a count but I don't think it'll be too costly.
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 feels a little like we're adding directions explaining our UI rather than fixing the UI issues. I do understand this is a transitional UI, but don't want to continue investing time like this into this particular UI.
More future proof fixes to this problem will be live filtering on the results and moving the inactive version list into a separate UI and view where it won't be confused with the active version list. Some of these changes are outlined in #6238
I'm probably -0 on the underlying issue, but we've already spent time on this so I think the best we can do is to give the user more context.
{% if inactive_versions|length >= max_inactive_versions %} | ||
<p> | ||
{% blocktrans trimmed %} | ||
Only the first {{ max_inactive_versions }} inactive versions were shown. Please <a href="#version-filter">filter the list</a>. |
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.
We can give the user more context and avoid having to directly tell them how to use our UI. A couple of options:
- "Showing first {{ max_inactive_versions }} of {{ number of matches }}"
- "X matching inactive versions not shown"
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 will involve an extra query as I outlined #6276 (comment) but I suppose the cost isn't too high. I can add it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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.
Having this is better than not having it, so I'm 👍 on shipping it.
I think a count would be more helpful here still. I'm not worried about the cost of the extra query. I'm fine waiting until this change is in. |
I just forgot about this one. I'm adding the extra query. |
- Only show if the number exceeds the displayed number
Show a message if we are showing the max inactive versions on the version list screen.
Technically, if the project has exactly 100 versions the message is shown even if nothing was truncated but I think that is acceptable in this instance.
Fixes #6265