Story
Allow page previews to appear on wikidata containing the description of each item
Mocks
Requirements
General
Individual previews will be available for the following:
- Items
- Properties
- Lexemes
Items - previews for items will contain:
- Description (if available)
- Label (with language fallback) (if available)
- Number of statements
- Number of sitelinks
- Image (if available)
Properties - previews for properties will contain:
- Description (if available)
- Label (with language fallback) (if available)
- Number of statements
- Image (if available)
Lexemes - previews for lexemes will contain:
- language, lexical category
- lemma
- Number of statements
- number of forms
- number of senses
- Image (if available)
Language
Previews must appear in the user’s interface language
- If the users language is not available for the requested preview, previews will fallback to an available language according to MediaWiki fallback chain
- The name of the language the fallback appears in must be displayed on the page in the user’s interface language
Generic previews
- If a description is not available for a given preview, a generic preview will appear informing the user that the item does not have a description (copy TBD, something like “there is no description for this item/property/lexeme”)
- If a description is not available but the page has image, the image will appear along with the generic message
- If a label is not available for a given preview, a generic preview will appear informing the user that the item does not have a description (copy TBD, something like “there is no description for this item/property/lexeme”)
- If a label is not available but the page has an image, the image will appear along with the generic message
Acceptance Criteria
- Update the summary endpoint to construct the Wikidata specific summary according to the requirements outlined above (https://gerrit.wikimedia.org/r/#/c/mediawiki/services/mobileapps/+/434193)
- Update config on beta cluster.
- On wikidata beta cluster: Update wikidata configuration to have Popups enabled and use REST (https://wikidata.beta.wmflabs.org/api/rest_v1/page/summary/Q81566 should return a summary and that should display when hovering over Earth on https://wikidata.beta.wmflabs.org/wiki/Q465933)
- Page Previews will be on by default for all logged-in and logged-out users
Post configuration
When consumed we should check:
- for pages that do not contain a description, the generic card must not display
- If a page has no description and no image, the generic card will display
- Enabled for everyone
- Logged-in users may turn off descriptions within their user preferences
Note: Further tweaks may be needed by the client/endpoint to deal with Wikidata specific edge cases (E.g. articles with no descriptions) and to ensure that the right language is loaded. Long term we'll probably want to add a 'type' 'wikidata' to https://www.mediawiki.org/wiki/Page_Previews/API_Specification rather than lean on the 'standard' type.