Page MenuHomePhabricator

Can't switch editing modes in VisualEditor in the wishlist intake form
Open, HighPublicBUG REPORT

Description

What is the problem?

Switching editing modes in VE on the intake form (via the edit dropdown at the top-right of the editor) does not work sometimes.

Steps to reproduce problem

Setting your VE editing preference

  1. Make sure "Use the wikitext mode inside the visual editor, instead of a different wikitext editor" is set in Preferences > Editing
  2. Go to any normal page (not wishlist-related) and enter editing mode
  3. Use the dropdown at the top-right to change editors and set your VE editing mode preference

Reproducing the bug

  1. Go to https://wishlist-test.toolforge.org/wiki/Community_Wishlist/Intake
  2. Use the edit mode dropdown to try to change from visual to source or vice versa

Expected behavior:
It properly switches to the desired editor, preserving all content.

Observed behavior:

  • If your preferences have you starting with visual mode, you will not be able to switch to wikitext
  • If your preferences have you starting with source mode, you can switch to visual once, but will be unable to return to source mode
Notes

I worked with the Editing team on this for quite a while and had to stop. They suggesting using the ext.visualEditor.articleTarget module (or some class thereof), and dropping the registration of the mw.lib.ve.* tools as the articleTarget module does this for us. I attempted this and was not able to get it working. Slack conversation is at https://wikimedia.slack.com/archives/C010UHLBLBX/p1717185554997149 for those who can see it (sorry).

QA Results - Wishlist-test.toolforge

ACStatusDetails
1T368011#9947141

Details

Other Assignee
GMikesell-WMF
TitleReferenceAuthorSource BranchDest Branch
DescriptionField: fix ability to switch edit modesrepos/commtech/wishlist-intake!121musikanimalve-switchermain
Customize query in GitLab

Event Timeline

@MusikAnimal Please review the possible issues below, thanks!

Test Result - Wishlist-test.toolforge

Status: ✅ PASS
Environment: Wishlist-test.toolforge
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps
English
✅ WAD
2024-07-02_12-30-42.mp4.gif (628×994 px, 1 MB)
Arabic
❌ Why is it LTR on Visual, while RTL for Source?
2024-07-02_12-57-45.mp4.gif (616×1 px, 669 KB)
Insert Table
❌ Visual to Source back to Visual stayed in Wikitext
2024-07-02_13-12-17.mp4.gif (612×1 px, 845 KB)