[6.x] Updates to element index table - #19520
Draft
gcamacho079 wants to merge 6 commits into
Draft
Conversation
…dex, add translation and tests
Contributor
There was a problem hiding this comment.
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); |
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
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.
Description
Related issues