Page MenuHomePhabricator

Create Special:Citations fallback for non-JavaScript/Resourceloader unsupported users
Closed, ResolvedPublic5 Story Points

Description

Note a proof of concept exists: https://gerrit.wikimedia.org/r/#/c/277358/

  • When I visit Special:MobileCitations/<revid> I should see a list of references for the given page as they would have appeared had they been embedded in the article.
  • If the page doesn't exist I see an error message "The page that references were requested for does not exist.
  • If there are no references I see a message "This page has no references."
  • The page should be available in any skin (including Vector desktop) but do not worry about using anything other than the default styling.

On any given page

  • Any links inside a sup tag with class reference should be rewritten to be prefixed with a local URL for Special:MobileCitations e.g.
<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span>[</span>18<span>]</span></a></sup>

becomes

<sup id="cite_ref-18" class="reference"><a href="/wiki/index.php/Special:Citations/revid/Title#cite_note-18"><span>[</span>18<span>]</span></a></sup>
  • Replace the references list/the temporary message with a link to "See references for this page" that points to the Special:Citations page.

Related Objects

StatusAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
DeclinedNone
OpenNone
Resolveddr0ptp4kt
DuplicateJhernandez
Duplicatedr0ptp4kt
OpenNone
ResolvedJdlrobson
DeclinedNone
DeclinedNone
ResolvedJdlrobson

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
dr0ptp4kt set Security to None.Feb 6 2016, 3:03 PM
Restricted Application added a subscriber: Luke081515. · View Herald TranscriptFeb 8 2016, 10:37 AM
Sumit added a subscriber: Sumit.Feb 15 2016, 8:14 PM
Sumit added a comment.Feb 16 2016, 3:45 PM

Does cite store references in page_props or somewhere else, so that they could be retrieved on a SpecialPage given a page title?

Should the task title be updated to reflect this is for RL incompatible UAs? Or are we going to go the extra step and actually support lazy-loaded references for JS-but-RL-incompatible UAs?

Jdlrobson renamed this task from Create Special:References fallback for non-JavaScript users to Create Special:References fallback for non-JavaScript/Resourceloader unsupported users.Feb 18 2016, 6:21 PM

@Sumit Cite stores them in page props and they can be accessed via Cite::getStoredReferences
Unfortunately the blocking bug however limits our ability to make progress int his area right now...

Jdlrobson moved this task from Backlog to Tasks on the MobileFrontend board.Feb 18 2016, 6:29 PM
Jdlrobson renamed this task from Create Special:References fallback for non-JavaScript/Resourceloader unsupported users to Create Special:Citations fallback for non-JavaScript/Resourceloader unsupported users.Feb 24 2016, 7:34 PM
Jdlrobson set the point value for this task to 5.Feb 26 2016, 10:35 PM
Jdlrobson added subscribers: Nirzar, JKatzWMF.

Jon to talk to @JKatzWMF and @Nirzar through this

Other options:

  • Make references JS only
  • Load the references list via JavaScript in the references section to avoid giving an inconsistent experience.

I talked with @Nirzar about this today.
He is fine with just rendering the title and the list of references in a single special page given that the number of people who get to this is likely to be low.
Here is my prototype of how this might look (Nirzar to provide an updated one)

We also talked about using JavaScript to render the citations in the article itself via JavaScript when expanded/scrolled to.

Krinkle added a subscriber: Krinkle.EditedMar 4 2016, 11:18 PM

I talked with @Nirzar about this today.
He is fine with just rendering the title and the list of references in a single special page given that the number of people who get to this is likely to be low.

I just want to annotate "low" with some actual data before we rush to judgement. Traffic analysis for December 2015:

  • Grade A browsers: 85.58% (13 billion page views)
  • Grade C browsers: 5.63% (870 million page views)
  • Grade X browsers: 8.79% (1.3 billion page views)

This is from the "wmf pageview browsers 2015-12" Google Doc previously shared previously. (Exact breakdown kept internal for now, but this is the aggregate).

The non-Resourceloader group is Grade C.

The non-JavaScript group is Grade C plus any page views with Grade A or Grade X browsers from users with JavaScript disabled or that experienced connectivity issues that resulted in JavaScript not fully initialising.

jayvdb added a subscriber: jayvdb.Mar 11 2016, 9:57 PM

Why is it now "Special:MobileCitations" in the task description? There are non-mobile users without JavaScript enabled.

Jdlrobson updated the task description. (Show Details)Mar 14 2016, 4:43 PM

@jayvdb the mobile prefix is needed if we put this in the MobileFrontend extension which is the current suggestion. It would of course work for desktop users who wanted to use it (that said the predominant use case at the moment is mobile). I've updated the card.

I personally still believe the Cite API is the way to go, in which case this would be Special:Cite and it would live in the Cite extension.

As part of the writing of unit tests I needed to setup some scaffolding for the special page to write php unit tests for the formatter:
https://gerrit.wikimedia.org/r/277358

Jdlrobson updated the task description. (Show Details)Mar 14 2016, 9:44 PM
Jdlrobson removed Jdlrobson as the assignee of this task.Mar 23 2016, 4:22 PM
Jdlrobson updated the task description. (Show Details)Mar 24 2016, 8:17 PM
Volker_E removed a subscriber: Volker_E.Apr 11 2016, 9:35 PM
Jdlrobson moved this task from 2015-16 Q4 to 2016-17 Q1 on the Reading-Web-Planning board.
Krinkle removed a subscriber: Krinkle.Apr 16 2016, 1:24 AM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 19 2016, 9:56 PM
Jdlrobson updated the task description. (Show Details)May 9 2016, 4:32 PM

Change 277358 had a related patch set uploaded (by Jdlrobson):
Special Mobile Cite page and PHPUnit tests

https://gerrit.wikimedia.org/r/277358

Jdlrobson claimed this task.May 9 2016, 5:56 PM

@phuedx and @Jhernandez could you take a look? Thanks!

Looks good to me, I've QAd and all, but I can't merge because I've had to make a change to the patch to make it work, so somebody else should have a look.

I'd like to see a browser test added for this though, either as a followup patch or in this same one. At the very least a blocking task for rolling lazy references to stable if it is not browser tested on the happy path.

Looks good to me, I've QAd and all, but I can't merge because I've had to make a change to the patch to make it work, so somebody else should have a look.
I'd like to see a browser test added for this though, either as a followup patch or in this same one. At the very least a blocking task for rolling lazy references to stable if it is not browser tested on the happy path.

There's been a browser test follow up for a few days now but as I've said [[ https://gerrit.wikimedia.org/r/288441 | on the patchset ]]it gives us minimal protection due to the fact Chrome webdriver doesn't allow you to spoof user agent.

Change 277358 merged by jenkins-bot:
Special Mobile Cite page and PHPUnit tests

https://gerrit.wikimedia.org/r/277358

Jdlrobson added a comment.EditedMay 17 2016, 6:58 PM

I've setup T135539 and T135542 (I've pulled the latter in as a blocker for sign off)
You can see this in action on http://en.m.wikipedia.beta.wmflabs.org/wiki/Barack_Obama

Jdlrobson closed this task as Resolved.May 18 2016, 2:29 PM
Jdlrobson claimed this task.

Given wgMFAllowNonJavaScriptEditing is false on production I'm happy to remove the blocking task and close this.