Update context listing page filters
## Problem/Motivation
The context item listing at `/admin/config/ai/context/items` has a search box and a two-step scope filter (scope name, then scope value). This has some problems:
1. The search box matches label, purpose, and scope labels, but not status. Users cannot type "archived" or "draft" to find items.
2. The scope dropdowns grow with every distinct scope value used on the site (every referenced entity, use case, section, custom pattern). On real sites the "Scope value" list becomes very long and hard to use. The same scope labels are already searchable through the text box.
3. There is no way to filter by status. Sites with many archived or draft items have to scan the Status column by eye.
4. There is no way to filter by token usage. The Tokens column already shows a grey, yellow, or red badge (low, mid, high tier), but users cannot show only the large or borderline items they may want to tune or split.
## Proposed resolution
All changes are on the listing toolbar and its client-side filter. Filtering stays client-side (no query parameters, no new routes).
**1. Search includes status**
- Add the status label to the text searched by the search box, alongside label, purpose, and scope labels.
- Keep the search case-insensitive.
- After #3586540+s, each search word is matched separately, in any order. Put words in double quotes to match them as a phrase.
**2. Remove the scope dropdowns**
- Remove the "Scope" and "Scope value" selects from the toolbar.
- Remove the related `drupalSettings` (`aiContextItems.scopeFilter`), the row attribute that keys scope labels by scope, and the cascade code in `js/ai_context_items_filter.js`.
- Keep the plain scope labels on each row for the text search so "Global", a use case name, or a section name still match.
- Update the code comment that refers to a separate scope filter issue (#3574924+s), which is closed.
**3. Add a status filter**
- Add a "Status" select to the toolbar with "All statuses" plus one option per status present on the listed rows (the same "collect from rows" pattern the scope filter used).
- Statuses come from the content moderation state when the workflow applies, otherwise Published or Unpublished, so the options must be built from the rows and not hard-coded.
- Rows already carry the machine state in a `data-context-status` attribute; match on that.
**4. Add a token usage filter**
- Add a "Token usage" select with "All token usage" plus the three tiers used by the token badge: Low, Mid, High. Labels should say what the tier means, for example "Low (under 10% of budget)", reusing the estimator thresholds rather than duplicating numbers.
- Add a `data-context-tokens-tier` attribute to each row (the tier is already computed in `buildRow()`), and match on that. Do not recompute the tier in JS.
- Parent rows show a range; the badge tier is based on the high end of the range. Use the same value for the filter so the filter matches what the badge shows.
**5. Filter combination and parent/child rows**
- Search, status, and token usage combine with AND logic, as search and scope do today.
- Keep the existing parent/child behaviour: a matching child keeps its parent visible, and a matching parent keeps its children visible.
- Keep the "No context items match the current filter." announcement.
- Keep the toolbar hidden when there are no items.
## User interface changes
- Toolbar becomes: Search, Status, Token usage.
- Scope and Scope value selects are removed.
- Search matches status labels, and still matches label, purpose, and scope labels.
## API changes
None. The `data-context-scope-labels` row attribute and the `aiContextItems.scopeFilter` drupalSettings key are removed. Both were internal to the listing and its JS.
## Data model changes
None.
## Remaining tasks
- [x] UX decision: when filtering by status, should children that do not match still show under a matching parent (current behavior for search), or should each row be judged on its own? **INCLUDE**
- [x] Implement the changes in `AiContextItemListBuilder::render()`, `buildRow()`, and `js/ai_context_items_filter.js`.
- [x] Update `AiContextItemListFilterJsTest`: remove the scope cascade test, add tests for status search, status filter, token usage filter, combined filters, and parent/child visibility with the new filters.
- [x] Update `docs/features/context_items.md` listing section.
- [x] Check accessibility of the new selects (labels, announcements).
- [x] Run `./lint.sh`.
## Out of scope
- A searchable or autocomplete scope filter. The scope labels stay searchable through the text box, which replaces the dropdowns.
- Server-side filtering, pagination, or query parameter persistence.
- Changes to the token tier thresholds or badge colours.
## AI usage
- [x] AI assisted issue
issue
GitLab AI Context
Project: project/ai_context
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/ai_context/-/raw/1.0.x/CONTRIBUTING.md — contribution guidelines
- https://git.drupalcode.org/project/ai_context/-/raw/1.0.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/ai_context
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD