Skip to content

CHI-4045: Make USCH categories filter collapsible, searchable, with selected count and loading spinner - #4900

Open
gpaoloni wants to merge 6 commits into
CHI-4045-usch-category-filterfrom
CHI-4045-collapsible-categories-filter
Open

gpaoloni wants to merge 6 commits into
CHI-4045-usch-category-filterfrom
CHI-4045-collapsible-categories-filter

Conversation

@gpaoloni

@gpaoloni gpaoloni commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Description

USCH has more than 100 resource categories, which made the categories filter from #4898 hard to use. This PR (stacked on #4898):

  • Collapsible (USCH only). The categories filter starts collapsed. Clicking its header expands or collapses it; the header button sets aria-expanded and aria-controls.
  • Selected count. The header shows how many categories are selected, e.g. "Categories (3 selected)", so selections are visible while the filter is collapsed.
  • Loading spinner. A small spinner shows next to the header while the categories are fetched (once per session; it can take a few seconds). Loading is tracked in the USCH filters component, using the promise asyncDispatch returns, so no new Redux state is needed.
  • Trimmed labels. Some category values in the DB have leading/trailing spaces (likely from the HRM importer splitting Categories on ; without trimming). Option labels are trimmed once, when loaded. Values are kept as stored, because HRM matches them exactly against categoriesName; trimming them would make those categories match nothing.
  • Search box. When expanded, a search box at the top narrows the list to categories containing the typed text (case-insensitive). Categories hidden by the search stay selected.
  • No scrolling. The shared checkbox grid no longer scrolls and always shows every option it is given; the collapse and the search are what keep the list manageable. The grid is now exported on its own as CheckboxMultiSelectOptions, so the USCH filter can put it under its own header. CheckboxMultiSelectFilter (box + header + grid) is unchanged for KHP.
  • SearchInput gets an optional id (default search-input, as before), so it doesn't clash with the main resources search box on the same form.

Why not ExpandableComponent: it truncates content to one line and only shows "…more" when that line overflows, and its hook moves focus to that link on mount. Neither fits a filter that should start fully collapsed.

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

Verification steps

  1. On a USCH environment, open resource search. The Categories box is collapsed and shows only its header, with a spinner until the categories have loaded.
  2. Click the header. The search box and the full category list appear (no inner scroll). Click again to collapse.
  3. Type part of a category name. Only matching categories are shown. Select one, clear the search, and check that earlier selections are still ticked. The header shows the number of selected categories, including while collapsed.
  4. On a KHP environment, the Fee Structure and "How is this service offered?" filters look and behave as before.
  • Automated checks: the new USCHCategoriesFilter and USCHResourceSearchFilters tests and the existing resource and case-list filter tests pass, and so do tsc and lint. The full npm test suite was not run locally; please rely on CI for that. The UI has not been checked in a browser against a USCH account.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

🤖 Generated with Claude Code

@gpaoloni gpaoloni changed the title CHI-4045: Make USCH categories filter collapsible and searchable CHI-4045: Make USCH categories filter collapsible, searchable, with selected count and loading spinner Nov 25, 2026
@gpaoloni
gpaoloni added this pull request to stack #4899 November 25, 2026 20:21
gpaoloni and others added 6 commits November 26, 2026 13:58
USCH has 100+ categories, so the categories filter now starts collapsed,
expands from its header and has a search box to narrow the list down.
The shared checkbox grid no longer scrolls; it always shows every option
it is given. KHP filters are unchanged.

SearchInput gets an optional id so it can be used twice on one screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ories filter

The collapsed header now says how many categories are selected, and a
small spinner shows while the categories are being fetched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some category values in the DB have leading/trailing spaces. Trim the
label once when the options are loaded; keep the value as stored because
HRM matches it exactly against the search index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some categories are stored with stray spaces, so the same category showed
up more than once. Trim category values as well as labels so the variants
collapse into a single option. Location values are left as stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g while loading

Use disableShrink on the spinner, since MUI's shrink animation freezes when
the main thread is busy and makes the request look finished. Disable the
categories toggle until the options are loaded, so it can't open empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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