Page MenuHomePhabricator

CodeMirror and 2017 Wikitext editor combination produce invisible text in Category and File namespaces
Closed, ResolvedPublic

Assigned To
Authored By
Niharika
May 7 2018, 5:43 PM
Referenced Files
F26210139: image.png
Sep 26 2018, 11:27 AM
F26210130: image.png
Sep 26 2018, 11:27 AM
F26210141: image.png
Sep 26 2018, 11:27 AM
F26210134: image.png
Sep 26 2018, 11:27 AM
F18062138: Capture.PNG
May 7 2018, 9:12 PM
Tokens
"Love" token, awarded by Sebastian_Berlin-WMSE."Like" token, awarded by Robby."Piece of Eight" token, awarded by Liuxinyu970226."Piece of Eight" token, awarded by deryckchan.

Description

When one tries to edit a Category or File page using the 2017 Wikitext Editor with Syntax Highlighting turned on, the Wikitext turns invisible (white text on white background) once the page finishes loading.

This bug affects Category and File namespaces only, and affects most wikis and most browsers (see comments below for combinations that we've tried).


Reported here.

Screenshot: https://www.mediawiki.org/wiki/File:Syntax_highlighter_white_text.png

We've encountered similar bugs before but I can't find an exact same one.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I am able to reproduce. Just browse to Category:中國嘅鄰國 and hit Edit with 2017 editor and CodeMirror already enabled.

Interestingly, during the same editing session, if you turn syntax highlighting off and then back on the text will reappear. Also if you go directly to the page with action=edit all is fine.

Thanks @Niharika and @MusikAnimal.

I can confirm that I can reproduce the same error both (1) on a different Category: page on yue.wp; and (2) on a Category: page on en.wp (see attached screenshot), with a slightly different set-up (Chrome 65 on Win10).

Capture.PNG (590×794 px, 31 KB)

As far as I can tell, the bug affects Category: namespace only, and affects all wikis.

Is this only happening on specific pages, or all pages when you use both CodeMirror and 2017WTE in Firefox.

deryckchan renamed this task from CodeMirror and 2017 Wikitext editor combination produce invisible text on Firefox to CodeMirror and 2017 Wikitext editor combination produce invisible text in Category: namespace.May 9 2018, 9:50 AM
deryckchan updated the task description. (Show Details)

Is this only happening on specific pages, or all pages when you use both CodeMirror and 2017WTE in Firefox.

All Category pages on all wikis I've tried, whenever I use CodeMirror in 2017WTE.

Liuxinyu970226 subscribed.

per author, not just certain browser only bug

matmarex edited projects, added VisualEditor (Current work); removed VisualEditor.
matmarex subscribed.

I investigated today why this happens:

  • During VisualEditor's initialisation, <div id="mw-content-text"> is temporarily hidden while its contents are rearranged
  • On category pages, VisualEditor initialisation happens a bit differently so that the list of pages remains visible – in particular, the editing surface is inserted inside the <div id="mw-content-text"> rather than next to it (DesktopArticleTarget#getEditableContent)
  • When CodeEditor syntax-highlighting initializes (updateDisplayIfNeeded()), on category pages the editing surface is inside the hidden div, and so CodeEditor doesn't render it
  • Then the div is shown again and the incomplete syntax-highlighting editing surface appears (looks like invisible text)

I think a similar issue may occur on file pages too, where we initialise differently to keep the file thumbnail visible.

I'm not sure how to best fix this yet. We'll need to either remove/change the initialisation special case to avoid this, or force the syntax-highlighting to render manually.

JJMC89 renamed this task from CodeMirror and 2017 Wikitext editor combination produce invisible text in Category: namespace to CodeMirror and 2017 Wikitext editor combination produce invisible text in Category and File namespaces.May 17 2018, 4:04 PM
JJMC89 updated the task description. (Show Details)
JJMC89 added subscribers: Waddie96, Bencemac, Framawiki.
matmarex triaged this task as Medium priority.Jun 15 2018, 9:28 PM

Change 441509 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Remove special handling for category and file pages

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

Vvjjkkii renamed this task from CodeMirror and 2017 Wikitext editor combination produce invisible text in Category and File namespaces to jgdaaaaaaa.Jul 1 2018, 1:11 AM
Vvjjkkii removed matmarex as the assignee of this task.
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
Anon126 renamed this task from jgdaaaaaaa to CodeMirror and 2017 Wikitext editor combination produce invisible text in Category and File namespaces.Jul 1 2018, 4:43 AM
Anon126 assigned this task to matmarex.
Anon126 lowered the priority of this task from High to Medium.
Anon126 updated the task description. (Show Details)
Anon126 added subscribers: gerritbot, Aklapper.

Can you add screenshots showing the before/after of editing a file page in VE/VE source mode?

Change 441509 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Remove special handling for category and file pages

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

I changed the status to resolved because the bug is now fixed on Mediawiki version that is installed on Wikimedia's wikis.