Page MenuHomePhabricator

mobile-html reference handling
Closed, DeclinedPublic

Description

wmf.setReferenceHandler(referenceHandler)

referenceHandler would be a function that takes something along the lines of {id: "id2", adjacent_reference_ids: ["id1", "id2", "id3"]} where adjacent_reference_ids are any references next to the tapped reference [1][2][3]

When a reference is tapped, the referenceHandler is called with the appropriate information. This should be similar to the other interfaces between the web and the apps - T217352, T201382, T218049, etc

Event Timeline

JoeWalsh renamed this task from mobile-html references handling to mobile-html reference handling.Mar 20 2019, 4:59 PM

For adjacent_reference_ids don't you also need the label to put on the reference links? Should we just provide the backlinks array we got from the references output, or something similar to that? An example of the references output for multiple backlinks looks like this:

{ "back_links": [ {
    "href": "./PageTitle#cite_ref-foo-0",
    "text": "a"
  }, {
    "href": "./PageTitle#cite_ref-foo-1",
    "text": "b"
}]

@bearND the apps will have the /page/references/ response, so the IDs should be sufficient to look up the back links and any other info via references_by_id in that response

Pending discussion with the team, this could be merged into T219998 depending on if it makes more sense to have a single interaction handler or multiple interaction handlers

Will be taken care of with work for T219998