Page MenuHomePhabricator

CodeMirror extension In Russian Wikisource breaks the edit field of pages
Open, Needs TriagePublic

Description

The CodeMirror extention In Russian Wikisource break the edit field of pages.
This enabled by button "syntax highlighting" of new edit toolbar. (The new edit panel globally replaced the previous one about 1-2 months ago, as I remember. There were no notes about it. Therefore, it was very shocking, after accidentally pressing a button, to encounter massive errors on all pages of the Wikisource. I think this extension should be packed as a gadget or beta-feature, like all similar ones.)

In namespace Page the edit field of proofreading pages is broken.
To example, this normal page.


After 1st pressing of the button the size of fonts are reduced to about half. In console has red error.

After 2nd pressingoff/on the size of fonts are restoring. On button appears borders as 'pressed' (1st pressed was not-pressed?).

If open a edit page after button is pressed. (open to edit, enable the button, close, open to edit.)
Then the edit field moved to top, and broken the layout of fields of scan image and colontituls.

After several clicks on button appears additional the normal edit field below. But above remains large edit fields.

Disabling work other gadgets. As I understand, it because gadgets works with the edit field in certain div in html. But this extention creating other edit field and show it in browser.
There is the gadget 'deyatifikator' that hard important for Russian Wikisource. RuWS specific is that almost all texts there are published before 1917 year, they in old orphography. So, necessery normal work of the gadget for convert texts to modern orphograhy.
Also, necessary work of other gadgets, e.g. Wikificator.

Broken syntax highlighting
To example, in Main namespace a page https://ru.wikisource.org/w/index.php?title=%D0%A0%D0%A1%D0%9A%D0%94/Graecia&action=edit
There the text is no more than two pages in size, but dont work syntax highlighting.
What about normal for Wikisource pages with size 0.5Mb, and to 1.5Mb?

All highlighting disappeared. Just opened edit page, scroll to bottom (highlighting here work only for 1st half page), placed one any letter in text bottom. Scroll to up. - And no any highlighting.

The extension page says that it have no conflict with gadget "SyntaxHighlighter" (from user settings, on bottom list of Edit section). But if enable it, then begin other bugs.
Compressed edit field, no way to expand it.
Appears if enable in user settings this gadget, open a page to edit, then again press the tab "Edit" (rus. "Править"), and press the button on/off. This glitch is not stable.

There are other glitch , they not stable. (Or maybe fixed yesteday, I dont now, the extention seems as a beta under developing.)
To example:
Perhaps, because conflict with mentioned gadget. So the edit page loading very long or freezes. And the browser tab overload 100% of CPU and make leaking memory.


All edit text shows as underlined and strange colored.
Or all text colored strange blue color, if change only one letter of any word then color of all text changing, if after change other letter then all text color changed again to other color, and so on.
In other time, a page to edit there is no syntax highlighting, or only template on top edit text is colored.

Wanted:
Perhaps it is better to move this to a gadget, so that those who wish can have the ability to enable/disable?
Many user can't work with such color theme, or be beta-testers. Also, it is big problem for wiki-enginers, to each time, when users report about any wiki bugs of templates or gadgets, wasting time checking for whether this is a error of the extention or something other.

Reproduce and settings:
This bugs starts If just enable this button of edit toolbar. Have on all edit pages of ru-Wikisource. User settings are by defaults, all betafeatures disabled, user scripts disabled. Theme is Monobook or Vector. The bug have in Chrome/Chromium and Firefox.
Did not any changes scripts or Meta settings in our ru-Wikisource. I found this problem yesterday.
Appears if login to Wikisource, but not edititng as anonim. Perhaps this problem no in other interwikies, e.g. I did not found it in Suomi Wikisource, however no any gadgets there.

The topic on ru-forum, where the presence of glitches also confirmed by the bureaucrat.

Event Timeline

Vladis13 created this task.Sep 8 2018, 11:03 PM
Restricted Application added a project: Community-Tech. · View Herald TranscriptSep 8 2018, 11:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

In the browser console is red error "Uncaught Error: Another textSelection API was already registered" with mention of the CodeMirror script.

Vladis13 updated the task description. (Show Details)Sep 8 2018, 11:19 PM
Vladis13 updated the task description. (Show Details)Sep 8 2018, 11:25 PM
Vladis13 renamed this task from In Wikisource the edit field of proofreading pages is broken. to In Wikisource the edit field of pages is broken..Sep 9 2018, 2:07 AM
Vladis13 updated the task description. (Show Details)
Vladis13 updated the task description. (Show Details)Sep 9 2018, 2:14 AM
Vladis13 updated the task description. (Show Details)Sep 9 2018, 3:53 AM
Aklapper changed the task status from Open to Stalled.Sep 9 2018, 7:39 AM

