Page MenuHomePhabricator

VisualEditor: Provide a way for interface messages, edit notices, etc to display different content to Visual and Source editors
Open, NormalPublic


en.wp user Andrew Gray notes that on creating a page in VE he is given several alternatives to writing a new article, one of which is to search for an existing page to redirect the title to. He asks whether this should be offered to VE users while it does not support redirects.

However, the message is provided by [[MediaWiki:Newarticletext]] and the text is served identically in the source and visual editors. There is no current mechanism to detect in which editor it is being displayed so different content cannot be provided.

There will be occasions where such messages and also edit notices are only relevant to either source or visual editor users or are differently relevant. In other cases the different display formats (e.g. generally horizontal in source, generally vertical in visual) may lead to different presentation choices for optimum impact.

As it is not inconceivable that there will in future be other editors (developed by WMF or others) there should be some way for the editor to uniquely declare itself to such messages and for them to be able to determine what they do if they don't recognise the response. Sort of a:
IF editor="VisualEditor" THEN do X ELSE do Y

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:48 AM
bzimport set Reference to bz52471.
Thryduulf created this task.Aug 2 2013, 6:48 PM

One possible way to do this is using a different interface message for VE in such cases. MediaWiki:Newarticletext-VE for example.

This looks apparently more simple to do than creating yet another programming language to control such logic on the message itself ;)

Yes, that does sound far simpler to implement! More difficult to keep the two in synch, but I suppose you can't have everything.

I don't think there should be a control for separate interface messages.

However either way, meanwhile a workaround is to use a CSS selector (.ve-available or .ve-not-available) to hide or display certain pieces.

Stryn added a subscriber: Stryn.Aug 29 2015, 6:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 29 2015, 6:03 PM