CategoryOverlay contains a lot of glue code like most Overlays do. This in itself isn't inappropriate but it also touches many details which makes the code large, monolithic, and unwieldy to read, modify, and test. This task encompasses the work to break apart CategoryOverlay into separate **view**, **gateway + marshaling**, and **overlay** responsibilities as well as **adding tests** for each of these components to avoid regressions.
Some groundwork has been done in T191987:
- Fix bugs, simplify, and split up logic in the overlay, add tests to the gateway: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/460986
- Split out the view: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/461827