Skip to content

fix(studio): give prompt preview editor an accessible name - #4398

Closed
lorenzozanee wants to merge 1 commit into
heygen-com:mainfrom
lorenzozanee:fix/prompt-preview-accessible-name
Closed

lorenzozanee wants to merge 1 commit into
heygen-com:mainfrom
lorenzozanee:fix/prompt-preview-accessible-name

Conversation

@lorenzozanee

Copy link
Copy Markdown
Contributor

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 existing PromptPreviewModal textarea. The controlled value, editing, copy, keyboard, focus, and close behavior are unchanged.

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)

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.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Thank you for tracking down the missing accessible name on the prompt editor and for the clear test. The one-line aria-label="Prompt" on the textarea (PromptPreviewModal.tsx) is still the right fix. We are closing this because it has been idle for over a month with the review's requests still open: the test at PromptPreviewModal.test.tsx:17 expects the dialog label Ask agent — Example, but the component now renders Ask agent: Example, and the commit is not signed, which the repo requires. If you would like to pick it up, a fresh PR on current main that fixes the expected label and uses a signed commit would be accepted quickly. If we hear nothing we will carry the one-line change ourselves and credit you for the find.

@miguel-heygen

Copy link
Copy Markdown
Collaborator

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.

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.

Studio catalog prompt editor has no accessible name

3 participants