Skip to content

chore(release): v2.31.0 - #205

Merged
prabothcharith merged 6 commits into
mainfrom
development
Nov 20, 2026
Merged

prabothcharith merged 6 commits into
mainfrom
development

Conversation

@prabothcharith

Copy link
Copy Markdown
Owner

Release v2.31.0

Merges #204 (feat/hide-images-all-and-css -> development) into main to release accessibility-plugin-react@2.31.0.

Included Changes

  • Default HideImagesController (mode="all") + dedicated HideDecorativeImagesController (mode="decorative"):
    • HideImagesController now hides all non-protected host <img> (including non-empty alt and missing alt), <picture>, <object type="image/*">, <embed type="image/*">, and explicitly decorative <svg> elements, while HideDecorativeImagesController and <HideImagesController mode="decorative" /> preserve strict decorative-only behavior.
    • Exported HIDE_IMAGES_MODES, HideImagesMode, and HideImagesValue from src/index.ts.
  • Complete CSS & pseudo-element image hiding (src/core/effects.ts):
    • Supports background-image, background shorthand, CSS variables (var(...)), image-set() / -webkit-image-set() / cross-fade(), list-style-image, element content: url(...), html/body host roots, and ::before/::after pseudo-elements (via CSP-nonce-aware #arap-hide-images-style, open ShadowRoot styles, and document.styleSheets rule scanning), while preserving pure CSS gradients.
    • Uses camelCase-aware word-boundary token matching to avoid false positives on landmarks or class names like .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.
    • Supports dynamic style, class, and media-attribute updates incrementally via applyMediaIncremental() and memoizes effect options in AccessibilityPlugin.
  • Docs, Examples, Tests & Version Bump:
    • Updated 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).

Copilot AI balanced review requested due to automatic review settings November 20, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T06:58:25.983619Z 0991482 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +37 to +39
setValue(
isActive ? false : mode === "decorative" ? "decorative" : true,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/core/effects.ts
Comment on lines +2645 to +2649
if (descendants.length <= 200) {
for (const desc of Array.from(descendants)) {
if (isStyleableElement(desc) && !desc.matches(EXCLUDED)) {
mediaNodes.push(desc);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

…edback

fix(images): address PR review feedback for profiles, pseudo specificity, and large subtrees

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/core/profiles.ts

if (settings.hideDecorativeImages !== undefined) {
features.hideImages = settings.hideDecorativeImages;
features.hideImages = settings.hideDecorativeImages ? "decorative" : false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/core/effects.ts
Comment on lines +1578 to +1585
if (shouldHideImageElement(el, hideImagesMode)) {
const needsApply =
!hiddenImageElements.has(el) ||
(isIncrementalMedia &&
(el.style.getPropertyValue("visibility") !== "hidden" ||
el.style.getPropertyPriority("visibility") !== "important"));
if (needsApply) {
hideImageVisibility = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/core/effects.ts
Comment on lines +2752 to +2753
if (values.hideImages) {
attributeFilter.push("style");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/core/effects.ts
Comment on lines +2681 to +2685
} else if (
record.target.matches(
"img, picture, object[type^='image/' i], embed[type^='image/' i], svg, video, [data-video], .video-placeholder, iframe",
)
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@prabothcharith
prabothcharith merged commit c4b8c6b into main Nov 20, 2026
7 checks passed
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