Skip to content

Make table sorting keyboard accessible - #1014

Open
taobojlen wants to merge 2 commits into
mainfrom
fix/table-sort-header-accessibility
Open

Make table sorting keyboard accessible#1014
taobojlen wants to merge 2 commits into
mainfrom
fix/table-sort-header-accessibility

Conversation

@taobojlen

@taobojlen taobojlen commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Context & Requests for Reviewers

This addresses a CodeRabbit comment from the @tanstack/react-table v9 upgrade. It was a pre-existing issue: our table sorting was not keyboard-accessible.

Tests

Manually tested. Example here:

CleanShot.2026-08-18.at.12.23.51.mp4

(Optional) Rollout Plan

N/A

Checklist

Only check items that apply to this PR; leave the rest unchecked.

  • If you changed anything user-facing (i.e. user interface or APIs):
    Did you update the CHANGELOG.md and related docs?

  • If you changed server/models/**/{ContentTypeModel,ActionModel,RuleModel,PolicyModel}.ts:
    Did you update the corresponding history tables and their triggers?

  • If you changed db/src/scripts/** and used CREATE TABLE, ADD COLUMN, or ALTER COLUMN:
    Are as many columns marked NOT NULL as possible? If some columns can sometimes be null depending on other columns, are there CHECK constraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?

  • If you added a new signal in server/services/signalsService/signals/**:
    Did you classify every error case as a permanent error (SignalPermanentError, no retry) or a normal error (retryable)? Any case where the signal can't determine a score should be a SignalPermanentError.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: ceb627b6-8cff-44a8-9212-e1502a6c3aac

📥 Commits

Reviewing files that changed from the base of the PR and between ebcd0ec and 94b940a.

📒 Files selected for processing (2)
  • client/src/webpages/dashboard/components/table/Table.test.tsx
  • client/src/webpages/dashboard/components/table/Table.tsx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from eea8743 to d74baa7 Compare August 12, 2026 03:42
@taobojlen taobojlen changed the title fix/table sort header accessibility Make table sorting keyboard accessible Aug 12, 2026
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from d74baa7 to ad0d785 Compare August 17, 2026 10:22
@taobojlen
taobojlen changed the base branch from fix/item-type-form-input-names to fix/merged-reports-sorting August 17, 2026 10:23
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from ad0d785 to ccee8b8 Compare August 17, 2026 15:43
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from ccee8b8 to 8320b88 Compare August 18, 2026 09:00
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from 8320b88 to 582a2ff Compare August 18, 2026 09:25
@taobojlen taobojlen mentioned this pull request Aug 18, 2026
4 tasks
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from 582a2ff to 474cd47 Compare August 18, 2026 10:00
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch 2 times, most recently from 45bbeb9 to f51fb31 Compare August 18, 2026 10:19
@taobojlen
taobojlen marked this pull request as ready for review August 18, 2026 11:25
@cassidyjames
cassidyjames requested a review from a team as a code owner August 21, 2026 15:26
@cassidyjames
cassidyjames force-pushed the fix/table-sort-header-accessibility branch from f51fb31 to 78e9232 Compare August 21, 2026 15:26
@cassidyjames
cassidyjames force-pushed the fix/table-sort-header-accessibility branch from 78e9232 to 434446c Compare August 21, 2026 15:33
@cassidyjames
cassidyjames force-pushed the fix/table-sort-header-accessibility branch from 434446c to e6b5a32 Compare August 21, 2026 17:04
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from e6b5a32 to 3307aa4 Compare August 24, 2026 09:42
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from 3307aa4 to ee604cc Compare August 24, 2026 12:23
@cassidyjames
cassidyjames force-pushed the fix/table-sort-header-accessibility branch from ee604cc to 312636a Compare August 26, 2026 21:53
@juanmrad
juanmrad requested a lite review from Copilot August 31, 2026 04:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is focused, improves accessibility as intended, and includes test coverage for the new keyboard behavior.

Pull request overview

Improves the dashboard table header sorting UI so sortable columns are reachable via keyboard focus and expose sort state via aria-sort, addressing accessibility gaps introduced/observed around the TanStack React Table v9 upgrade.

Changes:

  • Wraps sortable header content in a focusable <button> while keeping placeholder and non-sortable headers inert.
  • Adds aria-sort to sortable header cells with correct ascending/descending/none values.
  • Extends table tests to cover keyboard-triggered sorting and placeholder header behavior in grouped headers.
File summaries
File Description
client/src/webpages/dashboard/components/table/Table.tsx Adds keyboard-focusable sortable header buttons and aria-sort handling while keeping placeholders/non-sortables inert.
client/src/webpages/dashboard/components/table/Table.test.tsx Adds regression tests for keyboard sorting and grouped-header placeholder inertness.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +154 to +162
{isSortableHeader ? (
<button
type="button"
className="flex flex-row items-center p-4 flex-nowrap whitespace-nowrap gap-3"
>
{headerContent}
{sortIcon}
</button>
) : (
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from 312636a to bd5443a Compare September 1, 2026 08:23
Base automatically changed from fix/merged-reports-sorting to main September 1, 2026 08:38
@taobojlen
taobojlen force-pushed the fix/table-sort-header-accessibility branch from bd5443a to 94b940a Compare September 1, 2026 08:38
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.

2 participants