The help panel has evolved a lot from its initial implementation. It's now used:
- in read mode
- edit mode
- for guidance with suggested edits
- on Special:Homepage
And further it has different modes and capabilities depending on how it is used.
The code to control the business logic for all of the above is spread out across backend code (HelpPanelHooks.php, but also Homepage module code) as well as front-end (init.js, cta.js, helppanelprocessdialog.js). The front end code in particular is lightly tested.
This task would propose to:
- create a help panel controller in JS that handles the business logic and is unit testable (using our existing node-qunit setup)
- slim the init.js code to the minimum needed to load the CTA and create the controller (which could then also open up the process dialog if in a suggested edit session), addressing a performance concern from T218591
- related to the previous point, remove business logic from HelpPanelProcessDialog.js wherever possible