Page MenuHomePhabricator

Leaving VE for another page doesn't trigger the exit confirmation
Closed, ResolvedPublicBUG REPORT

Description

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

  • Edit a page using the visual editor. Make some changes, but do not save
  • try to exit by clicking:
    1. The article tab on top
    2. The talk tab on top
    3. The read tab on top
    4. The history tab on top
    5. A link on the left menu

What happens?:
In 1 and 3, an exit confirmation window coming from VE is displayed.

In 2,4,5 the VE confirmation window is not shown, instead the browser confirmation is thrown depending on the setting "Warn me when I leave a page without saving the changes".

What should have happened instead?:

In all cases I would expect the same exit confirmation window to be shown.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc: any wiki, any browser.

Event Timeline

I think this has to be that on mobile (since the browser is Firefox for Android) it's not showing the browser-level confirm dialog. We might need to investigate whether this is being suppressed somehow.

Can also be reproduced on FF for Windows.

Hmm. In Firefox on mac I do see this:

image.png (430×922 px, 79 KB)

To rule out any personal configuration, does this happen if you launch firefox in safe mode?

Yep, also reproducible on ro.wp in safe mode (signed-in) and on Microsoft Edge (while signed-out).

Here is a video of what I see: https://youtu.be/0gmHOhC0174

On en.wp I also see the confirmation as in your screenshot, but I find it strange that you have the VE confirmation when exiting to the article (just like on ro.wp) and what looks like a browser confirmation for the rest - it still looks like these are separate code paths and it's unclear to me why.

OK, so I digged a bit, it seems when leaving the article (options 2,4,5 in the description) there is an option controlling the warning which in my case was not global. When exiting to the article itself, the VE warning is shown regardless of that setting. I believe the correct behavior is to always display the same confirmation window, which should be controlled by the user option. I updated the description accordingly.

ppelberg subscribed.

@Strainu we appreciate you reporting this; we agree with you in thinking that is suboptimal for the warnings that people see when attempting to leave a page without saving the changes they've made to be inconsistent.

Although, the Editing Team cannot currently prioritize the work required to make them so.

With the above said, can you clarify what "option" you were referring to in T294463#7475847?

@matmarex identified that there might be two issues at play here:

  1. The warnings that people see when attempting to leave a page without saving the changes they've made are inconsistent (this is the issue this ticket was created for)
  2. VE is showing exit warnings regardless of the state of the Warn me when I leave an edit page with unsaved changes setting within Special:Preferences.

@matmarex identified that there might be two issues at play here:

  1. The warnings that people see when attempting to leave a page without saving the changes they've made are inconsistent (this is the issue this ticket was created for)
  2. VE is showing exit warnings regardless of the state of the Warn me when I leave an edit page with unsaved changes setting within Special:Preferences.

I agree with that assessment and indeed, that's the name of the option I was referring to in English.

Change 773246 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Respect useeditwarning user option when tearing down target

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

  1. The warnings that people see when attempting to leave a page without saving the changes they've made are inconsistent (this is the issue this ticket was created for)

Warnings which are generated by javascript events that we can intercept (i.e. clicking on the read tab, pressing escape) will use the OOUI abandonedit dialog:

image.png (173×322 px, 15 KB)

There are ways that the user can navigate away from the page which don't trigger a javascript event (e.g. pressing reload, or clicking on a link in the sidebar which we haven't got a listener on). To catch these we have to use the onbeforeunload handler, which can only ever produce a system dialog with a fixed message. This is the best we can do in this situation:

image.png (153×465 px, 11 KB)

Change 773262 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/core@master] AbandonEditDialog: Document that users should check `useeditwarning`

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

Other users of the abandon edit dialog may want to consider if they want to respect this preference:

  • Mobile editor (preferences set on desktop often don't apply to mobile, so this might not be an issue)
  • GrowthExperiments StructuredTaskArticleTarget.prototype.confirmLeavingSuggestionsMode (cc @kostajh) - this is mostly used by new users who are unlikely to have this preference set, and so is unlikely a priority for that team.
  • DiscussionTools where we subclass this to the "Abandon comment dialog". Arguably composing a comment is different enough from "making and edit" that we don't need to respect this preference
  • StructuredDiscussions/Flow - same as above

Change 773246 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Respect useeditwarning user option when tearing down target

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

kostajh added a subscriber: Etonkovidova.

Adding to Growth-Team board for us to look at. @Etonkovidova could you please QA the steps from the task description for add link / add image workflows to see if there's something we should change?

Change 773262 merged by jenkins-bot:

[mediawiki/core@master] AbandonEditDialog: Document that users should check `useeditwarning`

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

Adding to Growth-Team board for us to look at. @Etonkovidova could you please QA the steps from the task description for add link / add image workflows to see if there's something we should change?

I've checked both - testwiki wnf.4 and betalabs with the fix above for Suggested tasks. To keep the GrowthExperiments results on the presence/absence of the warning message, I created QA task - https://phabricator.wikimedia.org/T304667 - where I collected the results. The changes (edits) are not recovered for Structured tasks and in some cases the Suggestions mode gets lots. I'll highlight these cases in the results table in 304667.

Structured Edits on Mobile - the abandon dialog will be displayed regardless of the setting "Warn me when I leave an edit page with unsaved changes" being On/Off.

Flow/Structured discussion behaves exactly (when edits are abandoned) as a normal article being edited with VE.

Here's the behaviour:

The article tab on topbrowser confirm dialog
The talk tab on topbrowser confirm dialog
The read tab on topbrowser confirm dialog
The history tab on topbrowser confirm dialog
A link on the left menubrowser confirm dialog
esc keyabandonedit dialog

See https://photos.app.goo.gl/p5hdQMHqzN59ZGvG6

Screenshot 2022-04-04 at 23.05.44.png (1×1 px, 90 KB)