From ccaf9440c504d9fe56544edd37a24f87c302d6c5 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 9 Jun 2026 17:38:18 -0500
Subject: [PATCH 1/4] feat(sortableTable): build filters from page template and
JSON
Tables with data-sortable-filters get a cloned fieldset before init; shared template ships via delayed assets and tup-ui snippet.
---
.../sortable-table-finish-deferred.plan.md | 10 +-
.../site_cms/js/modules/sortableTable.html | 45 +--
.../site_cms/js/modules/sortableTable.js | 368 +++++++++++++++---
.../templates/assets_core_delayed.html | 1 +
.../sortable_table_filter_templates.html | 24 ++
tmp/pr-1169.html | 101 ++---
6 files changed, 375 insertions(+), 174 deletions(-)
create mode 100644 taccsite_cms/templates/includes/sortable_table_filter_templates.html
diff --git a/docs/plans/sortable-table-finish-deferred.plan.md b/docs/plans/sortable-table-finish-deferred.plan.md
index b0817a4cc..87a3a20ce 100644
--- a/docs/plans/sortable-table-finish-deferred.plan.md
+++ b/docs/plans/sortable-table-finish-deferred.plan.md
@@ -1,24 +1,22 @@
---
name: Sortable table finish (deferred)
-overview: "After Phase 0 merge: steps 5–7 — JS-built filters, cleanup, CKEditor allowlist PR to main."
-status: deferred
+overview: "Steps 5–6 done on branch; step 7 — CKEditor allowlist PR to main."
+status: in-progress
---
# Sortable table: Phase 0, then steps 5–7
-**Deferred until Phase 0 PRs are merged.** Pick up from here for dynamic filters + hack retirement.
-
## Phase 0: Ship current code
Merge as-is: Core-CMS sortableTable, Core-Styles promote util, tup-ui snippet pins.
## Step 5: Dynamic filter markup in JS
-Table-only in CMS; JS builds fieldset/controls/output; ARIA set in code.
+**Done (branch):** Table-only in CMS; `data-sortable-filters` JSON on the table; JS builds fieldset/controls/output with ARIA in code. Legacy CMS-authored filter groups still work.
## Step 6: Clean up
-Remove snippet promote; dedupe JS; bump SHAs.
+**Done (branch):** Snippet promote removed; CDN pins use `Core-Styles@v2.57.0` and `Core-CMS@v4.40.0-rc6`.
## Step 7: CKEditor ARIA — separate branch → `main`
diff --git a/taccsite_cms/static/site_cms/js/modules/sortableTable.html b/taccsite_cms/static/site_cms/js/modules/sortableTable.html
index d4008866a..05f45be3f 100644
--- a/taccsite_cms/static/site_cms/js/modules/sortableTable.html
+++ b/taccsite_cms/static/site_cms/js/modules/sortableTable.html
@@ -1,6 +1,8 @@
+
+
-
-
-
-
-
+
+
…
diff --git a/taccsite_cms/static/site_cms/js/modules/sortableTable.js b/taccsite_cms/static/site_cms/js/modules/sortableTable.js
index 28f551605..712777e07 100644
--- a/taccsite_cms/static/site_cms/js/modules/sortableTable.js
+++ b/taccsite_cms/static/site_cms/js/modules/sortableTable.js
@@ -13,39 +13,299 @@ const SORT_TABLE_CLASS = 'js-sortable';
const FILTER_CLASS = 'js-sortable-filter';
const FILTER_LIST_CLASS = 'js-sortable-filter-list';
const OUTPUT_CLASS = 'js-sortable-total';
-const LIST_CLASS = 'list';
-const SORT_BUTTON_CLASS = 'sort';
+const THEIR_LIST_CLASS = 'list';
+const THEIR_BUTTON_CLASS = 'sort';
const DEFAULT_TABLE_SELECTOR = 'table.' + SORT_TABLE_CLASS;
const NOT_SORTABLE_SELECTOR = 'th.not-sortable';
+const FILTERS_DATA_ATTR = 'data-sortable-filters';
+
+/**
+ * Filter chrome: clone nodes from includes/sortable_table_filter_templates.html.
+ * Captions,