Edgewall Software
Modify

Opened 20 years ago

Closed 3 years ago

Last modified 3 years ago

#1437 closed enhancement (wontfix)

warn user about losing unsaved changes

Reported by: dmlee@… Owned by:
Priority: normal Milestone:
Component: general Version: 0.10.1
Severity: normal Keywords: javascript help
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Users not used to using web apps get frustrated if they click a link while editing a Ticket or a Wiki, which of course causes them to lose their changes. If the link would either open a new window, or prompt a warning box, that would be sufficient to mitigate frustration.

Attachments (1)

trac-confirm.patch (6.0 KB ) - added by bcl@… 16 years ago.
Confirm leaving the Ticket page after clicking in a text field

Download all attachments as: .zip

Change History (27)

comment:1 by Matthew Good, 20 years ago

Component: browsergeneral
Severity: normaltrivial
Summary: Links of New Ticket and Edit Wiki pages should open in new frame or prompt warningwarn user about losing unsaved changes

I should note that this is not a problem with Firefox (and possibly other non-IE browsers) since it will preserve the content of forms in your history, so if you click a link, then click the back button, the previous page will still have your changes in the form fields. Yet another reason people should stop using IE, or start complaining to Microsoft about bringing their browser into the 21st century. </ anti-MS rant>

We certainly don't want to start opening all links in a new window if a user is on a form page, since this would be quite irritating if the user really did want to just navigate away from the form.

I could however see adding a Javascript warning if they were about to leave a form without saving their changes. This would need to be set only to occur if the user had actually modified the form content, since we don't want users getting spurious warnings about unsaved content when simply browsing tickets (since every ticket page has a form on it).

comment:2 by Christopher Lenz, 20 years ago

While I'm not in general a fan of popup windows, I think they actually make sense for the help system. I believe it's a convention people are used to, and is also used in many web applications. And it's IMHO a less obtrusive solution than popping up a warning dialog.

Note that I'd do this only for the help links (those that get the help mouse cursor) and the you may use WikiFormatting here hints. Certainly not for every attempt to leave the page without using the cancel or save button.

comment:3 by Christopher Lenz, 20 years ago

And to add to that… I certainly don't want a warning dialog when implicitly cancelling a form by leaving the page. Chances are I know what I'm doing, thank you very much :-)

Now if we had a way to make "Don't alert me about this again" alerts from JavaScript

comment:4 by anonymous, 19 years ago

Owner: changed from Jonas Borgström to anonymous
Status: newassigned

comment:5 by anonymous, 18 years ago

Priority: normalhigh

comment:6 by anonymous, 18 years ago

Summary: warn user about losing unsaved changeswarn user about losing unsaved ch

comment:7 by Emmanuel Blot, 18 years ago

Owner: changed from anonymous to Jonas Borgström
Priority: highnormal
Status: assignednew
Summary: warn user about losing unsaved chwarn user about losing unsaved changes

(reverting anonymous changes)

comment:8 by anonymous, 18 years ago

I would vote for this too; even Firefox won't cache the fields if you are running Trac on an SSL site. I just lost a large amount of work due to accidently clicking on a link when trying to return foreground window focus. Also it hasn't affected me yet, but #2618 bothers me even more. At least #1437 can be solved by being a "perfect user", but even if you as careful as you can be there's no way around #2618 except selecting all text and copying it before submitting. Actually I've found myself doing that on sites where I've typed a lot, so I guess I have to start doing it with Trac now, too.

comment:9 by Matthew Good, 18 years ago

Cc: zxcv added

