WordPress / playground-tools

GNU General Public License v2.0
127 stars 38 forks source link

Playground block: Improve file tabs accessibility #301

Closed brandonpayton closed 2 weeks ago

brandonpayton commented 2 weeks ago

What?

This PR clarifies the ARIA labels on the file tabs in the code editor. In addition, it clarifies which file button is currently selected.

Fixes #288

Why?

To quote from #288:

It is not clear that these buttons will switch the code editor view. Suggestions:

  • File: index.php
  • Read-only file: PHP error_log

Since these are functioning similarly to tabs, I would also mark the active one. You can use aria-current="true". This attribute must also be toggled with JavaScript with onClick event or similar.

How?

This PR adds a "File: " prefix to all regular file names and a "Read-only file: " prefix to the error log tab if it is present. In addition, it adds "aria-current' attributes to the file buttons to indicate whether or not each button is the currently selected one.

Testing Instructions

brandonpayton commented 2 weeks ago

I'm going to merge this because it has been tested and is low risk.