Page MenuHomePhabricator

Investigation: CodeMirror + New WikiText Editor syncing issues
Closed, ResolvedPublic

Description

There is a hacked version of CodeMirror + New WikiText Editor here: https://gerrit.wikimedia.org/r/#/c/343878/

This version works by loading CodeMirror underneath the WikiText editor surface, making the text and background of the WikiText editor transparent, and syncing user input from the WikiText editor to the CodeMirror surface as it is entered.

One potential issues with this approach is properly syncing between the 2 surfaces: "While it is possible to get the font sizes, widths and line-heights to match up perfectly in my clean test environment, a single half-pixel error could change the text flow, and result in a catastrophic model/view sync issue - where the user thinks they are typing into one part of the document, but are actually in another. This would be incredibly frustrating and possibly lead to document corruption." – Ed

Use the existing hack to explore this issue and see if it is something we should actually be worried about.

Event Timeline

If this does turn out to be a possible issue, we should see if there is a way that we could visually alert the user to cases where the syncing is off, for example, using semi-transparent text (in a separate task).

Let's see if we can get a QA person to handle this one.

Let's test this out after CodeMirror is deployed to Test Wikipedia.

Niharika claimed this task.
Niharika subscribed.

No complaints ever.