Page MenuHomePhabricator

Clicking a link in the reference inspector leaves the editor
Open, MediumPublic

Description

Section Translation editor uses Mobile Visual editor which provides contextual information for links and references using the inspector cards at the bottom. Those can contain links that currently try to open in the current browser tab leading to the alert message warning the user about losing the changes. That is, checking the links implies losing the translation.

Note that links in the editing surface are properly handled by the inspectors.

Screenshot 2022-01-21 at 11.51.29 2.png (502×460 px, 111 KB)

This ticket proposes to open such links on a new tab. That would allow users interested in checking them to do so without losing the translation.


Related: T274868: Clicking a link in the original panel leaves the editor

Event Timeline

Pginer-WMF renamed this task from Links for more context in Section Translation editor should open in a new tab/window to Clicking a link in the reference inspector leaves the editor.Jan 21 2022, 11:10 AM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF updated the task description. (Show Details)

You can fix this by using ve.targetLinksToNewWindow( … ); somewhere where the preview of the reference contents is generated.

It works in regular VE, we're using ve.ui.MWPreviewElement here: https://github.com/wikimedia/mediawiki-extensions-Cite/blob/f2c7ac46226d9631985bd014aa9ad548f5c24b77/modules/ve-cite/ve.ui.MWReferenceContextItem.js#L54, which calls that method here: https://github.com/wikimedia/VisualEditor/blob/e5963f084d90971bdc34284cc69212280187677b/src/ui/elements/ve.ui.PreviewElement.js#L83