Page MenuHomePhabricator

VisualEditor: Show something other than a blank page when editing a redirect page
Closed, ResolvedPublic8 Estimated Story Points

Description

When you set a redirect in VisualEditor, it doesn't display anything, so it looks like it didn't work.

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:51 AM
bzimport set Reference to bz61861.

We should probably show the same as the MW-rendered redirect:

https://bits.wikimedia.org/static-1.23wmf14/skins/common/images/redirectltr.png

… or ideally a better system that doesn't use an image, and fix MW whilst we're at it.

This was mis-labelled; sorry for the confusion.

I spoke to Roan about what I would need to know to do this today. After some explanation we realised that this relies on meta items (e.g. redirects) having the possibility of being visible (at the moment they are just stripped from the model data so we don't know where they are). That is somewhere on his work list but he is not particularly close to starting it.

Also, I thought for a moment that since a valid redirect must be in a certain position (at the top of the document - if it's under something else then it's actually just a list element starting with 'redirect' and with a link to the target page), we could perhaps rely on that to make it visible. But I suspect that would be a pretty ugly solution.

When checking that I was right about the valid positioning of redirects, I found that Parsoid implements redirects wrong (or rather, differently to MediaWiki core's parser): it seems quite happy to accept a redirect that is anywhere in the document.

Created attachment 15753
In this case, I re-pointed a redirect, so it was displayed, and now it *looks like* changing it caused the redirect to be removed rather than changed.

Attached:

VisualEditor_not_showing_redirects_2014-06-26_at_10.34.25_AM.png (230×606 px, 49 KB)

Jdforrester-WMF lowered the priority of this task from High to Medium.Jan 15 2015, 12:21 AM
Jdforrester-WMF set Security to None.

When checking that I was right about the valid positioning of redirects, I found that Parsoid implements redirects wrong (or rather, differently to MediaWiki core's parser): it seems quite happy to accept a redirect that is anywhere in the document.

Reported as T88081

nshahquinn-wmf renamed this task from VisualEditor: Show something (other than a blank page) when editing a page with a redirect to VisualEditor: Show something other than a blank page when editing a redirect page.Sep 23 2015, 7:15 PM
nshahquinn-wmf updated the task description. (Show Details)

Note that in some cases redirects actually have some content, so are not necessarily blank.

Change 271701 had a related patch set uploaded (by Alex Monk):
Move redirects out of the meta list into actual nodes

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

As discussed on IRC there are two approaches: Make the redirect render as a node (the patch just submitted) or keep it in metadata and render a new control above the document.

Having it as a node gives us selection and delete for free, but there are no systems in place to make that node un-moveable, or un-copyable. Given that an unmovebale node can only ever be at the start or end of a document (by definition) I'm not sure we need to support that.

If all we need is a bit of rendering in the surface we can add a styled button above the document showing the redirect, and which launches the dialog.

Change 273391 had a related patch set uploaded (by Alex Monk):
Show redirect target inside target

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

Change 271701 abandoned by Alex Monk:
Move redirects out of the meta list into actual nodes

Reason:
Per Ed, in favour of a different commit

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

Change 273397 had a related patch set uploaded (by Alex Monk):
Make mediawiki.action.view.redirectPage available on mobile

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

Change 273397 merged by jenkins-bot:
Make mediawiki.action.view.redirectPage available on mobile

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

Change 273391 merged by jenkins-bot:
Show redirect target inside target

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