Restore altText to v0.8 and make specifications match implementations.#993
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces accessibility support for image components across the Angular, Lit, and React renderers by adding altText or description properties. The changes include logic to resolve these properties from literal strings or data paths, updates to component templates, and corresponding specification updates for versions 0.8, 0.9, and 0.10. Unit tests have been added to verify the correct rendering of alt text, and the React renderer version has been bumped to 0.8.1. I have no feedback to provide.
| "@angular/core": "^21.2.5", | ||
| "@types/node": "^24.11.0", | ||
| "c8": "^11.0.0", | ||
| "gts": "^7.0.0", | ||
| "rxjs": "^7.8.2", |
There was a problem hiding this comment.
It appears that @angular/core and rxjs have been added to the devDependencies in the package-lock.json for the React renderer. These are typically Angular-specific dependencies and seem out of place in a React project. Please verify if these dependencies are truly necessary for the React renderer's development environment. If not, they should be removed to avoid unnecessary package bloat and potential conflicts.
There was a problem hiding this comment.
Hmm. All I did here was run "npm install", so they were somehow already dependencies.
There was a problem hiding this comment.
I have removed rxjs: it is unused in the React renderer.
@angular/core is a transitive dependency. It isn't listed in react/package.json but it is in package-lock.json because web_core (which react depends on locally via a file: relationship) lists it as a devDependency to test its reactivity system against Angular Signals.
…l slider labels (v0.8) across renderers
…ct unit test for optional label
altText to v0.8 and add description to v0.9 and v0.10.altText to v0.8 and make specifications match implementations.
Description
In a recent refactor, I removed the
altTextfrom the Angular v0.8Imagecomponent because it wasn't part of the specification, but I've since seen that it was actually in common usage (not really surprising, in retrospect), so I've added it back, and retroactively added it to the Image component schema in the v0.8 specification.For the v0.9 specification, it also didn't exist, but there was already a
descriptionimplemented for some renderers on theImagecomponent which served that same purpose, but without being in the specification. So I've addeddescriptionto the v0.9 and v0.10 specifications. The name change to "description" makes sense to me because it describes what should be in that field, making it self-documenting to an LLM. I'm sure an LLM also knows what "alt text" is, but this would keep it more general and not web-centric.I've also implemented
altText/descriptionfor the React and Lit renderers (which are using v0.9 and v0.8, respectively).Slider Accessibility and Label Standardization (v0.8)
In addition to the Image accessibility changes, this PR also standardizes the
Slidercomponent'slabelproperty in v0.8:labelproperty to bothserver_to_client_with_standard_catalog.jsonandstandard_catalog_definition.jsonfor v0.8 using the dynamic string pattern (supporting both literal strings and data paths).labelinput optional (removed.required) and updated the template to render it conditionally using@if.extractStringValue(supporting dynamic paths) and render conditionally only when provided.<label>conditionally only when non-empty.This ensures that
labelis optional across all renderers and behaving consistently for v0.8. Tests have been verified for all modified packages.