Skip to content

Conversation

@LukasHirt
Copy link
Collaborator

Description

We added a caption to the OcTable component. It's content can be set via a newly introduced caption prop. The visibility of the caption can also be toggled via new captionVisible prop. By default, it is visible only to screen readers. If the OcTable includes any sortable columns, the caption will automatically include screen reader only explanation of sorting capabilities. This makes sure that screen readers are not overriding column headers with actions via aria-label and that it does not repeat the same action multiple times. All of this behavior is directly inspired by the ARIA Authoring Practices Guide (APG).

Motivation and Context

Adjustments after accessibility audit.

How Has This Been Tested?

  • test environment: macos, chrome
  • test case 1: sort resources table in personal space
  • test case 2: sort resources table in trash
  • test case 3: sort spaces table in spaces

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

We added a caption to the `OcTable` component. It's content can be set
via a newly introduced `caption` prop. The visibility of the caption can
also be toggled via new `captionVisible` prop. By default, it is visible
only to screen readers. If the `OcTable` includes any sortable
columns, the caption will automatically include screen reader only
explanation of sorting capabilities. This makes sure that screen readers
are not overriding column headers with actions via `aria-label` and that
it does not repeat the same action multiple times. All of this behavior
is directly inspired by the ARIA Authoring Practices Guide (APG):
https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/
@LukasHirt LukasHirt requested review from Copilot and mzner October 20, 2025 09:34
@LukasHirt LukasHirt self-assigned this Oct 20, 2025
Copy link

Copilot AI left a comment

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 adds accessibility improvements to the OcTable component by introducing a table caption feature. The caption provides screen reader users with information about the table and its sorting capabilities, following ARIA Authoring Practices Guide (APG) recommendations.

Key Changes:

  • Added caption and captionVisible props to OcTable component
  • Automatically generates screen reader text explaining sortable columns
  • Removed redundant aria-label attributes from sort buttons in favor of caption-based explanation
  • Modified aria-sort attribute handling to only set values when actively sorting

Reviewed Changes

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

Show a summary per file
File Description
packages/design-system/src/components/OcTable/OcTable.vue Implements caption functionality, removes aria-label from sort buttons, refactors aria-sort attribute handling
packages/design-system/src/components/OcTable/OcTable.sort.spec.ts Updates tests to reflect new aria-sort behavior (only set when actively sorting)
changelog/unreleased/enhancement-add-table-caption.md Documents the new feature
packages/web-app-files/tests/unit/views/trash/snapshots/Overview.spec.ts.snap Updates snapshot with new caption element and removed aria-label
packages/web-app-admin-settings/tests/unit/views/snapshots/Users.spec.ts.snap Updates snapshot with new caption element and removed aria-label/aria-sort
packages/web-app-admin-settings/tests/unit/components/Spaces/snapshots/SpacesList.spec.ts.snap Updates snapshot with new caption element and removed aria-label/aria-sort

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqubecloud
Copy link

@LukasHirt LukasHirt merged commit 1a94713 into master Oct 20, 2025
4 checks passed
@LukasHirt LukasHirt deleted the feat/table-sorting-a11y branch October 20, 2025 18:14
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.

3 participants