Repository navigation
chore(release): v2.31.0 - #205
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 504c666e1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| setValue( | ||
| isActive ? false : mode === "decorative" ? "decorative" : true, | ||
| ) |
There was a problem hiding this comment.
Preserve the decorative mode when presets round-trip
When HideDecorativeImagesController is active and a user saves and reapplies a custom preset, mapFeaturesToProfileSettings collapses the stored "decorative" value to boolean true, which mapProfileSettingsToFeatures restores as true; resolveHideImagesMode then treats it as "all". The reapplied preset therefore hides informative images too. Preserve the selected mode through preference serialization, or map the legacy hideDecorativeImages preference explicitly to decorative mode.
Useful? React with 👍 / 👎.
| if (descendants.length <= 200) { | ||
| for (const desc of Array.from(descendants)) { | ||
| if (isStyleableElement(desc) && !desc.matches(EXCLUDED)) { | ||
| mediaNodes.push(desc); | ||
| } |
There was a problem hiding this comment.
Reprocess descendants beyond the 200-node cap
When a class change on a nested container activates CSS backgrounds or pseudo-images on its descendants, this queues descendants only when the subtree has at most 200 nodes. For larger subtrees, only the changed container is reprocessed, so affected images remain visible while hiding is active. Scan oversized subtrees in batches or schedule a broader refresh.
AGENTS.md reference: AGENTS.md:L12-L12
Useful? React with 👍 / 👎.
…ity, and large subtrees
…edback fix(images): address PR review feedback for profiles, pseudo specificity, and large subtrees
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09914824b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if (settings.hideDecorativeImages !== undefined) { | ||
| features.hideImages = settings.hideDecorativeImages; | ||
| features.hideImages = settings.hideDecorativeImages ? "decorative" : false; |
There was a problem hiding this comment.
Preserve all-image mode in custom preset round-trips
When HideImagesController is enabled in its new default all mode, the store holds true; saving a custom preset serializes that as hideDecorativeImages: true, and applying it passes through this mapping as "decorative", so informative images become visible after reapplying the preset. The fresh evidence is the new all-mode default paired with this mapping, which still represents only the legacy decorative boolean; preserve the selected mode through preset serialization.
Useful? React with 👍 / 👎.
| if (shouldHideImageElement(el, hideImagesMode)) { | ||
| const needsApply = | ||
| !hiddenImageElements.has(el) || | ||
| (isIncrementalMedia && | ||
| (el.style.getPropertyValue("visibility") !== "hidden" || | ||
| el.style.getPropertyPriority("visibility") !== "important")); | ||
| if (needsApply) { | ||
| hideImageVisibility = true; |
There was a problem hiding this comment.
Restore images when they become protected
When an already-hidden image is later reclassified as protected while image hiding remains enabled—for example, a class mutation marks it as a chart—this branch stops scheduling a hide but never restores the earlier visibility: hidden. The image stays hidden until the feature is disabled or reset; restore the effect-owned visibility when an incrementally processed image stops qualifying.
AGENTS.md reference: AGENTS.md:L12-L12
Useful? React with 👍 / 👎.
| if (values.hideImages) { | ||
| attributeFilter.push("style"); |
There was a problem hiding this comment.
Observe object image type and data changes
If an existing <object> or <embed> changes to an image/* type while image hiding is active, or an <object> changes its data, the observer does not receive those mutations because its attribute filter omits type and data. The new image therefore remains visible until another observed mutation occurs; include those attributes in the media observer.
AGENTS.md reference: AGENTS.md:L12-L12
Useful? React with 👍 / 👎.
| } else if ( | ||
| record.target.matches( | ||
| "img, picture, object[type^='image/' i], embed[type^='image/' i], svg, video, [data-video], .video-placeholder, iframe", | ||
| ) | ||
| ) { |
There was a problem hiding this comment.
Reprocess CSS backgrounds when decorative markers change
While decorative-only hiding is active, setting data-decorative, role, or aria-hidden on an existing CSS-background <div> does not queue it for reprocessing: this observer branch handles class changes broadly but otherwise only queues image and video elements. The background remains visible even though the element is now explicitly marked decorative; queue these marker-attribute mutations for CSS-image targets too.
AGENTS.md reference: AGENTS.md:L12-L12
Useful? React with 👍 / 👎.
Release v2.31.0
Merges #204 (
feat/hide-images-all-and-css->development) intomainto releaseaccessibility-plugin-react@2.31.0.Included Changes
HideImagesController(mode="all") + dedicatedHideDecorativeImagesController(mode="decorative"):HideImagesControllernow hides all non-protected host<img>(including non-emptyaltand missingalt),<picture>,<object type="image/*">,<embed type="image/*">, and explicitly decorative<svg>elements, whileHideDecorativeImagesControllerand<HideImagesController mode="decorative" />preserve strict decorative-only behavior.HIDE_IMAGES_MODES,HideImagesMode, andHideImagesValuefromsrc/index.ts.src/core/effects.ts):background-image,backgroundshorthand, CSS variables (var(...)),image-set()/-webkit-image-set()/cross-fade(),list-style-image, elementcontent: url(...),html/bodyhost roots, and::before/::afterpseudo-elements (via CSP-nonce-aware#arap-hide-images-style, openShadowRootstyles, anddocument.styleSheetsrule scanning), while preserving pure CSS gradients..paragraph,.typography,.photography,.roadmap,.sitemap,.charter,.aftermath, and.faqRow, while keeping widget UI,[data-arap-ignore]/[data-arap-exempt], buttons/controls, icon-only links, CAPTCHAs, charts, maps, QR/barcodes, and math protected.style,class, and media-attribute updates incrementally viaapplyMediaIncremental()and memoizes effect options inAccessibilityPlugin.package.json,package-lock.json,CHANGELOG.md,examples/basic-usage/main.tsx, docs, unit tests (51 files / 526 tests), and Playwright browser tests (260 passed / 10 Next-only skips).