Skip to content

Git/SVN changelist checkboxes are not exposed to screen readers #19328

Closed

Description

@gtritchie

Follow-up to #18494.

System details

RStudio Edition : Desktop or Server
RStudio Version : all current releases
OS Version      : any
R Version       : any

Describe the problem in detail

The Staged checkbox in the Git pane and Review Changes window, and the checkbox column of the SVN changelist, is drawn by TriStateCheckboxCell as a bare <img alt=""> (src/gwt/src/org/rstudio/core/client/cellview/TriStateCheckboxCell.java, render()). It has no role, no checked state and no name, so a screen reader treats it as a decorative image and skips it. A screen reader user cannot tell whether a file is staged, or that the cell is a control at all.

The cell has three states -- staged, unstaged, and partially staged (null) -- so the indeterminate state needs to be conveyed too.

Expected

Each changelist checkbox is announced as a checkbox with its state (checked, not checked, or mixed for a partially staged file), and a name that identifies the file, e.g. "Stage R/foo.R".

Notes on fixing

  • Native <input type="checkbox"> with indeterminate set from script, or role="checkbox" with aria-checked="true|false|mixed" on the existing element.
  • The accessible name needs the file path, which the cell does not currently receive; AriaLabeledCheckboxCell takes a LabeledBoolean for this reason.
  • Keyboard operation of the column within the cell table should be checked at the same time: onBrowserEvent acts only on events whose target is the <img>.
  • Image-based checkmarks ignore Windows contrast themes #18494 tags this <img> with rstudio-forced-colors-glyph classes so Windows contrast themes can redraw it. If it is replaced with a different element, carry those over or drop the matching rules in themeStyles.css.

Also: the Status column

The Status column's icons (GitStatusRenderer, SVNStatusRenderer) have the same problem. Each icon is an <img alt>, and the status description ("Modified", "Added/Modified", ...) exists only as the title of the enclosing <span>, which screen readers do not reliably read. The description should be the icons' accessible name, e.g. role="img" with an aria-label on that span.

Also: the table has no name

The changelist <table> itself has no accessible name, so it is announced only as "table". It should be named for its contents: "Changed files" in the Git pane, the Review Changes window, and the SVN pane, and "Files to commit" in the SVN commit dialog, where the checkboxes select files for the commit.

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions