Page MenuHomePhabricator

Realtime Preview does not interact well with Syntax highlighter gadget
Open, MediumPublicBUG REPORT

Description

What is the problem?

With Realtime Preview and the Syntax highlighter gadget on, the wikitext pane does not resize correctly.

If you resize the whole editor, the wikitext pane remains the same size.

If you resize the wikitext pane on its own it can overflow the editor.

See the example screenshots below.

The Syntax highlighter gadget is enabled by default on Arabic Wikipedia (and possibly other RTL wikis, because CodeMirror does not work well in RTL).

Steps to reproduce problem
  1. Login and enable Realtime Preview on Arabic Wikipedia
  2. https://ar.wikipedia.org/w/index.php?title=%D8%B9%D8%A8%D8%AF_%D8%A7%D9%84%D8%AD%D9%85%D9%8A%D8%AF_%D8%A7%D9%84%D8%AB%D8%A7%D9%86%D9%8A&action=edit&editintro=%D9%82%D8%A7%D9%84%D8%A8:%D8%AA%D8%A8%D8%B5%D8%B1%D8%A9_%D9%85%D8%AD%D8%AA%D9%88%D9%89_%D9%85%D8%AA%D9%85%D9%8A%D8%B2
  3. Open Realtime Preview
  4. Resize the editor or wikitext pane

Expected behavior: wikitext pane remains the same height as the whole editor
Observed behavior: see screenshots

Environment

Browser: Firefox, Chromium
Wiki(s): https://ar.wikipedia.org MediaWiki 1.39.0-wmf.26 (38a120c) 00:50, 23 August 2022.
Editor WikiEditor 0.5.3 (42f2247) 06:24, 22 August 2022.

Screenshots

Resizing the whole editor:

syntax_highlighter_resize.png (843×1 px, 318 KB)

Resizing the wikitext pane:

syntax_highlighter_resize_2.png (836×1 px, 357 KB)

Event Timeline

JMcLeod_WMF subscribed.

There isn't anything CommTech can do to fix this at this time, but it should be resolved by the upcoming upgrade to CodeMirror.

Aklapper changed the task status from Open to Stalled.Sep 12 2022, 3:54 PM

Adding dependencies is welcome in such cases :)

The DotsSyntaxHighlighter gadget works even without WikiEditor being enabled, whereas CodeMirror requires it. How important is that? Because if we can't drop that requirement, then even upgrading CM isn't going to solve this.

I think the gadget needs to be modified to optionally handle resizing, similar to how CodeMirror does it.

I think the gadget needs to be modified to optionally handle resizing, similar to how CodeMirror does it.

Something along those lines. CodeMirror 6 definitely won't fix it, rather it just provides a different syntax highlighting system that does work with Realtime Preview (but that's already the case with CodeMirror 5).

@dom_walden are you still able to reproduce this issue, and does it only happen on RTL editors?

@dom_walden are you still able to reproduce this issue, and does it only happen on RTL editors?

The issue as described does not appear to happen anymore when I just tried it on arwiki beta and dewiki beta.

Resizing the whole editor also resizes the wikitext pane.

If you resize the wikitext pane independently, then it can overflow. It also means when you next resize the whole editor the wikitext pane does not resize. However, this bug also happens when you don't have realtime preview on, so I assume it is not RTP related.

JWheeler-WMF moved this task from Needs Discussion to CommTech Backlog on the Community-Tech board.

This is a small UX issue but something that can frustrate users. Text shouldn't overflow in the RTP when re-sizing an editing pane.