Issue #3586303: Announce filtered row counts to screen readers in JS filter behaviors.

Description

  • Added core/drupal.announce as a library dependency in ai_context.libraries.yml so Drupal.announce() is guaranteed available.
  • js/ai_context_items_filter.js: after every filter change (apply()), counts visible tbody rows and calls Drupal.announce() with a pluralized translated message — e.g. "3 context items shown." or "No context items match the current filter."
  • js/ai_context_agents.js: after every search input event, counts visible rows and calls Drupal.announce() — e.g. "2 agents shown." or "No agents match the current filter."

4.2 AJAX reattachment

Verified — neither the context items table nor the agents overview form is replaced via AJAX in the current UI. The once() guards are correctly placed on the top-level elements. No fix needed.

Checklist

  • I have updated the MR title to use format: Issue #1234: My issue title.
  • I have updated the MR description to include: Closes #1234
  • I have performed a self-review of my own code
  • I have added or updated tests, or explained in the description why this change is not covered by tests
  • I have updated documentation for any new or changed functionality
  • I have written testing instructions and verified them locally
  • I have noted any required post-merge steps (config imports, cache rebuilds, manual changes)
  • This MR contains no breaking API or hook changes, or they are explicitly documented in the description

AI Compliance

Note

Check the one that best describes your usage, or leave all unchecked if AI was not significantly used.

  • AI Assisted Code
    Mainly written by a human; AI used for autocomplete or partial generation under full human supervision.

  • AI Generated Code
    Mainly generated by AI, reviewed and approved by a human before this MR was created.

  • Vibe Coded
    Generated by AI and only functionally reviewed before this MR was created.

Closes #3586303

Edited by Pravesh Poonia

Merge request reports

Loading