Destructive Actions and User Interfaces

By Jeffrey Charles
Published on

I think recognizing when you make a mistake and being able to learn from it is an essential part of being a professional in any field.

I had an incident occur a few weeks ago on a web application I had built a couple of years ago. The web app in question was a document repository that was a part of a larger site that I had built for a campus club at Wilfrid Laurier University. The chain of events was that a user logged in using Internet Explorer (which was not supported), wanted to delete a folder that was within another folder, clicked delete, IE crashed, and then when the user realized that the parent folder was deleted instead of the folder they wanted to delete.

The fix that I had to perform involved contacting our web hosting provider to restore a filesystem backup from a day earlier and then downloading and clearing the restored files from the server filesystem to get the document repository filesystem and database back into sync. Finally I re-uploaded the files through the web interface and changed the ownerships and permissions to match up with the files’ states prior to the deletion.

Now obviously the mistakes were mine as the user did not do anything extraordinarily wrong. My first mistake was not having some JavaScript to warn the user that Internet Explorer was not supported. There was no reason I should have expected the user to realize this. My second mistake was not having a confirmation dialog on the delete action which contained the name of the folder being deleted. This was a failure in not having effective communication between the UI and its users. Had this dialog been there, the erroneous deletion likely would not have occurred. Finally, I made the mistake of giving the user too much rope by allowing them to delete files and folders in the filesystem and database directly from the web interface. In retrospect, a better strategy would have been to mark the items as deleted in the database and simply move them to a “trash” folder within the repository’s filesystem (the implication being that items in the trash folder would be deleted after a certain period of time or after the folder had grown too large). Having a system like this in place would have made restoration a simple short procedure that could have been handled internally.

Ultimately, these were simple mistakes. Taking a user interface to the next level requires recognizing what actions could be destructive mistakes, warning the user about the destructive nature of the action, and finally providing a way to reverse those potential mistakes. Failure to perform this analysis or performing it incorrectly will probably lead to at least one upset user.