Page MenuHomePhabricator

Add a link: link inspector should show article extract, not article description
Closed, ResolvedPublic

Description

Per T269644, the expected text below the article title should be the article extract (first sentences of the article), and not the article description (either local short descriptions or from Wikidata). In both cswiki and viwiki (and likely beyond), we are seeing only the article descriptions.

Expected:
image.png (386×483 px, 56 KB)
Actual
image.png (558×916 px, 113 KB)

Event Timeline

MMiller_WMF renamed this task from Add a link: Link inspector should show the first part of the article (its extract) instead of its wikidata description to Add a link: link inspector should show article extract, not article description.Jul 28 2021, 9:12 PM
MMiller_WMF updated the task description. (Show Details)
MMiller_WMF added subscribers: Etonkovidova, Tgr, kostajh and 2 others.
MMiller_WMF subscribed.

@mewoph @DMburugu @kostajh @Tgr -- this is a piece of "add a link" that we thought was working correctly, and we think it will make a big difference. We would like to prioritize this fix as soon as we can, including a backport for it!

The short description presence (or absence) varies per wiki - only about 40% of recommended links articles on cswiki have a short description (bnwiki ~60%, arwiki ~90%).

Currently the link preview is generated via ve.ui.MWInternalLinkContextItem.static.generateBody which uses page description.

Change 708602 had a related patch set uploaded (by MewOphaswongse; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@master] Add a link: Show article extract instead of description in the link inspector

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

Desktop w/latest changes:

Screen Shot 2021-07-28 at 3.38.50 PM.png (648×914 px, 148 KB)

Mobile w/latest changes:

Screen Shot 2021-07-28 at 3.39.44 PM.png (464×576 px, 75 KB)

Change 708848 had a related patch set uploaded (by Gergő Tisza; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@wmf/1.37.0-wmf.16] Add a link: Show article extract instead of description in the link inspector

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

Change 708602 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add a link: Show article extract instead of description in the link inspector

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

Change 708848 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.37.0-wmf.16] Add a link: Show article extract instead of description in the link inspector

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

I was careless with the testing and only caught this issue during backporting (which was aborted): when you display a recommendation for the first time, both the extract and the description are shown. (If you skip it and return it will look OK.)

1.png (242×400 px, 26 KB)
2.png (259×400 px, 22 KB)

Maybe the description is loaded asynchronously so the code checking for its existence runs too early?

Thanks @Tgr — you're right, it's added asynchronously (I don't have Wikibase set up locally so I faked it so it was always returned before the extract).

		linkCache.get( title ).then( function ( linkData ) {
			if ( usePageImages ) {
				if ( linkData.imageUrl ) {
					icon.$element
						.addClass( 've-ui-mwInternalLinkContextItem-hasImage' )
						.css( 'background-image', 'url(' + linkData.imageUrl + ')' );
				} else {
					icon.setIcon( ve.init.platform.linkCache.constructor.static.getIconForLink( linkData ) );
				}
			}
			if ( usePageDescriptions && linkData.description ) {
				$description = $( '<span>' )
					.addClass( 've-ui-mwInternalLinkContextItem-description' )
					.text( linkData.description );
				$wrapper.append( $description );
				// Multiline descriptions may make the context bigger (T183650)
				context.updateDimensions();
			}
		} );

Change 709086 had a related patch set uploaded (by MewOphaswongse; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@master] Add a link: Hide ve-ui-mwInternalLinkContextItem-description

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

I don't have Wikibase set up locally

Yeah, same here. I wish we could somehow make T282170: Move "Short Descriptions" feature outside of main Wikibase.git code happen - a lot of teams are using descriptions now and it has definitely become a testing pain point. Maybe a topic for the retro.

Change 709086 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add a link: Hide ve-ui-mwInternalLinkContextItem-description

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

Change 709256 had a related patch set uploaded (by Gergő Tisza; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@wmf/1.37.0-wmf.16] Add a link: Show article extract instead of description in the link inspector

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

Change 709256 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.37.0-wmf.16] Add a link: Show article extract instead of description in the link inspector

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

Mentioned in SAL (#wikimedia-operations) [2021-08-02T18:30:39Z] <urbanecm@deploy1002> Synchronized php-1.37.0-wmf.16/extensions/GrowthExperiments/extension.json: 05cf1d6de1695d2e38531f3fecb26381f4dc0b1d: Add a link: Show article extract instead of description in the link inspector (T287636; 1/2) (duration: 00m 57s)

Mentioned in SAL (#wikimedia-operations) [2021-08-02T18:31:55Z] <urbanecm@deploy1002> Synchronized php-1.37.0-wmf.16/extensions/GrowthExperiments/modules/: 05cf1d6de1695d2e38531f3fecb26381f4dc0b1d: Add a link: Show article extract instead of description in the link inspector (T287636; 2/2) (duration: 00m 56s)