[go: up one dir, main page]

Page MenuHomePhabricator

CodeEditor resize broken with realtimepreview layout
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

The code editor window is overflowing mw-body or even making edit form partially unusable (screens below).

(screen below)

What should have happened instead?:

The page should be resized with the editor. Also probably doesn't make sense to have a preview for code (at least if it is only JS or only CSS).

Compare with enwiki that don't have realtimepreview yet:
https://en.wikipedia.org/w/index.php?title=User:Nux/common.js&action=edit

(screen below)

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
1.39.0-wmf.8 (a4aaf3c)

Arrow shows problems with code overflowing mw-body.

obraz.png (1Γ—1 px, 186 KB)

And here you can see mw-body is resized with the editor normally without the preview.

obraz.png (1Γ—1 px, 112 KB)

This is much worse with edit controls. As they are over the edit field.

obraz.png (884Γ—1 px, 97 KB)

Event Timeline

Kind of a separate issue, but probably with the same root cause (layout problems).

  1. Vector 2022.
  2. Open JS editor.
  3. Resize your browser (!) window to half of the screen (so that editor is thinner then normal). You can do that by opening devtools.
  4. Resize the code editor with the editor resizer.
  5. Change browser window again (make it wider).

What happens?:

obraz.png (1Γ—1 px, 300 KB)

So as seems width becomes fixed and so the editor is broken. No way to change except by manually removing width:... from the ui-resizable element.

A similar problem occurs when you start with wide window, use editor resizer, make the window smaller. Only then code is clipped, and you won't be able to see all of it.

matmarex renamed this task from Editor resize broken with realtimepreview layout to CodeEditor resize broken with realtimepreview layout.May 12 2022, 2:16 AM
matmarex added a project: CodeEditor.

Since (realtime)Preview for edits of *.js/*.css doesn't have any use anyway (the js/css isn't executed/applied [or is it?]), I think that feature could be disabled in case of such files.

Realtime Preview is already only loaded for wikitext pages, but on plwiki it's loading for all content types because it's a gadget. This will be resolved once it's no longer a gadget (T303961 is tracking when that'll happen).

T204201 is the task for adding contentmodel-specific gadget loading, but we don't need to worry about that I think.

Change 804273 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Realtime preview: allow loading as a gadget

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

Change 804273 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Realtime preview: allow loading as a gadget

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