Page MenuHomePhabricator

Flow should respect editor preference settings (i.e. visual editor vs wikitext)
Closed, ResolvedPublic

Description

On http://www.mediawiki.org my edit preference is set to 'Always give me the visual editor if possible', but when I go to post on a Flow board I am always given the wikitext editor first, even if I have just replied to a comment use VE.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Esanders the issue you reported seems to be some regression of T155665: Rich text mode should be the default in Flow replies . There is a long conversation in the ticket and a lot of test/use cases. There are still several edge cases that will save wikitext as a user preference. For example,

From my comment on the ticket:

[...] the act of typing sets the editor preference; the content changes do not need to be saved in order to reset the preference. e.g.

A user switches to wikitext editor
Types something in wikitext
The user decides not to save it and hits 'Cancel'. The preference editor will be set to wikitext anyway.
Or a user starts a new topic, changes the editor, types only the topic title and then hits 'Cancel'. The editor choice will be preserved.

However, I checked the following and VE seems to be the preferred option (as per the fix in T155665: Rich text mode should be the default in Flow replies ).

when I go to post on a Flow board I am always given the wikitext editor first, even if I have just replied to a comment use VE.

Maybe there are some details that I am missing - e.g. opening a topic in a different tab/window/browser or something else I should do to reproduce the issue?

This comment was removed by Esanders.

Looks like the preference is set, but only after the editor is typed in to.

Change 394405 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Flow@master] Respect "Always use VE" and "Always use source editor" preferences

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

My attached patch does this (dependent on my larger Flow editor rewrite patch), but it keeps separate hidden preferences to track the last editor between VE and Flow. Do people think this makes sense, or should Flow use and update VE's preference?

To clarify, the current behavior in VE is that when "remember last editor" is chosen, VE remembers which editor the user opened most recently and starts with that one. The current behavior in Flow is that it remembers which editor the user typed into(*) most recently, and starts with that one. Right now these are separate, so changing your remembered editor for page editing doesn't change it for Flow and vice versa. Should I change this too, so that there is only one remembered editor that gets updated regardless of whether you switched in Flow or in VE? Or do people think it makes sense to remember it separately between the two?

(*) This distinction exists because we encourage wikitext users to switch to VE as a preview, and if they do that and don't switch back before saving, we don't want to give them VE next time.

I think that the behaviour you describe as the current version of your patch is fine.

I think that the behaviour you describe as the current version of your patch is fine.

Me too.

In the ticket, you wrote:

If the user's preference is "show me both tabs", there's no good way to do that in Flow, so we treat that the same as "remember last editor

It is already the case: people can use the switch button available. We are good.

This (and the underlying Flow NWE rewrite commit) is now ready for review.

Change 394405 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Respect "Always use VE" and "Always use source editor" preferences

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

@Catrope There is a change in the UI after switch to wikitext editing - is it intentional?

current betalabs - no clear indication in which editor I am now.

Screen Shot 2017-12-21 at 3.42.55 PM.png (285×795 px, 35 KB)

wmf.12

Screen Shot 2017-12-21 at 3.41.44 PM.png (444×789 px, 54 KB)

The option 'Always give me the visual editor if possible' will make VE as the preferable editor on both article and SD pages.

Btw, it feels a little limiting that I cannot re-visit that popup with four choices. Yes, I have choice when editing to switch between VE and wikitext editor, but to change to another of four options on popup I need to Restore all default settings (in all sections) which is an extreme measure.

Note: when Restore all default settings (in all sections) is clicked

+---------+-----------+---------------------+
| up_user | user_name | up_property         |
+---------+-----------+---------------------+
|    7059 | ET26      | enotifusertalkpages |
|    7059 | ET26      | visualeditor-enable |
+---------+-----------+---------------------+

Then user ET26 selects 'Always give me the visual editor if possible':

+---------+-----------+------------------------------+
| up_user | user_name | up_property                  |
+---------+-----------+------------------------------+
|    7059 | ET26      | enotifusertalkpages          |
|    7059 | ET26      | visualeditor-enable          |
|    7059 | ET26      | visualeditor-hidebetawelcome |
|    7059 | ET26      | visualeditor-hidetabdialog   |
|    7059 | ET26      | visualeditor-tabs            |
+---------+-----------+------------------------------+

If a user selects the default 'User the editor I used in my last edit' and make a different choice for SD editor (the wikitext editor), the flow editor selection will be added:

+---------+-----------+------------------------------+
| up_user | user_name | up_property                  |
+---------+-----------+------------------------------+
|    7059 | ET26      | enotifusertalkpages          |
|    7059 | ET26      | flow-editor                  |
|    7059 | ET26      | visualeditor-editor          |
|    7059 | ET26      | visualeditor-enable          |
|    7059 | ET26      | visualeditor-hidebetawelcome |
|    7059 | ET26      | visualeditor-hidetabdialog   |
+---------+-----------+------------------------------+

@Catrope There is a change in the UI after switch to wikitext editing - is it intentional?

Yes, that is part of T155861: Migrate Flow to use the integrated VE/WT editor widget when it exists

Btw, it feels a little limiting that I cannot re-visit that popup with four choices. Yes, I have choice when editing to switch between VE and wikitext editor, but to change to another of four options on popup I need to Restore all default settings (in all sections) which is an extreme measure.

I don't understand what you mean. What popup are you talking about? Can't you switch between the four options in the dropdown by just going to the "Editing" tab on the preferences page?

Btw, it feels a little limiting that I cannot re-visit that popup with four choices. Yes, I have choice when editing to switch between VE and wikitext editor, but to change to another of four options on popup I need to Restore all default settings (in all sections) which is an extreme measure.

I don't understand what you mean. What popup are you talking about? Can't you switch between the four options in the dropdown by just going to the "Editing" tab on the preferences page?

I meant this popup:

Screen Shot 2017-12-22 at 2.17.19 PM.png (422×601 px, 51 KB)

And yes, you're right - the changes in preferred editor can be made in Preferences-Editing.

@Catrope There is a change in the UI after switch to wikitext editing - is it intentional?

Yes, that is part of T155861: Migrate Flow to use the integrated VE/WT editor widget when it exists

So. it's the final design? And it will be deployed?

That change is important enough to get the user-notice tag. However, I advise to have T183382: Have a way to switch back from preview mode to wikitext mode in Structured discussions done before the announce.