fix: sort overview table numerically for PRs, issues, and merged columns#65
Merged
MaximilianSoerenPollak merged 1 commit intoJun 5, 2026
Conversation
Decorated cells (fire badge, em-dash for zero, red badge for >5 PRs)
had no data-sort-value, so the JS sort fell back to textContent and
localeCompare. parseFloat("🔥 12") and parseFloat("—") both return NaN,
causing repos with fire badges or zero counts to sort incorrectly.
Add data-sort-value with the raw integer on the three affected <td>
elements so the JS numeric sort path is always taken.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes incorrect numeric sorting in the repository overview table by ensuring the “Merged PRs (30d)”, “Open Issues”, and “Open PRs” cells always sort by their underlying integer values rather than their rendered text (e.g., 🔥 12 or —).
Changes:
- Add
data-sort-valueattributes for merged PRs, open issues, and total open PRs cells in the overview row HTML.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+199
to
+201
| f' <td class="text-right" data-sort-value="{entry.volatile.merged_prs_30_days}" data-tooltip="{e(merged_tip)}">{merged}</td>\n' | ||
| f' <td class="text-right" data-sort-value="{entry.volatile.open_issues}" data-tooltip="{e(issues_tip)}">{issues_cell}</td>\n' | ||
| f' <td class="text-right" data-sort-value="{total_prs}" data-tooltip="{e(prs_tip)}">{prs_cell}</td>\n' |
MaximilianSoerenPollak
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Clicking the Open PRs, Open Issues, or Merged PRs (30d) column headers in the overview table sorted incorrectly: repos with fire-badge counts (
🔥 12) and zero-value em-dashes (—) appeared at the wrong end of the list.The JS sort calls
parseFloat(textContent)to detect numeric columns.parseFloat("🔥 12")andparseFloat("—")both returnNaN, so the sort fell back tolocaleCompare. The em-dash (U+2014) sorts lexicographically after ASCII digits, putting zero-PR repos below all non-zero ones instead of at the top.What
Add
data-sort-valueattributes with the raw integer values on the three affected<td>elements. The sort script already prefersdata-sort-valueovertextContentwhen present — this just makes the numeric path unconditional for these cells.Changes
src/generate_repo_overview/_html_index.py: adddata-sort-valueto the Merged PRs (30d), Open Issues, and Open PRs cells in_overview_row