Skip to content

Forms: Fix aria-label attribute by passing string values to Page - #47481

Merged
simison merged 2 commits into
trunkfrom
update/forms-aria-label-title
Mar 12, 2026
Merged

simison merged 2 commits into
trunkfrom
update/forms-aria-label-title

Conversation

@simison

@simison simison commented Mar 6, 2026 •

Copy link
Copy Markdown
Member

Part of JETPACK-1400
Part of JETPACK-1392

Follow up to #47461 to cover Forms, as previous PR covered everything else.

Proposed changes:

  • Adds ariaLabel to Page since we're using React components in title and aria-label requires string.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Forms dashboards using wp-build now includes ariaLabel that works: In DOM, see navigable region element aria-label go from [object object] to Jetpack Forms
  • Old dashboard still uses an internal component, so we can leave that be.

Changelog

  • Generate changelog entries for this PR (using AI).

Copilot AI review requested due to automatic review settings March 6, 2026 13:14
@simison simison added Bug When a feature is broken and / or not performing as intended [Feature] Forms [Package] Forms labels Mar 6, 2026
@github-actions

github-actions Bot commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the update/forms-aria-label-title branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-aria-label-title

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Mar 6, 2026

Copilot AI 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.

Pull request overview

This PR updates the Jetpack Forms wp-build dashboards to provide a proper string aria-label for the @wordpress/admin-ui Page navigable region when the visible title is a React element (e.g., logo + text), preventing the DOM from ending up with an aria-label like [object Object].

Changes:

  • Add an ariaLabel: string field to usePageHeaderDetails() and compute an appropriate label for list vs single-form screens.
  • Pass the new ariaLabel value into the Page component in both Forms and Responses wp-build routes.
  • Add a Forms package changelogger entry documenting the fix.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
projects/packages/forms/src/dashboard/wp-build/hooks/use-page-header-details.tsx Adds computed ariaLabel string to the header details returned by the hook.
projects/packages/forms/routes/responses/stage.tsx Wires ariaLabel from the hook into the wp-build <Page /> usage on the Responses route.
projects/packages/forms/routes/forms/stage.tsx Wires ariaLabel from the hook into the wp-build <Page /> usage on the Forms route.
projects/packages/forms/changelog/update-forms-aria-label Adds changelogger entry for the accessibility fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simison simison changed the title Forms: Fix aria-label attribute by passing string values to Page comp… Forms: Fix aria-label attribute by passing string values to Page Mar 6, 2026
@simison simison added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Mar 6, 2026
@jp-launch-control

jp-launch-control Bot commented Mar 6, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/dashboard/wp-build/hooks/use-page-header-details.tsx 0/103 (0.00%) 0.00% 4 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@simison simison added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Mar 6, 2026
@simison
simison requested review from a team and Copilot March 6, 2026 15:27

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +184 to +186
// "Forms" is a product name, do not translate.
return 'Jetpack Forms';
}, [ isSingleFormScreen, formTitle ] );

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

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

ariaLabel for non-single-form screens returns 'Jetpack Forms', but the visible header title is the product name Forms (and the comment says "Forms" is the product name). This creates an inconsistency and also doesn’t match the PR/testing note that the landmark label should become Forms. Consider using the same string as the displayed product name for ariaLabel (and/or centralize it as a shared constant) so the landmark label matches the UI.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Visible title is Jetpack logo + Forms, hence "Jetpack Forms".

@simison
simison force-pushed the update/forms-aria-label-title branch from c155ba4 to 554af82 Compare March 12, 2026 11:39
@simison
simison merged commit 8c54819 into trunk Mar 12, 2026
72 of 75 checks passed
@simison
simison deleted the update/forms-aria-label-title branch March 12, 2026 12:42
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Feature] Contact Form [Feature] Forms I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Package] Forms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants