EDSC-3064: Give the project name edit and submit buttons an accessible name - #2070
Open
suthat wants to merge 1 commit into
Open
EDSC-3064: Give the project name edit and submit buttons an accessible name#2070suthat wants to merge 1 commit into
suthat wants to merge 1 commit into
Conversation
…e name The two icon-only buttons in the project header passed their text through a `label` attribute. That is not a valid attribute on a native `<button>`, so it lands in the DOM without doing anything and screen readers announce both buttons as just "button". The adjacent project name input had no name at all. Switch both buttons to `aria-label` and label the input. No visual or behavioral change. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
What is the feature?
Closes #1359.
The project header on
/projectshas two icon-only buttons for renaming a project — a pencil to start editing and a check to save. Neither has an accessible name, so a screen reader announces both as just "button".Both buttons already spell out what they do, but they do it through a
labelattribute:labelisn't a valid attribute on a native<button>, so React forwards it to the DOM where nothing reads it. The icon doesn't fill the gap either —EDSCIconrenders withrole="graphics-symbol"and noaria-labelunless one is passed in.It's an easy mistake to make. The shared
Buttoncomponent does accept alabelprop and maps it toaria-labelinternally, but these two are native<button>elements, so they never get that treatment.While I was in there I noticed the project name
<input>sitting between the two buttons has no label of any kind either, so renaming a project is currently three unnamed controls in a row. Let me know if you'd rather I split that out.What is the Solution?
labelbecomesaria-labelon both buttons, plus anaria-labelon the input.No markup, styling, or behaviour changes, and the
data-testidattributes the Playwright specs depend on are untouched.The other three findings listed in #1359 — the temporal and spatial dropdown toggles, and the band subsetting folder toggles — already have accessible names, so I believe this closes the issue out. Happy to drop the
Closesif you'd rather confirm that separately.What areas of the application does this impact?
The project name control in the project header on
/projects, and only its accessible names. Nothing changes visually.Testing
Reproduction steps
/projects.mainit comes through as an unnamed "button"; with this change it reads "Edit project name".Two of the existing tests in
ProjectHeader.test.jsxlooked these buttons up bydata-testid, which passes whether or not the accessible name resolves. They now query by role and name instead, so they fail onmainand pass here:npx eslintis clean on both changed files.Attachments
None — there is no visual change to capture.
Checklist
npm audit fixand made note of any changes in this PR — no dependencies are touched by this PR