Page MenuHomePhabricator

mobile-html reference handling
Open, NormalPublic

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 created this task.Mar 20 2019, 4:58 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 20 2019, 4:58 PM
JoeWalsh renamed this task from mobile-html references handling to mobile-html reference handling.
bearND added a subscriber: bearND.EditedMar 25 2019, 6:26 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"
}]
LGoto triaged this task as Normal priority.Mar 27 2019, 3:38 PM
LGoto moved this task from Needs triage to Backlog on the Reading-Infrastructure-Team-Backlog board.

@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

bearND added a comment.Apr 3 2019, 9:01 PM

@JoeWalsh Thanks! That makes sense.