Add an OnBeforeUnload prompt when message editor is still active

https://www.phpbb.com/ideas/
Post Reply
Author:
EA117
Posted:
Fri Nov 01, 2019 4:41 pm
Rating:
Status:
New
User avatar
EA117
Registered User
Posts: 1081
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Add an OnBeforeUnload prompt when message editor is still active

Post by EA117 » Fri Nov 01, 2019 4:41 pm

We've all seen scenarios such as this one, where for whatever reason it was not obvious that a message hadn't been posted yet, but the tab or browser was closed before realizing and being able to preserve the not-yet-committed message text. I've also done it simply when closing the wrong tab when working with multiple tabs open.

To mitigate this potential, phpBB should have an OnBeforeUnload-type handler that will catch when the current message entry or edit box hasn't been committed. And prompt the user with a "Are you sure you want to leave this page? Your current message will be lost."-type message, to alert them to the fact that message content is about to become abandoned.

It won't change the workflow for anyone who is successfully posting, but will give an extra step to anyone who is intentionally or unintentionally about to abandon an in-progress edit or an in-progress reply.

The scenario that benefits the most is that "Post Review" scenario, where in phpBB it "somewhat looks like" your post actually was accepted, and you're back to reading the thread again. But in reality its showing you the new posts created and your still-in-progress message editor is somewhere lower down on the page now. By adding a prompt, even though the user may not be able to see their in-progress edit area, they will be alerted to it when they try to leave the page.
  • Yes, it's been rejected before, on the basis that "I closed it because I know what I'm doing, please don't annoy me." The target audience here are people who don't know they were just sent to post review, or didn't intend to close the tab. Avoiding "unintentional data loss" is worth some effort. Make it configurable to opt-out from the UCP for people who find "prompts" are more annoying than "data loss". But default to helping prevent unintentional data loss.
  • Yes, if you knew to hit "Save as a draft" before the data loss, you would still have the message content in your draft. The target audience doesn't know they're about to lose their in-progress message, and won't know to save that draft for the same reason they don't know they're about to lose their data.
  • Yes, if the board was running an "automatically save drafts" extension, it might have saved the user's in-progress message at some point before it was lost. The user isn't in control of whether the phpBB board is running such an extension, but the user's time and effort is what will be lost when this situation happens.

User avatar
John connor
Registered User
Posts: 2312
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by John connor » Fri Nov 01, 2019 5:26 pm

Sounds like a prudent idea to me. Voted up.

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7663
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by JimA » Sun Nov 03, 2019 8:01 am

Agreed and upvoted.

Reading back the old RFC, what comes to mind to me is why you would care about one simple extra step of clicking away the warning message when it can be useful to other less attentive users. :)
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

User avatar
warmweer
Registered User
Posts: 3055
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by warmweer » Sun Nov 03, 2019 5:52 pm

JimA wrote:
Sun Nov 03, 2019 8:01 am
Agreed and upvoted.
Considering that it's a simple and small (codewise),I see no reason NOT to have this as a default feature.
The year is 2192. The British Prime Minister visits Brussels to ask for an extension of the Brexit deadline. No one remembers where this tradition originated, but every year it attracts many tourists from all over the world.

User avatar
3Di
Former Team Member
Posts: 14389
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by 3Di » Mon Nov 04, 2019 3:47 am

No. Quite boring I can say.

There are drafts on purpose, so simply adding an auto-save, as Google Mail does, that's the way to go if any.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
✒️ Black Friday 2019 @ The Studio ▪️◾️

User avatar
AmigoJack
Registered User
Posts: 5642
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by AmigoJack » Mon Nov 04, 2019 6:33 am

No: I click "quote" on posts to get the post content with all BBCodes to use it elsewhere (i.e. another topic I'm already replying in) - in such a workflow I neither encountered a preview, nor will the "other posts have been made" feature kick in. The confirmation dialog should be bound to that, not be there in general.

And provide a setting to let me turn it off - the software is there to help me, not to get in my way.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
EA117
Registered User
Posts: 1081
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by EA117 » Mon Nov 04, 2019 7:59 am

AmigoJack wrote:
Mon Nov 04, 2019 6:33 am
I click "quote" on posts to get the post content with all BBCodes to use it elsewhere (i.e. another topic I'm already replying in) - in such a workflow I neither encountered a preview, nor will the "other posts have been made" feature kick in.
Agreed on that; this is my workflow as well. Creating "quotes" in tabs that I will never post from, in order to just cut-n-paste those quotes into another tab where I'm composing the actual reply & will actually post from.

Where we differ is simply in the preference: I would be perfectly willing to endure "Are you sure this is the post you meant to abandon?" upon attempting to close any of those tabs. Willing, because of the other scenarios it will keep me from accidentally losing my long and tedious reply composition in, even though "this particular tab" wasn't one of those scenarios.

I certainly don't see any reason not to have a UCP option for opting out of this behavior. Not withstanding that I also feel like users will survive just fine with the "inconvenience" of being prompted to confirm unsaved data, and that preventing the data loss should be the default until they explicitly opt out.

Same as we do every single day when closing that Notepad++ document we were composing code snippets or other notes in, without any intention of ever saving them. Same as I can't exit Word or Wireshark without confirming that the document or LAN trace that only exists in memory is about to be abandoned, etc. Being prompted to confirm loss of unsaved data is not rare or unusual, and most don't have an opt out option.

3Di wrote:
Mon Nov 04, 2019 3:47 am
There are drafts on purpose, so simply adding an auto-save, as Google Mail does, that's the way to go if any.
Can agree this would certainly get us part of the way there, and would be "better than nothing." And it's even possible "the OnBeforeUnload could simply automatically trigger saving a draft", without any prompting.

But this doesn't work well in scenarios exactly like AmigoJack just laid out: It's not that you were necessarily intending to save, nor intending to ever post. AmigoJack or I would end up with a bunch of unintended in-progress reply drafts if we "auto-saved when closing a tab with an in-progress reply." Instead of prompting to confirm whether we were intentionally abandoning the in-progress post.

"Auto-save a draft instead" would also miss the mark for addressing "users who didn't actually realize what just happened" for cases like Post Review. Sure, instead of prompting "you're about to abandon something that hasn't actually been posted yet", we could "silently" auto-save a draft. But the user still doesn't know that their post isn't actually posted, and still only figures out later "hey, that thing I successfully hit submit on never actually posted", even though technically "we've prevented the data loss."

Therefore I would say the interactive prompt is an important element of the solution. The interactive prompt allows a decision of whether discarding was intentional, and also draws the user to the fact that nothing they've done has actually been posted yet.

User avatar
Talk19Zehn
Registered User
Posts: 408
Joined: Tue Aug 09, 2011 1:10 pm
Contact:

Re: Add an OnBeforeUnload prompt when message editor is still active

Post by Talk19Zehn » Mon Nov 04, 2019 12:14 pm

Yes, if the board was running an "automatically save drafts" extension, it might have saved the user's in-progress message at some point before it was lost. The user isn't in control of whether the phpBB board is running such an extension, but the user's time and effort is what will be lost when this situation happens.
Exactly and not every user is allowed to save drafts. Sometimes it seems to me that we have just broken the age of the C64.

:arrow: Little effort with great benefits, should be standards. From my side therefore a YES.
World Meteorological Organization (WMO) Weather - Climate - Water
phpBB Advent calendar: sought and found ..
BTW: My own works - phpBB - read more: ongray-design-de or look here: phpBB VT Theme
Style: Star Trek - StarTrekExcerpts - Fan-Board

Post Reply

Return to “phpBB Ideas”

cron