Page MenuHomePhabricator

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

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

Niharika created this task.May 7 2018, 5:43 PM
Restricted Application added projects: VisualEditor, Community-Tech. · View Herald TranscriptMay 7 2018, 5:43 PM
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).

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

Deskana added a subscriber: Deskana.May 8 2018, 6:45 PM

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 added a subscriber: Liuxinyu970226.

per author, not just certain browser only bug

matmarex claimed this task.May 14 2018, 4:32 PM
matmarex edited projects, added VisualEditor (Current work); removed VisualEditor.
matmarex added a subscriber: matmarex.

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 Normal 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 Normal 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 Normal.
Anon126 updated the task description. (Show Details)
Anon126 added subscribers: gerritbot, Aklapper.
Robby added a subscriber: Robby.Jul 20 2018, 8:44 AM
Robby awarded a token.Jul 20 2018, 8:50 AM

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

VENWE
Before
After

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

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

Niridya closed this task as Resolved.Mar 21 2019, 8:57 PM

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

Ryasmeen edited projects, added Verified; removed Editing QA.Mar 21 2019, 9:13 PM
Ryasmeen moved this task from QA to Product owner review on the VisualEditor (Current work) board.