Page MenuHomePhabricator

Be able to switch to VisualEditor after starting to edit a section without losing edits
Closed, ResolvedPublic8 Estimated Story Points

Description

Steps to reproduce:

  1. Go to https://en.wikipedia.org/wiki/Foobar?action=edit&section=2 with your editor set to WikiText source editor
  2. Make an edit
  3. Try to switch to VisualEditor

Expected results: Editor is switched to VisualEditor with edit still intact.

Actual results: The user is given a dialog box asking if they want to switch and discard their changes.

Proposed solution: Take new section content, splice into base revision's wikitext using replaceSectionAtRev.

Event Timeline

Jdforrester-WMF raised the priority of this task from to Medium.
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.

This is a page-blanking bug.

Steps to reproduce:

  1. Click "Edit source" on a section in a long page.
  1. Switch to the visual editor.
  1. Notice that the entire rest of the page is missing in VisualEditor.
  1. Make your change and save the page.
  1. Notice that the entire rest of the page has been blanked now.
Elitre added a subscriber: Elitre.Nov 19 2015, 3:56 PM
Kipod added a subscriber: Kipod.EditedNov 24 2015, 1:22 AM

one way to solve this is to switch to VE all-page edit, incorporating the changes performed in wikieditor (i think this is what the original description of this ticket, "Take new section content, splice into base revision's wikitext using replaceSectionAtRev." means).

another approach, would be to teach VE to perform true section edit, which is what most editors expect when clicking the "edit" linkett next to section heading.

personally, i would vote for the second option. i vaguely remember several (many?) tickets requesting section edit.
the last bug ( T117713 ) demonstrate that VE is *capable* of doing a single-section edit. why not take advantage of this "accidental" discovery, and teach VE to do true section edit?
this will also close quite a few tickets ( T53903 and all it "see also's", at the least, and most probably quite a few more tickets ).

some work needs to be done, for sure, e.g., disable some controls in section-edit mode ("page options, prolly some others), but is is well worth it. section edit is something editors want and expect, and its absence is a major drawback for VE.

peace.

another approach, would be to teach VE to perform true section edit, which is what most editors expect when clicking the "edit" linkett next to section heading.

personally, i would vote for the second option. i vaguely remember several (many?) tickets requesting section edit

Patches welcome. Still.

Kipod added a comment.Nov 24 2015, 4:32 PM

another approach, would be to teach VE to perform true section edit, which is what most editors expect when clicking the "edit" linkett next to section heading.

personally, i would vote for the second option. i vaguely remember several (many?) tickets requesting section edit

Patches welcome. Still.

sorry, this is a bit above what i can do ATM.
however, this bug demonstrated *almost* the desired functionality.
before the bug fix was deployed, i performed several section edits (the first time, i did not realized it's a bug, and when i switched to VE from wikieditor section edit, i said to myself "kudos, VE team... it's a very welcome development". only after saving and noticing the damage did i realize it was unintentional. after the first time, i repeated it quite a few times, only omitting the "save").
all the "section edit" i did this way looked pretty good to me. i did not see a single problem with the editing or the resulting wikitext (i used "display changes" to examine the generated wikitext, and to verify the nuking of the rest of the page...)

there might be some behaviors of VE that implicitly rely on it always being "full page edit" (e.g., the "page options" menu). other than that, i believe the last bug demonstrated that this should be readily doable.

of course, the "save" logic needs to change. your original description ("Take new section content, splice into base revision's wikitext using replaceSectionAtRev.") outlines the way to do it.

peace.

AlexMonk-WMF edited subscribers, added: AlexMonk-WMF; removed: Krenair.Feb 23 2016, 3:40 AM

I can't reproduce this with the steps given in T117716#1794863. Is this task still valid?

I can't reproduce this with the steps given in T117716#1794863.

Yup. You need to go to something like https://en.wikipedia.org/wiki/Foobar?action=edit&section=2, make a change, and try to switch. It won't let you switch with changes.

Is this task still valid?

Yes. We want to be able to switch from section wikitext editing to visual editing and back.

kaldari renamed this task from Be able to switch editors after starting to edit a section to Be able to switch to VisualEditor after starting to edit a section without losing edits.Aug 15 2018, 8:10 AM
kaldari updated the task description. (Show Details)

Change 503651 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] WIP: section switch from wikitext to ve

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

Change 503670 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/MobileFrontend@master] Allow wikitext content to be passed to VisualEditor

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

Change 503670 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Allow wikitext content to be passed to VisualEditor

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

Change 503651 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Section switch from wikitext to VE

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

Change 510094 had a related patch set uploaded (by Jforrester; owner: Esanders):
[mediawiki/extensions/VisualEditor@wmf/1.34.0-wmf.4] Section switch from wikitext to VE

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

Change 510094 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@wmf/1.34.0-wmf.4] Section switch from wikitext to VE

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

Ryasmeen edited projects, added Verified; removed Patch-For-Review.May 23 2019, 8:51 PM
Ryasmeen moved this task from QA to Product owner review on the VisualEditor (Current work) board.
ppelberg closed this task as Resolved.May 27 2019, 3:00 PM