Page MenuHomePhabricator

UI for structured data on Commons should have the same Javascript hooks as Wikidata
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):

The interface for structured data on Commons should have the same Javascript hooks that Wikidata has.
List: https://doc.wikimedia.org/Wikibase/master/php/docs_topics_hooks-js.html

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

I tried to write user scripts for the structured data section but could not figure out how to make the code run at the right time.

For example, the interface takes multiple seconds to load, so a user script needs to know when the interface has finished rendering. On Wikidata, the script would use the wikibase.entityPage.entityView.rendered hook, but this hook does not work on Commons.

Benefits (why should this be implemented?):

User scripts and gadgets are useful.

Having the same set of hooks would make it more consistent, which would make it easier to write tools that work in multiple places.