There are various problems with skin menus. There are menus across the MediaWiki interface - in the footer, sidebar, personal tools, but all use different hooks. This task suggests a long term plan for how to simplify the current skin ecosystem for registering and modifying menus.
Note: many skins have built their own menu systems, e.g. Minerva has a MenuBuilder class, and certain skins want nested menus (e.g. T62656). We will look to these for guidance.
Suggested spec (draft)
- Extensions and skins can register new menus
- There will be one hook for modifying menus. This will replace all existing hooks SidebarBeforeOutput, SkinTemplateNavigation::Universal, SkinAddFooterLinks and PersonalUrls
- It should be possible to use the hook to model and edit the footer, categories, sidebar, user personal menu (think Vector 2022 user dropdown), namespace tabs (Article | Talk), action tabs (edit, watch etc..) and more menu (the more dropdown that shows in Vector)
- It should be possible for menu items to have icons associated with them
- Links that depend on page existence must be preloaded to avoid numerous database queries. For the footer this is currently done using Skin::preloadExistence but should be extended to also be considered in the generation of the sidebar (See T299099 for more context).
Nice to have
- It should be possible to modify any menu using a mediawiki page. Currently, only the sidebar is modifiable on wiki via MediaWiki:Sidebar, but for skins that have custom menus e.g. CologneBlue's home menu only hook options exist.