Page MenuHomePhabricator

WWT: Spike: Investigate an experimental gadget for WWT
Closed, DeclinedPublicSpike

Description

As a WWT user, I want a WWT gadget to be investigated and possibly implemented in an experimental capacity, so that potential risks and plans related to such work can be identified.

Background: In T242918, we investigated the various options for expanding accessibility of WWT. While we concluded that many accessibility requests are largely in the hands of the WikiWho team (such as expanding support for wikis/languages), we may be able to expand accessibility by making the tool a gadget. The purpose of this ticket is to more deeply investigate the conversion to a gadget -- and, if possible, to develop an experimental gadget. The development of an experimental gadget will help us identify some of the challenges associated with such work, both from an engineering and QA perspective (i.e., will it be laden with new issues & bugs?).

Acceptance Criteria:

  • Review the findings in T242918, as related to the development of a WWT gadget
  • Investigate the possibility of converting WWT from a browser extension into a Mediawiki gadget in greater depth, which would be available to all users of English, German, Basque, Turkish, or Spanish Wikipedia.
  • If possible, develop an experimental gadget (usable by the team for testing purposes)
  • Document and share findings with team

Checklist for the experiment

  • Add a build step for the gadget. Take into account language blob construction.
  • Add header comments post-bulid to make it clear on-wiki
  • Automate deployment
  • Verify: Make sure the gadget does not load itself unless it is on valid wikis list
  • Fix welcome tour storage to work with localstorage instead of storage.sync.
  • Bring back the indication (in console log) of the source 'gadget' vs 'browser extension'
  • Test on IE11 / Safari / etc

Event Timeline

ifried updated the task description. (Show Details)
ifried updated the task description. (Show Details)
ifried updated the task description. (Show Details)
MusikAnimal subscribed.

(mostly copied/pasted from my findings at T242918#5824735):

We were generating a gadget variant before, and it seemed to work, so I think there's no immediate technical barrier to restoring it.

The system could mimic MoreMenu or HotCat, where the code lives in one place on Meta and the applicable wikis will import it into their local gadget. Translations live as separate JS files, and the appropriate one is loaded based on user's interface language, falling back to English. In the Grunt build step for the gadget, we'd generate these JS files from the JSON similar to what we're doing now. We can use a simple Node script to sync the files with the wiki.

Possible issues:

  • The gadget could in theory be forked and the "global" version maintained by us isn't what is seen on the relevant wiki, but I don't think we have any way to prevent this, nor should we worry about it. Other long-standing gadgets use this same system without issue. What usually seems to happen is someone will look at say English Wikipedia's gadget (or wherever they discovered the gadget) and copy it to their wiki. In this case the code would be something like mw.loader.load('https://meta.wikimedia.org/w/load.php?modules=ext.gadget.WhoWroteThat');, so they would have actually done it correctly (though of course it may not work for their language).
  • The code that lives on-wiki will be the transpiled version of the ES6+ code, meaning it might be hard to read. I don't think this is a huge risk either, since we can write in the comments to refer to the original source code for reviewing and proposing changes (this is what is done for MoreMenu).
  • Requires manual deployment, but this should be much more simple than deploying the browser extension.
  • Code-wise, there are just a few things we need to fix that don't work in IE 11, if we care to fix them. Safari might have some problems as well. I don't think we need to spend considerable time on browser support, as long as we're clear in the documentation on what browsers we've tested.
  • Translations may be made on-wiki when they should happen on translatewiki. For this, I recommend adding a comment in the source, "Please use translatewiki to add translations: https://translatewiki.net/wiki/Special:MessageGroupStats/whowrotethat ". You can use babel-plugin-add-header-comment in our build step to automatically put commentary at the top of every file (or specific files).

If possible, develop an experimental gadget (usable by the team for testing purposes)

We came up with this checklist for what will be involved. I've added this to the task description.

MusikAnimal updated the task description. (Show Details)
Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptFeb 13 2020, 6:43 PM

Why not make it into a MediaWiki extension? The scale of it means that it's a bit awkward as a gadget, but as a MediaWiki extension it should be pretty straightforward.

An extension would be awesome! The API Platform part should come first, though, I imagine. We shouldn't have more things depend on Cloud Services in production, methinks.

The task description is very outdated, if it wasn't obvious. We now support 45+ languages.

I think we can decline this. If anyone wants to create a new task for an extension, I'll be ready to award a token :)