Skip to content

test(multiple): check for incorrect usage of Angular Aria directives and log violations#33195

Open
adolgachev wants to merge 9 commits intoangular:mainfrom
adolgachev:aria-validation
Open

test(multiple): check for incorrect usage of Angular Aria directives and log violations#33195
adolgachev wants to merge 9 commits intoangular:mainfrom
adolgachev:aria-validation

Conversation

@adolgachev
Copy link
Copy Markdown
Contributor

@adolgachev adolgachev commented May 4, 2026

Used gemini to go through all of the components and generate additional violation checks for possible issues with how each set of angular aria directives are used together. Also generated specs for the new and previously existing violations.

Final commit adds a utility method to report the violations which does the console.error but also takes in an element to help in location where the issue is coming from.

@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: aria/accordion labels May 4, 2026
@adolgachev adolgachev changed the title feat(aria/accordion): check for possible errors with usage and log vi… test(aria/accordion): check for incorrect usage of Accordion directives and log violations May 4, 2026
@adolgachev adolgachev changed the title test(aria/accordion): check for incorrect usage of Accordion directives and log violations test(multiple): check for incorrect usage of Angular Aria directives and log violations May 4, 2026
@adolgachev adolgachev removed the detected: feature PR contains a feature commit label May 4, 2026
Comment thread src/aria/accordion/accordion-group.ts Outdated
Comment thread src/aria/accordion/accordion-panel.ts
@adolgachev adolgachev added the target: rc This PR is targeted for the next release-candidate label May 7, 2026
read: () => {
const violations: string[] = [];
if (!this._popup()) {
violations.push(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually erroring out on the demo page, even when set up. I can investigate further possible timing issue or we could just punt it to possibly deal with it later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Possibly due to the recent change that hides the overlay when a popup is collapsed.

@adolgachev adolgachev marked this pull request as ready for review May 7, 2026 23:50
@pullapprove pullapprove Bot requested a review from crisbeto May 7, 2026 23:50
@adolgachev adolgachev added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 7, 2026
@adolgachev adolgachev requested a review from tjshiu May 7, 2026 23:50
validate(): string[] {
const violations: string[] = [];

const rows = this.inputs.rows();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those are probably invalid when used as a filterable table.

validate(): string[] {
const violations: string[] = [];

if (this.inputs.items().length === 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment. This might be invalid when used as a filterable tree.

/** Logs each of the violations to the console as errors, optionally with the host element context. */
export function reportViolations(violations: string[], element: Element): void {
if (violations.length) {
console.error('Violations found on element: %o:', element);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

warn is probably less aggressive give the violations don't break the build.

tab: this._tabPattern,
});

private readonly _tabContent = contentChild(TabContent);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should probably consolidate this into the DeferredContent and check whether a DeferredContent is missing when DeferredContentAware is used.

read: () => {
const violations: string[] = [];
if (!this._popup()) {
violations.push(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Possibly due to the recent change that hides the overlay when a popup is collapsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants