Skip to content

fix(ui): Fix edit button's generic aria label#8902

Open
austincalvelage wants to merge 8 commits into
mainfrom
austin/fix-edit-button-generic-aria-label
Open

fix(ui): Fix edit button's generic aria label#8902
austincalvelage wants to merge 8 commits into
mainfrom
austin/fix-edit-button-generic-aria-label

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Jun 17, 2026

Copy link
Copy Markdown
Member

Description

Updates the edit buttons generic aria-label.
Before:
CleanShot 2026-06-17 at 14 02 17@2x

After:
image

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • Accessibility Improvements
    • Improved screen-reader aria-labels for the identity preview “edit” buttons across verification, sign-in, sign-up, and user verification flows (email address, phone number, and identifier).
  • Localization Updates
    • Added new localized “Edit …” translation keys for identity edit button aria-labels to the base and v4 locale resources.
  • Tests
    • Updated sign-in factor code form tests to include the new aria-label props.

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4d48314

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 21 packages
Name Type
@clerk/ui Patch
@clerk/localizations Patch
@clerk/shared Patch
@clerk/astro Patch
@clerk/chrome-extension Patch
@clerk/react Patch
@clerk/swingset Patch
@clerk/vue Patch
@clerk/backend Patch
@clerk/clerk-js Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 18, 2026 2:28pm
swingset Ready Ready Preview, Comment Jun 18, 2026 2:28pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 590b324a-6fd4-465f-99ef-0186df227b43

📥 Commits

Reviewing files that changed from the base of the PR and between 60107bb and 04a0ca1.

📒 Files selected for processing (1)
  • packages/localizations/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/localizations/package.json

📝 Walkthrough

Walkthrough

Adds localized identity preview edit button labels, threads the new aria-label prop through identity preview and verification components, and updates verification flow callsites, tests, and release metadata to supply the labels.

Changes

Accessible identity preview edit button labels

Layer / File(s) Summary
Localization type and string values
packages/shared/src/types/localization.ts, packages/localizations/src/en-US.ts, packages/localizations/src/utils/enUS_v4.ts, packages/localizations/package.json, packages/localizations/src/*
Adds the new identity preview edit button keys to the shared localization type and updates locale resources, generation tooling, and locale files to include the new keys or placeholder values.
IdentityPreview, VerificationCodeCard, and VerificationLinkCard prop wiring
packages/ui/src/elements/IdentityPreview.tsx, packages/ui/src/elements/VerificationCodeCard.tsx, packages/ui/src/elements/VerificationLinkCard.tsx
IdentityPreview now accepts editButtonAriaLabel: LocalizationKey and uses localization for the edit button label, while both verification card elements forward the new prop.
Intermediate form components — prop contract and forwarding
packages/ui/src/components/SignIn/SignInFactorOneCodeForm.tsx, packages/ui/src/components/SignUp/SignUpVerificationCodeForm.tsx, packages/ui/src/components/UserVerification/UVFactorOneCodeForm.tsx, packages/ui/src/components/UserVerification/UVFactorTwoCodeForm.tsx
The verification form components add identityPreviewEditButtonAriaLabel to their props types and pass it through to VerificationCodeCard.
Card and screen callsites supplying localization keys
packages/ui/src/components/SignIn/SignInFactorOne*.tsx, packages/ui/src/components/SignIn/SignInFactorTwo*.tsx, packages/ui/src/components/SignUp/SignUp*.tsx, packages/ui/src/components/UserVerification/UV*.tsx, packages/ui/src/components/SessionTasks/.../SmsCodeFlowScreen.tsx
Verification flow callsites pass the appropriate localization key for the new aria-label prop across sign-in, sign-up, user verification, and SMS flows.
Tests and changeset
packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx, .changeset/bright-lamps-edit-labels.md
The SignIn form test fixtures include the new prop, and the changeset records the patch releases.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇✨ Hop, hop — the labels now can sing,
Edit buttons whisper the right thing.
Email, phone, and ID glow bright,
Accessible hops in the code tonight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding specific, context-aware aria labels to the identity preview edit button to replace a generic 'Edit' label.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Jun 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8902

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8902

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8902

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8902

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8902

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8902

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8902

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8902

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8902

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8902

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8902

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8902

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8902

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8902

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8902

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8902

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8902

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8902

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8902

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8902

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8902

commit: 4d48314

@austincalvelage austincalvelage marked this pull request as ready for review June 17, 2026 20:12
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-18T14:30:33.286Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 1
🟢 Additions 0

🤖 This report was reviewed by claude-sonnet-4-6.


@clerk/shared

Current version: 4.19.0
Recommended bump: MINOR → 4.20.0

Subpath ./types

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 91 unchanged lines elided ...
    footerPageLink__terms: LocalizationValue;
    paginationButton__previous: LocalizationValue;
    paginationButton__next: LocalizationValue;
+   identityPreviewEditButton__emailAddress: LocalizationValue;
+   identityPreviewEditButton__phoneNumber: LocalizationValue;
+   identityPreviewEditButton__identifier: LocalizationValue;
    paginationRowText__displaying: LocalizationValue;
    paginationRowText__of: LocalizationValue;
    membershipRole__admin: LocalizationValue;
// ... 1862 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (72%): The before/after snippets are structurally identical at all visible lines; the only difference is 3 additional elided lines (1882 vs 1879) in the after snippet, and __internal_LocalizationResource is used exclusively as an input to DeepPartial<DeepLocalizationWithoutObjects<...>> in LocalizationResource, meaning consumers only supply a deep-partial subset of it — new required fields added to an output-extended type that consumers only read partially are non-breaking, and adding optional/new localization keys to a type consumed via DeepPartial is always non-breaking since all fields become optional.


Report generated by Break Check

Last ran on 4d48314.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx (1)

177-213: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add assertions for the new localized edit-button accessible name.

The new identityPreviewEditButtonAriaLabel prop is now passed in fixtures, but the rendering tests only assert the code input label. Please assert the edit button’s accessible name so this accessibility behavior is actually covered.

Proposed test update
   it('renders phone code verification form', async () => {
@@
-    const { getByLabelText } = renderWithProviders(<SignInFactorOneCodeForm {...defaultProps} />, { wrapper });
+    const { getByLabelText, getByRole } = renderWithProviders(<SignInFactorOneCodeForm {...defaultProps} />, {
+      wrapper,
+    });

     expect(getByLabelText('Enter verification code')).toBeInTheDocument();
+    expect(getByRole('button', { name: /edit phone number/i })).toBeInTheDocument();
   });

   it('renders email code verification form', async () => {
@@
-    const { getByLabelText } = renderWithProviders(<SignInFactorOneCodeForm {...emailProps} />, { wrapper });
+    const { getByLabelText, getByRole } = renderWithProviders(<SignInFactorOneCodeForm {...emailProps} />, {
+      wrapper,
+    });

     expect(getByLabelText('Enter verification code')).toBeInTheDocument();
+    expect(getByRole('button', { name: /edit email address/i })).toBeInTheDocument();
   });

As per coding guidelines, “Unit tests are required for all new functionality” and tests should “Test component behavior, not implementation details.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx`
around lines 177 - 213, The tests for the phone code verification form and email
code verification form are passing the identityPreviewEditButtonAriaLabel prop
but are not asserting that the edit button actually displays with the correct
accessible name. Add assertions to both test cases that verify the edit button
element has the expected accessible name or aria-label attribute that matches
the localization key passed in the identityPreviewEditButtonAriaLabel prop. For
the email code test, query for the edit button using getByLabelText or getByRole
and assert it matches the expected accessible name from the localizationKeys
call, and similarly update the phone code test to verify the same behavior with
its respective identityPreviewEditButtonAriaLabel value from defaultProps.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx`:
- Around line 177-213: The tests for the phone code verification form and email
code verification form are passing the identityPreviewEditButtonAriaLabel prop
but are not asserting that the edit button actually displays with the correct
accessible name. Add assertions to both test cases that verify the edit button
element has the expected accessible name or aria-label attribute that matches
the localization key passed in the identityPreviewEditButtonAriaLabel prop. For
the email code test, query for the edit button using getByLabelText or getByRole
and assert it matches the expected accessible name from the localizationKeys
call, and similarly update the phone code test to verify the same behavior with
its respective identityPreviewEditButtonAriaLabel value from defaultProps.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9825d062-0154-4554-be42-6e4419e3460b

📥 Commits

Reviewing files that changed from the base of the PR and between ac83769 and db3d284.

📒 Files selected for processing (29)
  • .changeset/bright-lamps-edit-labels.md
  • packages/localizations/src/en-US.ts
  • packages/localizations/src/utils/enUS_v4.ts
  • packages/shared/src/types/localization.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/SmsCodeFlowScreen.tsx
  • packages/ui/src/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.tsx
  • packages/ui/src/components/SignIn/SignInFactorOneCodeForm.tsx
  • packages/ui/src/components/SignIn/SignInFactorOneEmailCodeCard.tsx
  • packages/ui/src/components/SignIn/SignInFactorOneEmailLinkCard.tsx
  • packages/ui/src/components/SignIn/SignInFactorOneForgotPasswordCard.tsx
  • packages/ui/src/components/SignIn/SignInFactorOnePasskey.tsx
  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
  • packages/ui/src/components/SignIn/SignInFactorOnePhoneCodeCard.tsx
  • packages/ui/src/components/SignIn/SignInFactorTwoCodeForm.tsx
  • packages/ui/src/components/SignIn/SignInFactorTwoEmailLinkCard.tsx
  • packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx
  • packages/ui/src/components/SignUp/SignUpEmailCodeCard.tsx
  • packages/ui/src/components/SignUp/SignUpEmailLinkCard.tsx
  • packages/ui/src/components/SignUp/SignUpPhoneCodeCard.tsx
  • packages/ui/src/components/SignUp/SignUpVerificationCodeForm.tsx
  • packages/ui/src/components/UserVerification/UVFactorOneCodeForm.tsx
  • packages/ui/src/components/UserVerification/UVFactorOneEmailCodeCard.tsx
  • packages/ui/src/components/UserVerification/UVFactorOnePhoneCodeCard.tsx
  • packages/ui/src/components/UserVerification/UVFactorTwoCodeForm.tsx
  • packages/ui/src/components/UserVerification/UVFactorTwoPhoneCodeCard.tsx
  • packages/ui/src/components/UserVerification/UserVerificationFactorTwoTOTP.tsx
  • packages/ui/src/elements/IdentityPreview.tsx
  • packages/ui/src/elements/VerificationCodeCard.tsx
  • packages/ui/src/elements/VerificationLinkCard.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants