Page MenuHomePhabricator

Add a link: generate HTML for link preview (cleanup)
Closed, ResolvedPublic


Currently the HTML for the link preview (article image, link and description) are from ve.ui.MWInternalLinkContextItem.static.generateBody with a few styling overrides and a hacky override of ve.init.platform.linkCache.constructor.static.getIconForLink. With T287636: Add a link: link inspector should show article extract, not article description, an additional override is added to hide the default article description (in order to show the article extract).

Since we're overriding a few things from VE, it makes more sense to generate the HTML ourselves and use VE's built-in methods where appropriate (ve.init.platform.linkCache.styleElement, ve.init.platform.linkCache.get etc).

Event Timeline

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

[mediawiki/extensions/GrowthExperiments@master] Add a link: generate link preview HTML

@Etonkovidova FYI the changes for this also include changing how the calculation for whether Yes/No buttons should overflow and fixing this edge case on desktop that @Tgr identified (When selecting No causes the buttons to overflow, the next suggestion's buttons remain overflown when they don't have to be).

dt_nav_issue.gif (706×868 px, 1 MB)

Change 709807 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add a link: generate link preview HTML