You should also considering filing a Firefox bug (if one doesn't exist) regarding warning before leaving an unsubmitted form. I use Epiphany which warns you before closing a tab with unsubmitted changes, so to have Trac try to warn me again would get pretty annoying. Epiphany does not warn you if you click on link without submitting the form, since your changes will still be there if you hit "Back".

comment:10 by Matthew Good, 18 years ago

Cc: zxcv removed

Oops.

comment:11 by Matthew Good, 18 years ago

Well, I was hoping there might be a way to avoid the normal JavaScript "confirm()"-style popup dialog and do something in HTML that would give some nicer options. Unfortunately this doesn't seem to be possible, since the "onbeforeunload" event doesn't follow the normal event-handler behavior of returning a boolean whether the event should continue. Instead you return a string which is displayed in a "confirm()"-style popup :(

I guess it is possible to check the browser used (so I don't get the message on Epiphany), or add a cookie or session setting to enable this behavior. However I think a better solution would be for browsers to support this natively (Epiphany) or an extension that adds this for all sites. Not that I'm proposing that we write one, but if we can document some available solutions that may be sufficient.

comment:12 by anonymous, 18 years ago

Severity: trivialnormal

The normal confirm()-style popup is indeed the convention used by many popular web apps (e.g., GMail). I know that our team loses several hours of work a month due to this failure to warn. By far the no. 1 flaw of Trac. If you accidentally click on the back button on your mouse, even in Firefox 2, you are hosed as clicking forward does not restore it for HTTPS.

This shouldn't be severity "trivial" — it's the user losing their work, for crying out loud. If that isn't severe, what is? And while I appreciate mgood's concern for various browsers, the simple popup warning should be implemented ASAP for all browsers.

comment:13 by Emmanuel Blot, 18 years ago

Keywords: javascript added; wiki ticket removed

Maybe the introduction of Jquery may help here.

comment:14 by Christian Boos, 18 years ago

Keywords: help added
Milestone: 1.0

There are a few things that can be done for this issue:

  1. show help pages in popup windows (see cmlenz' comment:2); as eblot suggested, JavaScript could be used to modify those links into ones triggering a XHR for an embedded help window (e.g. Interface).
  2. identify the situations where editing work will be lost, and trigger a warning on leave when all the conditions are met
    • the https: connection used
    • the browser used won't warn by itself
    • a textarea have been edited

comment:15 by anonymous, 17 years ago

Version: 0.8.10.10.1

comment:16 by anonymous, 17 years ago

Type: defectenhancement

by bcl@…, 16 years ago

Attachment: trac-confirm.patch added

Confirm leaving the Ticket page after clicking in a text field

comment:17 by bcl@…, 16 years ago

I just added a patch called trac-confirm.patch, it is against v 0.10.3 and add a confirmation box if any text box is clicked in. preview and submit do not trigger the confirmation of course.

comment:18 by anonymous, 15 years ago

I get this warning everytime I close a tab. It's a drag but I use epiphany because it uses less system resources than firefox.

Linux 2.6.27.24-170.2.68.fc10.i686 #1 SMP Wed May 20 23:10:16 EDT 2009 i686 athlon i386 GNU/Linux

Web Browser 2.24.3

comment:19 by Christian Boos, 15 years ago

Milestone: 1.0unscheduled

Milestone 1.0 deleted

comment:20 by Ryan J Ollos, 9 years ago

Owner: Jonas Borgström removed

comment:21 by uros@…, 9 years ago

It happens to me and my colleagues that they loose content when clicking on some link by accident, and if writing something for some longer time it is a pitty to loose it.

My firefox doesn't preserve the content, the latest fc22 up to date.

So making an alert for some existent and not sent content would be of help.

comment:22 by Ryan J Ollos, 9 years ago

DataSaverPlugin may be of interest.

comment:23 by CharlesB, 8 years ago

I just accidentally lost my draft… Firefox doesn't recover it after browser exit. It would be nice if Trac warns before closing (like most other systems, if not all) the page containing unedited content.

in reply to:  1 comment:24 by Ryan J Ollos, 3 years ago

Milestone: unscheduled
Resolution: wontfix
Status: newclosed

Replying to Matthew Good:

I should note that this is not a problem with Firefox (and possibly other non-IE browsers) since it will preserve the content of forms in your history, so if you click a link, then click the back button, the previous page will still have your changes in the form fields.

This seems to be the case with all browsers I've used recently (Chrome, Firefox, Safari).

There is also a plugin to address the issue, and I doubt we will take any further action on it.

comment:25 by anonymous, 3 years ago

Even in recent browsers, when you click "New Ticket" the form contents are lost irretrievably:

  • Click "New ticket"
  • Enter some text in the description field
  • Click "New ticket" again
  • Click the back button → the text you entered is lost.

comment:26 by figaro, 3 years ago

And this issue occurs with or without the plugin suggested in #comment:22 ?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.