Please provide a list of steps to reproduce, step by step, that someone else could follow (including links to an example).
As you mention some "beta-gadget", what is it? Please provide required settings on https://ru.wikisource.org/wiki/Служебная:Настройки#mw-prefsection-betafeatures and https://ru.wikisource.org/wiki/Служебная:Настройки#mw-prefsection-gadgets to see the problem, so someone else could try to reproduce the situation.

See https://mediawiki.org/wiki/How_to_report_a_bug how to structure bug reports. Thanks!

Vladis13 updated the task description. (Show Details)Sep 9 2018, 6:02 PM

As term "beta-gadget" I meant that it's obvious that this is some kind of gadget in beta condition. I did not mean it in https://ru.wikisource.org/wiki/Служебная:Настройки#mw-prefsection-betafeatures.
But then it is not clear, why the beta gadget is released into the main space, without test notifications, and is not packaged as a "gadget" or "betafeatures"?

Vladis13 updated the task description. (Show Details)Sep 9 2018, 6:19 PM
JJMC89 added a subscriber: JJMC89.Sep 9 2018, 6:36 PM

You can toggle CodeMirror syntax highlighting using the highlighter icon on the toolbar above the edit field.

Is way to disable it via settings?
Now very hard to work. Each press of a button is like a merry-go-round of glitches, they are different each time. Or the button for turning off the highlighting does not work. Another time when press the text size is reduced by half.
When opening a page in the Page namespace and the button was enabled past time, the scan image is shown not on the right, but below the text, which is very inconvenient.
And if the browser will drop status the button?
The editor should always check whether a button is pressed on it or not?

Vladis13 updated the task description. (Show Details)Sep 9 2018, 7:51 PM
Vladis13 updated the task description. (Show Details)Sep 9 2018, 8:48 PM

As term "beta-gadget" I meant that it's obvious that this is some kind of gadget

@Vladis13: Gadgets are per-wiki settings and their code is on-wiki. If "obviously some kind of gadget" is enabled on your wiki or broken on your wiki then you need to contact admins on your wiki to fix the broken gadget code on your wiki.

Off-topic: When it comes to broken gadgets on your wiki,

Still needs a list of clear steps to reproduce the problem, including links. :( See T203897#4569643

Niharika added a subscriber: Niharika.

@Vladis13: Gadgets are per-wiki settings and their code is on-wiki. If "obviously some kind of gadget" is enabled on your wiki or broken on your wiki then you need to contact admins on your wiki to fix the broken gadget code on your wiki.

Well, then it is not gadget. :) Thanks @JJMC89 for T203897#4570067, now we know that it is ext. CodeMirror on the button in new edit toolbar. This new edit panel globally replaced the previous one about 1-2 months ago.

Off-topic: When it comes to broken gadgets on your wiki,

We checked them, they dont any affect CodeMirror, and these are innocuous errors. Thank you, we will try fix them after.

Still needs a list of clear steps to reproduce the problem, including links. :( See T203897#4569643

If just enable this button then starts the bugs. Have on all edit pages of ru-Wikisource. User settings are by defaults, all betafeatures disabled, user scripts disabled. Bug have in Chrome/Chromium, Firefox.
I will try rewrite the bugreport.

Vladis13 renamed this task from In Wikisource the edit field of pages is broken. to The CodeMirror extention In Russian Wikisource break the edit field of pages..Sep 11 2018, 1:19 AM
Vladis13 updated the task description. (Show Details)
Aklapper changed the task status from Stalled to Open.Sep 11 2018, 1:25 PM
TheDJ added a subscriber: TheDJ.Mar 20 2019, 10:12 AM

So

  1. the reduced font size is because of the 'font-family: monospace,monospace;' hack. .CodeMirror resets this to 'monospace'. This is a bug. I'll see about getting it fixed.
  2. "Then the edit field moved to top, and broken the layout of fields of scan image and colontituls". This is a race condition with the dynamically loaded proofread tools there is an issue about this somewhere
  3. "Disabling work other gadgets" Your gadgets need to implement the jQuery.textSelection api to read and modify the textarea, if you want them to keep in sync with other gadgets and syntaxhhighlight tools.
  4. "There the text is no more than two pages in size, but dont work syntax highlighting" that's because it is all ONE line. If you insert line breaks in some spots (before loading CodeMirror) then activate CodeMirror highlighting button, then it does work. This is not a bug, but a performance limit.
  5. "The extension page says that it have no conflict with gadget " gadgets are the responsibility of the local community. I would expect problems if you enable both and advice against doing so.
Aklapper renamed this task from The CodeMirror extention In Russian Wikisource break the edit field of pages. to CodeMirror extension In Russian Wikisource breaks the edit field of pages.Apr 14 2019, 12:37 AM