[6.x] Updates to element index table - #19520
Conversation
…dex, add translation and tests
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.
| const table = createSampleTable(); | ||
| const loading = ref(false); |
There was a problem hiding this comment.
Rather than enabling and handling manual sorting in our Storybook, I think it makes sense to just update the loading prop manually to replicate the server-side sorting in the control panel. But at some point, we should handle this in our E2E tests.
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
# Conflicts: # resources/js/modules/elements/components/DataTable.test.ts
|
This PR had conflicts with Claude's response
|
Description
Related issues