Open Bug 1666813 Opened 5 years ago

Accidentally hitting escape while editing a comment destructively discards the revisions without prompting and no way to recover the edit

Categories

(bugzilla.mozilla.org :: User Interface, defect)

defect

Tracking

()

People

(Reporter: asuth, Unassigned)

Details

I recently filed a new bug whose comment 0 included a large amount of descriptive text. I wanted to use the edit functionality to further expand on the descriptive text while the bug was in an early state without any comments. (In Firefox OS we used to have some kind of editable UX description that could be edited at any time and track the current status of the bug. If that existed, I would have used that instead.)

I made an extensive set of changes but accidentally hit the escape key on my keyboard (whose layout places the escape key close to the center of the keyboard, presumably due to vim ;). This exited the comment editing mode and discarded my changes without any prompting. I was expecting that if I clicked the edit/pencil icon again that I would find my changes were still there, but instead they had been discarded.

It seems like one of the following enhancements would be appropriate:

  • Always prompt on discarding edit changes.
  • Prompt when the escape key accelerator triggers discarding edit changes, but not when the cancel button is clicked. This rationale would assume a higher probability of accidentally hitting the escape key (ex: VIM users) without the intent to cancel versus the probability of accidentally clicking the cancel button. That said, the cancel button is right next to the update button, so it seems possible to accidentally do the wrong thing there.
  • Guard prompting behind some approximation of edit distance. There's probably no need to prompt if the contents of the textbox are unchanged, and perhaps it's okay to not prompt if the string length has only changed by 10 characters. But if the length of the comment has changed a lot, it seems useful to prompt.
  • Save the changes so that if the edit/pencil icon is clicked again, the user's last edit state can be restored.
    • There is a valid use case to want to restart editing from the initial state of the comment, so there would either want to be a "revert to last saved comment state" in the edit box UI or some other explicit affordance for that case. I would argue that "cancel then restart the operation" is perhaps more of a programmer intuition for how to revert the text, so having that be an explicitly presented UI button in edit mode would make sense. That button itself would also be destructive, of course, so prompting would likely be appropriate.

I've marked this as a defect because I don't know what the actual enhancement would be, but feel free to repurpose this to be an enhancement or dupe it to an existing bug, etc.

You need to log in before you can comment on or make changes to this bug.