-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
HTML column sorting is inconsistent across index pages #1766
Comments
Seems like the simple way to do it would be adding I can work on a PR tonight if it's still open. |
Thanks! Extra-credit homework: if you sort the function page by function name, the file index page doesn't have that column, so what should the sort order be? |
We could store the last column the index page was sorted by and sort on it again. But then we'd have one more question when the user goes back to the function page. We have two scenarios:
I think it would be easier to keep storing the last column to sort with, while adding a flag that means "sort the function or class pages by function/class" when set. Let me give it a try. |
…#1766) (#1768) * Add ids to column headers that you can sort by. * Use table header ids to remember sort columns, special casing the function/class column. * Rename 'function_or_class' and related names to 'region' and related. * Use 'file' as placeholder for the th id, so we sort on file in the absence of a recorded column id. * Fix bug of incorrectly recording direction changes. * Use 'let' instead of 'var' in the new code. * Update gold HTML tests. * Support scrubbing temporary paths in test_html.py on Windows. * Fix long line in test_html. * Add gold files for test_html partial (needs running tests on Python < 3.10). * Use scrub for Windows path when running test suite in all OSes. * Move scrubbing of Windows paths into test_other.
This is now released as part of coverage 7.5.1. |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://togithub.com/nedbat/coveragepy) | `==7.5.0` -> `==7.5.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy (coverage)</summary> ### [`v7.5.1`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-751--2024-05-04) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.5.0...7.5.1) - Fix: a pragma comment on the continuation lines of a multi-line statement now excludes the statement and its body, the same as if the pragma is on the first line. This closes `issue 754`*. The fix was contributed by `Daniel Diniz <pull 1773_>`*. - Fix: very complex source files like `this one <resolvent_lookup_>`\_ could cause a maximum recursion error when creating an HTML report. This is now fixed, closing `issue 1774`\_. - HTML report improvements: - Support files (JavaScript and CSS) referenced by the HTML report now have hashes added to their names to ensure updated files are used instead of stale cached copies. - Missing branch coverage explanations that said "the condition was never false" now read "the condition was always true" because it's easier to understand. - Column sort order is remembered better as you move between the index pages, fixing `issue 1766`*. Thanks, `Daniel Diniz <pull 1768_>`*. .. \_resolvent_lookup: https://github.com/sympy/sympy/blob/130950f3e6b3f97fcc17f4599ac08f70fdd2e9d4/sympy/polys/numberfields/resolvent_lookup.py .. \_issue 754[https://github.com/nedbat/coveragepy/issues/754](https://togithub.com/nedbat/coveragepy/issues/754)54 .. \_issue 176[https://github.com/nedbat/coveragepy/issues/1766](https://togithub.com/nedbat/coveragepy/issues/1766)766 .. \_pull 17[https://github.com/nedbat/coveragepy/pull/1768](https://togithub.com/nedbat/coveragepy/pull/1768)1768 .. \_pull 1[https://github.com/nedbat/coveragepy/pull/1773](https://togithub.com/nedbat/coveragepy/pull/1773)/1773 .. \_issue [https://github.com/nedbat/coveragepy/issues/1774](https://togithub.com/nedbat/coveragepy/issues/1774)s/1774 .. \_changes\_7-5-0: </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Describe the bug
This is because the number of the column is stored, but the function and class index pages have one more column, so the numbering is off.
This is with coverage.py 7.5.0.
Expected behavior
If you've sorted by a column, the same-named column should be sorted when switching to another page.
The text was updated successfully, but these errors were encountered: