Page MenuHomePhabricator

Warn people about abandoning mobile topic and comment drafts
Closed, DeclinedPublic

Description

This task involves the work with showing people a warning of some kind when they are at risk of losing / discarding the comments and topics they are drafting with mobile DiscussionTools

Behavior

Meta

  • OS: iOS 15.5
  • Browser: Safari

Reproduction Steps

  1. Using the mobile site, visit a talk page on a wiki where the mobile Reply and New Topic Tools are available. E.g. https://ht.m.wikipedia.org/wiki/Diskisyon_Itilizat%C3%A8:PPelberg_(WMF) .
  2. Tap the Ajouter une discussion to open the New Topic Tool or a [ répondre ] link to open the Reply Tool
  3. Type some text into the tool you opened in "2."
  4. Tap a link that will take you to another page. E.g. the username of someone who has commented on the page.

Actual

  1. ❗️You are taken, without interruption, to the URL of the page linked within the link you tapped in "4."

Expected

  1. ✅ Upon tapping the link in "4." a message of some sort appears ask you to confirm that you'd like to navigate away from the page and lose the comment/topic you started drafting in "3."

Done

  • "Expected" behavior is implemented

Event Timeline

@Esanders: in what – if any – way(s) is this ticket related to T294463?

I can't reproduce this issue, I get a system dialog telling me that I will lose changed.

See https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event#browser_compatibility

"Safari on iOS" is the only one with no "activation" mechanism. Presumably Apple thinks this feature is abused too much on mobile.

when they are at risk of losing / discarding the comments and topics they are drafting

While not ideal, the auto-save feature should prevent them from losing their draft if they immediately navigate back.

matmarex subscribed.

Per above, this is not feasible to implement on iOS.

(On the bright side, when you navigate away on iOS Safari and then go back to the previous page, it will usually be shown instantly – the browser itself will restore it, rather than our autosave mechanism. Given this, I think it's not worth trying to find a way around it.)

ppelberg updated the task description. (Show Details)