fix[sdks][image]: ENG-13982 remove redundant presentation role - #4864
floating-dynamo wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: eeb368b The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
|
View your CI Pipeline Execution ↗ for commit eeb368b
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
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).
|
@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. 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 |
Description
alt=""androle="presentation", causing WCAG Level A / ARIA4 violations in accessibility scans.alt="", which is the native HTML method for marking decorative images and leaves meaningful alt text unchanged.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:
Before the fix
After the fix
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"alongsidealt="". 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
Imageblock and the shared SDKimage.literenderer. Unit and e2e coverage now assert thatroleis absent on images (with or without alt text), and image test fixtures explicitly use emptyaltTextwhere needed. Patch releases are noted for@builder.io/reactand 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.