Skip to content

Remove jQuery and tablesorter CDN dependencies#4285

Open
PGrayCS wants to merge 1 commit into
wowsims:masterfrom
PGrayCS:remove/jquery-tablesorter
Open

Remove jQuery and tablesorter CDN dependencies#4285
PGrayCS wants to merge 1 commit into
wowsims:masterfrom
PGrayCS:remove/jquery-tablesorter

Conversation

@PGrayCS

@PGrayCS PGrayCS commented Mar 3, 2026

Copy link
Copy Markdown

Summary

Closes #4272.

Replaces the jQuery + jquery.tablesorter CDN dependencies with a lightweight, self-contained vanilla TypeScript TableSorter class, ported from the equivalent change already merged in wowsims/sod (PR #1435).

Changes:

  • ui/core/components/detailed_results/table_sorter.ts — New TableSorter class. Reads sort values from data-text dataset attributes (falling back to innerText), handles numeric and string columns, and keeps child-metric rows attached to their parent row during re-sorts.
  • ui/core/components/detailed_results/metrics_table.tsx — Remove declare var $: any;, import TableSorter, replace $(this.tableElem).tablesorter(...) with a TableSorter constructor call, replace $(this.tableElem).trigger('update') with this.sorter.update(), and set data-text on cells that have a getValue function so numeric sorting works correctly.
  • ui/index_template.html — Remove the jQuery 3.5.1 and jquery.tablesorter 2.31.3 <script> tags.

Test plan

  • Run the sim and open the detailed results panel — verify column headers are still clickable and sort the table
  • Verify parent rows with child-metric rows collapse/expand correctly
  • Verify default sort order is applied on first render

Replace the jQuery tablesorter plugin with a lightweight vanilla TypeScript
TableSorter class. This removes two external CDN script tags (jQuery 3.5.1
and jquery.tablesorter 2.31.3) from the page template and replaces the
jQuery-dependent calls in MetricsTable with a self-contained implementation.

The new TableSorter handles column header click sorting and correctly
maintains parent-child row relationships (child-metric rows stay attached
to their parent during re-sorts). Numeric columns are sorted numerically
using data-text dataset attributes; string columns fall back to locale-
aware string comparison.

Closes wowsims#4272
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.

Remove jQuery Tablesorter Dependency

1 participant