Problem/Motivation
When a search matches many entities of more than one type (e.g. hundreds of nodes and content blocks), the results page is one long list with only an h3 between the entity types. It's hard to see where one type ends and the next begins, or how many matches each type has, without scrolling through everything.
Proposed resolution
Render each entity type's results in a details element:
- The summary shows the type's label with its counts, e.g. "Content block (15 entities, 42 matches)".
- Groups are open by default for small result sets and closed for large ones, above a threshold such as 20 entities, so a large search shows a compact overview first.
- The list inside each group is unchanged.
This applies to both search results and the "Content that was changed" output after a replace, since they share the scanner_results template.
Remaining tasks
- Update scanner-results.html.twig and add preprocessing for the groups.
- Add test coverage for the grouping and the open/closed behaviour.
- Review.
User interface changes
Before

After

API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Screenshot 2026-09-24 at 7.11.00 PM.png | 56.28 KB | smustgrave |
| #6 | Screenshot 2026-09-24 at 7.03.44 PM.png | 224.84 KB | smustgrave |
Issue fork scanner-3625710
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
john.oltman commentedComment #4
john.oltman commentedComment #5
smustgrave commented+1 to the idea I’ll take a look before the weekend. Tagging a potential release issue about improving the UI in general. Think this would be a step in that direction
Comment #6
smustgrave commentedAdded screenshots to the summary and took the liberty with 1 change and sorting the results. Was weird taxonomy being above content. Once pipeline finishes I'll merge
Comment #7
smustgrave commentedComment #10
john.oltman commentedSweet, thanks for the merge and the new release!