Skip to content

Tighten rule matching scope and adjust header button layout#1823

Merged
stephenegriffin merged 3 commits into
mainfrom
u/sgriffin/spam
Jun 1, 2026
Merged

Tighten rule matching scope and adjust header button layout#1823
stephenegriffin merged 3 commits into
mainfrom
u/sgriffin/spam

Conversation

@stephenegriffin
Copy link
Copy Markdown
Member

@stephenegriffin stephenegriffin commented Jun 1, 2026

This pull request focuses on improving the accuracy of header matching in validation utilities, enhancing styling of sortable table headers, and updating tests to support these changes.

Header matching and validation improvements:

  • Refined header matching logic in getViolationsForRow to require both header and headerName to match for rows with explicit metadata, preventing cross-matching violations between different header families.
  • Updated findSectionSubSection to only match by headerName for rows where header is "source", ensuring that rules targeting raw header content do not incorrectly apply to parsed child rows.
  • Added new tests to verify that violations and section lookups do not cross-match between different header families, and that only appropriate rows are matched. [1] [2]

Sortable table header accessibility and usability:

  • Refactored table header rendering to use th elements with unique IDs and sortableHeaderCell classes, replacing button-based headers. Added keyboard support (Enter/Space) for sorting, ARIA attributes for accessibility, and improved visual focus indicators. [1] [2] [3]
  • Updated tests to verify keyboard sorting behavior and correct ARIA attribute handling on header cells.

Styling and selector adjustments:

  • Updated CSS selectors and styles to target the new sortableHeaderCell class, ensuring consistent appearance and accessibility cues for sortable headers. [1] [2]
  • Changed header cell IDs and selectors (e.g., #hop_header, #number_header) in both code and tests to match the new structure. [1] [2] [3]

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 improves rule/violation targeting accuracy in the header validation utilities (avoiding cross-matches between different header “families”) and refactors the classic desktop sortable table header UI from button-based headers to interactive th cells with updated styling and keyboard support.

Changes:

  • Tightened violation/section matching to reduce unintended cross-matches (especially around "source" rows and headerName).
  • Refactored sortable table headers to use focusable th cells with click + Enter/Space sorting behavior and updated ARIA attributes.
  • Updated classic desktop CSS and unit tests to align with the new sortable header structure and matching behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Scripts/ui/Table.ts Reworks sortable header rendering and event handling; updates ARIA sort state targeting.
src/Scripts/ui/Table.test.ts Updates header selectors and adds keyboard-sorting coverage for the new th-based headers.
src/Scripts/rules/ViolationUtils.ts Tightens section matching so violations don’t apply across unrelated header families.
src/Scripts/rules/ViolationUtils.test.ts Adds regression coverage for non-cross-matching violations between header families.
src/Scripts/rules/engine/HeaderValidationRules.ts Narrows findSectionSubSection matching to prevent headerName fan-out except for "source".
src/Scripts/rules/engine/HeaderValidationRules.test.ts Adds tests for the refined headerName matching behavior.
src/Content/classicDesktopFrame.css Updates selectors/styles for the new .sortableHeaderCell header layout and new header IDs.

Comment thread src/Scripts/ui/Table.ts
Comment thread src/Scripts/ui/Table.test.ts
Comment thread src/Scripts/ui/Table.ts
Comment thread src/Scripts/ui/Table.test.ts
@stephenegriffin stephenegriffin merged commit a3cc9c1 into main Jun 1, 2026
7 checks passed
@stephenegriffin stephenegriffin deleted the u/sgriffin/spam branch June 1, 2026 12:54
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