To support the display of constraint violation information in MEX (T400676) we need to fetch the details of current constraint violations from the backend and store them in the wbui pinia store.
The existing implementation of WikibaseQualityConstraints for the front-end is as a bundle of Javascript that is loaded if the wbEntityId and wbIsEditView flags are set (source) and hooks into the wikibase.entityPage.entityLoaded and wikibase.statement.saved hooks (source).
An implementation for MEX would likely need to define a new ResourceLoader module that determines if the wikibase.wbui2025.lib module is loaded (mw.loader.getModuleNames().includes("wikibase.wbui2025.lib") in the skipFunction script), and in that case hook behaviours into wikibase.entityPage.entityLoaded and wikibase.statement.saved hooks that populate the wbui pinia store with information about constraint violations by hitting the wbcheckconstraints API call, possibly using refactored versions of the existing fullCheck and snakCheck functions.
Acceptance Criteria
- For wikis where WikibaseQualityConstraints is loaded and MEX is enabled and in use, the wbui2025 pinia store is populated with information about constraint violations on entityInit and statement save. (exactly where the information should be stored may depend on the implementation of T411604, but the exact location shouldn't be a blocker to the rest of the implementation)