a11y(webhooks): add table caption and header scopes#504
Open
Dedenwrg wants to merge 1 commit into
Open
Conversation
- Add caption, tableHeaders, renderCells props to ResourceList for semantic table rendering with <caption>, scope="col" headers, and scope="row" on the first cell of each row. - Convert webhooks list to a table with columns: URL, Events, Registered, Actions. - Caption is visually hidden (sr-only) but available to assistive tech. - Backward-compatible: ResourceList falls back to <ul> when caption or renderCells is not provided. - Add 5 a11y tests to webhooks page (caption, scope attributes, empty state, sr-only). - Add 12 table-mode tests to ResourceList (table render, caption, scopes, fallback, loading/empty states, remove dialog integration). - All 632 tests pass. Lint and build clean.
Contributor
|
thanks @Dedenwrg! could you add a |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #480
Summary
Adds semantic table markup to the webhooks list so screen readers can navigate it as a proper data table.
Changes
ResourceList.tsx — new table mode (backward-compatible)
caption,tableHeaders,renderCells<table>with:<caption class="sr-only">— visually hidden, available to AT<thead>with<th scope="col">for each column<tbody>with<th scope="row">on the first cell of every row<ul>list when props are omitted — no breaking change for api-keys or other consumersWebhooksClient.tsx
caption="Registered webhooks",tableHeaders={["URL", "Events", "Registered", "Actions"]}, andrenderCellsto produce the four-column tablerenderRowretained for backward-compat but unused in table modeTests
New a11y tests in
webhooks/page.test.tsx(5 tests)<caption>present with descriptive textscope="col"scope="row"<table>rendered when list is emptysr-onlyclassNew table-mode tests in
ResourceList.test.tsx(12 tests)<td>for data cells<ul>when caption or renderCells missingTest output
Checklist
npm run lint— no warnings or errorsnpm test— 632/632 passnpm run build— clean