Skip to content

Conversation

andrew-tram
Copy link
Contributor

The "Appearance color options" table in the CSS Files → Editor → Appearance preferences page was rendering with two columns instead of one, lacked a proper header for screen readers, and in some cases was not announced correctly by assistive technology.

Changes Made

  • Table recreation logic
    • Dispose of any existing table and columns before creating a new instance.
    • Create a fresh Table with SWT.FULL_SELECTION and TableColumnLayout on the parent composite.
    • Use a single TableViewerColumn that displays both the color swatch (image) and label (text) in the same column.
  • Header improvements
    • Add a visible column header using StructuredTextEditorPreferencePage_23, stripping the mnemonic (&) and trailing colon.
    • Increase the column’s minimum width to prevent text truncation.
  • Accessibility enhancements
    • Add accessible name and help for the table so screen readers announce “Appearance color options.”
    • Provide row-level announcements in the format Appearance color options: <label>.
    • Set appropriate accessibility roles (ACC.ROLE_TABLE and ACC.ROLE_TABLECELL).

Result

This update ensures:

  • Screen readers can correctly identify and read out the table and its contents.
  • Improved accessibility compliance and usability for all users.

Before:
image

After:
image

…references

The **"Appearance color options"** table in the *CSS Files → Editor → Appearance* preferences page was rendering with two columns instead of one, lacked a proper header for screen readers, and in some cases was not announced correctly by assistive technology.

### Changes Made
- **Table recreation logic**  
  - Dispose of any existing table and columns before creating a new instance.
  - Create a fresh `Table` with `SWT.FULL_SELECTION` and `TableColumnLayout` on the parent composite.
  - Use a single `TableViewerColumn` that displays both the color swatch (image) and label (text) in the same column.
- **Header improvements**  
  - Add a visible column header using `StructuredTextEditorPreferencePage_23`, stripping the mnemonic (`&`) and trailing colon.
  - Increase the column’s minimum width to prevent text truncation.
- **Accessibility enhancements**  
  - Add accessible name and help for the table so screen readers announce “Appearance color options.”
  - Provide row-level announcements in the format `Appearance color options: <label>`.
  - Set appropriate accessibility roles (`ACC.ROLE_TABLE` and `ACC.ROLE_TABLECELL`).

### Result
This update ensures:
- The table renders with **a single visible column** and header.
- No phantom columns appear from previous initializations.
- Screen readers can correctly identify and read out the table and its contents.
- Improved accessibility compliance and usability for all users.
@andrew-tram
Copy link
Contributor Author

Hi @nitind , please let me know what you think.

@nitind nitind merged commit 4da9b38 into eclipse-sourceediting:master Aug 18, 2025
1 check passed
@nitind
Copy link
Contributor

nitind commented Aug 18, 2025

Thanks, Andrew!

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.

2 participants