Page MenuHomePhabricator

Android - Disable editing of article description if it's locally-sourced.
Closed, ResolvedPublic

Description

Background

As a first step towards fulfilling T191027, we should disable editing the article description if we detect that the description came from the local article instead of Wikidata. This will be a stopgap measure to avoid confusion for users who might edit the description (using our current workflow, which sends the edit to Wikidata), but then notice that their edit isn't being reflected in the article.

This will depend on the Page Content Service implementing the descriptionsource parameter in the mobile-sections-lead endpoint, similarly to how it's currently implemented in the MW API as part of the prop=description request.

Steps to QA

SCENARIO A. View and edit an article with a description that is locally sourced

Note: An article is using a locally-sourced title description (instead of from wikidata) when the template {{short description}} is in the lead section of the article (visible in wikitext edit mode).

  1. Open an article using a locally-sourced title description, e.g., Wagon Train
  2. Tap on the edit pencil icon in the lead section of the article. It is expected this will open the view to edit the lead section of the article, which contains the {{short description}} template.
  3. Edit the short description (suggest a minor grammatical corrections, such as Western television series that aired 1957-1965)
  4. Complete preview and publish of the minor edit. It is expected that the title description should be updated
SCENARIO B. Edit an article with no title description, then override with locally-sourced description
NOTE: Adding *new* descriptions from wikidata in en.wiki will still be embargoed in the Production version of the mobile app, so the first 2 steps of the following scenario are only testable in the Alpha builds.
  1. Find an article on EN.wiki which does not yet contain a title description. To help find articles, try inputing a generic search term (e.g., Cake, station, esplanade, creek) and selecting a search result which does not yet have a description. For example, open "Madeira cake"). It is expected the article will contain an action to "Add title description".
  2. Tap to add a title description, for e.g. type of cake, and tap the checkmark on the top right of the toolbar to publish. It is expected the article will refresh with the title description updated to the text entered in the previous step.
  3. Tap on the first edit pencil. It is expected that a menu will appear with an option to "Edit title description" and "Edit introduction".
  4. Select "Edit introduction" and add the '{{short description}} template to override the title description with a local description. For example, add to the very top of the Madeira cake article introduction: {{ short description|type of sponge cake}} and proceed to finish publishing. It is expected that the title description under the article title will now show this new locally sourced description.
  5. Once again, tap on the first edit pencil icon on the article. It is expected that this will now immediately open the article to editing the introduction section.
  6. Remove the {{short description}] added in step 4 and publish the edit. It is expected the article's title description will revert to using the description entered in step 2 (from wikidata).

Event Timeline

LGoto renamed this task from Disable editing of article description if it's locally-sourced. to Android - Disable editing of article description if it's locally-sourced..Apr 23 2018, 7:16 PM

The new field is called description_source. If it is present then you can see if the description was provided by the local (Wikipedia) wiki or by the central (Wikidata) wiki.
I think you want to disable editing if it's not from the central wiki or the value was not found (since the page had not been updated since T191869 was deployed.

You can test with https://en.wikipedia.org/api/rest_v1/page/mobile-sections-lead/Wagon_Train.

Thanks, @bearND! This is now ready to proceed.

Change 422478 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Respect the new description_source parameter returned by the API.

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

Change 422478 merged by jenkins-bot:
[apps/android/wikipedia@master] Respect the new description_source parameter returned by the API.

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

hi @Dbrant - I was in the midst of writing the QA steps for this and noticed that the flow to add title descriptions is now broken for articles that do not yet have a title description across all languages.

Steps

Go to an article without a title description, eg Flødebolle on Danish Wikipedia.

Expected: there is a CTA to "Add title description" under the article title
image.png (1×1 px, 1 MB)
Actual:
image.png (1×1 px, 1 MB)

@Dbrant - A second unexpected thing is that articles with wikidata descriptions are no longer able to be edited.

Steps
  1. Go to an article with a wikidata title description, eg Blegdamsvej on Danish Wikipedia.
  2. Tap on the edit icon in the lead section
Expected

There is an option to "Edit title description" and if selected, the user may edit the title description.

image.png (1×1 px, 1 MB)

Actual

There is no option to edit the title description, instead the lead section to edit immediately opens (even though there is no magic word template on this article)

image.png (1×1 px, 1 MB)

Getting this and the previous error in v2.7.232-alpha-2018-05-17

Change 433608 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Whoops: more correct check for local-ness of article descriptions.

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

Change 433608 merged by jenkins-bot:
[apps/android/wikipedia@master] Whoops: more correct check for local-ness of article descriptions.

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

Awesome, thanks @Dbrant, just tested new build with the above QA steps and LGTM now! Moving to QA...

hi @ABorbaWMF - Would be great if you can prioritize testing of this ticket. Thanks!

Works for me on 2.7.232-alpha-2018-05-18

Tested on a few devices and edited a few articles using the scenarios above.

hi @DannyH - this is now in the Wikipedia Alpha build, and we're planning to deploy to the Wikipedia Beta app in the Play store around end of May. Please let us know if there is anything that needs to be done prior to this occurring.

@RHo This looks good to me. Thank you for working on this!