Skip to content

fix[sdks][image]: ENG-13982 remove redundant presentation role - #4864

Open
floating-dynamo wants to merge 2 commits into
mainfrom
ENG-13982-alt-role-img
Open

floating-dynamo wants to merge 2 commits into
mainfrom
ENG-13982-alt-role-img

Conversation

@floating-dynamo

@floating-dynamo floating-dynamo commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Gen 1 and Gen 2 Image blocks with blank or missing alt text rendered both alt="" and role="presentation", causing WCAG Level A / ARIA4 violations in accessibility scans.
  • Removed the redundant role while keeping alt="", which is the native HTML method for marking decorative images and leaves meaningful alt text unchanged.
  • Also raised a PR on builder-internal side - https://github.com/BuilderIO/builder-internal/pull/14864

Link to JIRA ticket (if applicable):
https://builder-io.atlassian.net/browse/ENG-13982

Screenshot/Clip
Content with an image and no alt text added:
image

Before the fix

image

After the fix

image

Note

Low Risk
Narrow markup change for accessibility compliance; behavior for decorative vs descriptive images stays the same aside from removing invalid redundant ARIA.

Overview
Image blocks with missing or blank alt text no longer set role="presentation" alongside alt="". That pairing triggered WCAG Level A / ARIA4 failures in accessibility scans; empty alt alone is the correct signal for decorative images, and images with real alt text are unchanged.

The change is applied in the React Image block and the shared SDK image.lite renderer. Unit and e2e coverage now assert that role is absent on images (with or without alt text), and image test fixtures explicitly use empty altText where needed. Patch releases are noted for @builder.io/react and the Gen 2 SDK packages via changeset.

Reviewed by Cursor Bugbot for commit eeb368b. Bugbot is set up for automated code reviews on this repo. Configure here.

@floating-dynamo
floating-dynamo requested a review from a team September 24, 2026 06:43
@floating-dynamo floating-dynamo self-assigned this Sep 24, 2026
@floating-dynamo
floating-dynamo requested review from sanyamkamat and removed request for a team September 24, 2026 06:43
@changeset-bot

changeset-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: eeb368b

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

This PR includes changesets to release 8 packages
Name Type
@builder.io/react Patch
@builder.io/sdk-angular Patch
@builder.io/sdk-react-nextjs Patch
@builder.io/sdk-qwik Patch
@builder.io/sdk-react Patch
@builder.io/sdk-solid Patch
@builder.io/sdk-svelte Patch
@builder.io/sdk-vue 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

@nx-cloud

nx-cloud Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit eeb368b

Command Status Duration Result
nx test @snippet/react ✅ Succeeded 1m 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-24 10:18:47 UTC

@builder-io-integration builder-io-integration 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.

Builder reviewed your changes and has a few items to flag 🟡

Review Details

Code Review Summary

This incremental update removes the redundant role="presentation" attribute from the React and SDK image renderers while preserving the empty alt value for decorative images. The change is consistent across the two renderers, adds SDK end-to-end assertions for both empty and non-empty alt text, and includes a patch changeset for the affected packages. Risk assessment: Low, because this is a focused accessibility/UI semantics change.

Key Findings

  • 🟡 MEDIUM: The React implementation change affects existing snapshot output, but the image snapshots were not updated. The targeted React image test suite is expected to fail for existing snapshot cases that still contain role="presentation".

The accessibility intent and cross-SDK behavior are otherwise sound, and the new assertions directly cover the intended markup. 🧪 Browser testing: Skipped — dev server unavailable (setup is still installing, proxy is stopped, and no dev command is configured).

@AishwaryaParab

Copy link
Copy Markdown
Contributor

@floating-dynamo one Q I had here is: Is this change really required and how does this affect our existing sdks and tracking pixel? Did we really have to make this change?

@floating-dynamo

Copy link
Copy Markdown
Contributor Author

@floating-dynamo one Q I had here is: Is this change really required and how does this affect our existing sdks and tracking pixel? Did we really have to make this change?

Yes, this change is needed to fix the WCAG Level A/ARIA4 issue reported by the customer. alt="" already tells browsers and assistive technology that an image is decorative, so adding role="presentation" duplicates the same semantics. The role made sense before the Image block always rendered an alt attribute, but that changed in #4818.

The impact is narrow. After upgrading, Image blocks with missing or cleared alt text will stop rendering the role, but they will remain decorative and ignored by screen readers. Images with meaningful alt text, along with visual rendering and layout, are unchanged.

The tracking pixel is covered by a separate API PR. It keeps alt="" and aria-hidden="true" and only removes the redundant role. Tracking behavior is unchanged.

This branch has not been deployed

No deployments
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.

2 participants