Repository navigation
fix(studio): give prompt preview editor an accessible name - #4398
lorenzozanee wants to merge 1 commit into
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
One blocker in the test. Since this branch was cut, main changed the dialog's own label from Ask agent — ${title} to Ask agent: ${title} (dash cleanup in Studio copy). PromptPreviewModal.test.tsx:17 still expects "Ask agent — Example". I ran the Studio sidebar tests on a local merge of this branch into current main, and that test fails:
AssertionError: expected 'Ask agent: Example' to be 'Ask agent — Example'
The dialog label isn't what this PR changes, so I'd drop that assertion. The not.toBe(dialog?.getAttribute("aria-label")) line already checks the textbox name differs from the dialog title. Alternatively, rebase and update the string. With the line updated, the test passes on the merge. Removing aria-label="Prompt" then makes it fail (expected null to be 'Prompt'), so it guards the fix.
Separately: main only accepts verified commits, and GitHub doesn't recognize the key this commit is signed with (unknown_key). When you push the test fix, please sign it with a key added to your account as a Signing key (Settings → SSH and GPG keys), using a commit email that's verified on your account.
— Rames
|
Thank you for tracking down the missing accessible name on the prompt editor and for the clear test. The one-line |
|
Re-landed as #6450 on current main, with you as co-author on the commit and the test's label string updated. Thank you for the fix. |
What
Give the catalog prompt preview editor a stable accessible name for its textarea.
Why
The dialog was named, but Chrome exposed the editable prompt textbox without a name, which prevented assistive technology from identifying the control independently.
Related work
Fixes #4384
How
Add
aria-label="Prompt"to the existingPromptPreviewModaltextarea. The controlled value, editing, copy, keyboard, focus, and close behavior are unchanged.Test plan
Validated locally with the focused Vitest regression test, Studio typecheck, oxlint, and oxfmt. A browser accessibility probe confirms the textbox name is
Prompt; full catalog navigation and remote CI remain for upstream validation.