Skip to content

fix: sort overview table numerically for PRs, issues, and merged columns#65

Merged
MaximilianSoerenPollak merged 1 commit into
eclipse-score:mainfrom
etas-contrib:fix/sort-pr-column
Jun 5, 2026
Merged

fix: sort overview table numerically for PRs, issues, and merged columns#65
MaximilianSoerenPollak merged 1 commit into
eclipse-score:mainfrom
etas-contrib:fix/sort-pr-column

Conversation

@AlexanderLanin
Copy link
Copy Markdown
Member

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") and parseFloat("—") both return NaN, so the sort fell back to localeCompare. 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-value attributes with the raw integer values on the three affected <td> elements. The sort script already prefers data-sort-value over textContent when present — this just makes the numeric path unconditional for these cells.

Changes

  • src/generate_repo_overview/_html_index.py: add data-sort-value to the Merged PRs (30d), Open Issues, and Open PRs cells in _overview_row

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-value attributes 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 MaximilianSoerenPollak merged commit e77684b into eclipse-score:main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants