Skip to content

[6.x] Updates to element index table - #19520

Draft
gcamacho079 wants to merge 6 commits into
6.xfrom
a11y/element-index
Draft

[6.x] Updates to element index table#19520
gcamacho079 wants to merge 6 commits into
6.xfrom
a11y/element-index

Conversation

@gcamacho079

Copy link
Copy Markdown
Contributor

Description

  • Manages keyboard focus when reordering table rows by focusing the loading spinner and adds relevant tests
  • Adds label CSS tokens in field styles
  • Adds an accessible label to the “Items per page” select

Related issues

@gcamacho079 gcamacho079 added the accessibility 👤 features related to accessibility label Aug 31, 2026
@gcamacho079
gcamacho079 requested a lite review from Copilot August 31, 2026 18:34

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.

Pull request overview

This PR improves the element index table’s accessibility and UX during data reloads by managing focus during sort-triggered reloads, adds tests for that behavior, introduces themeable field label typography tokens, and provides an accessible label for the “Items per page” page-size control.

Changes:

  • Add focus handoff to the loading spinner during sort reloads, then restore focus to the originating column’s sort button.
  • Add a unit test suite covering the spinner-focus and labeling behavior during reloads.
  • Introduce CSS custom properties for field label font size/weight and add an SR-only label for the page-size select.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
resources/translations/en/app.php Adds the new Sorting translation string used for the spinner’s accessible name during sort reloads.
resources/js/modules/elements/components/DataTable.vue Implements spinner labeling + focus management during sort-triggered loading state; updates header hover selector.
resources/js/modules/elements/components/DataTable.test.ts Adds tests validating focus moves to the spinner during sort reloads and restores afterward.
resources/js/modules/elements/components/BaseElementIndex.vue Adds an accessible label to the “Items per page” select while keeping a visible label.
packages/craftcms-ui/src/styles/form.styles.ts Adds overridable CSS tokens for field label font size and weight.

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

Comment on lines +134 to +141
function onSortColumn(
column: Column<any>,
headerId: string,
event: MouseEvent
) {
pendingSortFocusHeaderId.value = headerId;
column.getToggleSortingHandler()?.(event);
}
Comment on lines +21 to +22
const table = createSampleTable();
const loading = ref(false);
@github-actions

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/uiopen Storybook

No changed components detected in this Storybook.

resources/jsopen Storybook

No changed components detected in this Storybook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility 👤 features related to accessibility

2 participants