Skip to content

Show sort icons only on sortable table headers#29

Merged
sabaronett merged 2 commits intomainfrom
copilot/show-sort-icons-on-sortable-headers
Apr 9, 2026
Merged

Show sort icons only on sortable table headers#29
sabaronett merged 2 commits intomainfrom
copilot/show-sort-icons-on-sortable-headers

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Sort icons were being injected into all <table> headers site-wide, including static tables (e.g., SOC) that have no sorting behavior.

Change

Scope the sort icon/click-handler loop to only table.js-sort-table elements — consistent with how Tablesort is already initialized:

// Before
document.querySelectorAll("table").forEach((table) => {

// After
document.querySelectorAll("table.js-sort-table").forEach((table) => {

This ensures sort icons appear exclusively on tables opted into sorting via the js-sort-table class.

Copilot AI changed the title [WIP] Show dynamic sort icons only on sortable column headers Show sort icons only on sortable table headers Apr 9, 2026
Copilot AI requested a review from sabaronett April 9, 2026 04:56
Copy link
Copy Markdown
Member

@sabaronett sabaronett left a comment

Choose a reason for hiding this comment

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

Looks good on local web server

@sabaronett sabaronett marked this pull request as ready for review April 9, 2026 05:01
Copilot AI review requested due to automatic review settings April 9, 2026 05:01
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

This PR scopes sort icon injection and click-handler wiring to only tables explicitly opted into sorting via the js-sort-table class, aligning behavior with existing Tablesort initialization and preventing icons from appearing on static tables.

Changes:

  • Change the sort icon / header click-handler loop selector from table to table.js-sort-table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sabaronett sabaronett self-requested a review April 9, 2026 05:04
Copy link
Copy Markdown
Member

@sabaronett sabaronett left a comment

Choose a reason for hiding this comment

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

Re-approving

@sabaronett sabaronett merged commit 47cdcf3 into main Apr 9, 2026
5 checks 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.

Show dynamic sort icons only on sortable column headers

3 participants