3 ms·
User interface for undo/redo is Ctrl+Z, Ctrl+Y on Windows systems (or equivalent menu entries or icons). What's complicated about that? Re: implementation, it
by euccastro 19y ago
User interface for undo/redo is Ctrl+Z, Ctrl+Y on Windows systems (or equivalent menu entries or icons). What's complicated about that?
Re: implementation, it of course depends on the application. The key difficulty is having an inverse (undo) for every mutating operation you have. This may get tricky to do efficiently for some applications (video editing comes to mind). An additional complication may come from, e.g., undoing every word rather than every keystroke. So you need some provision for gathering 'small' actions that you don't care for saving separately in history.
The history itself is nothing more than a list.
Now, I understand how it can be very hard to retrofit this functionality in an app that was made without this in mind. I'm redoing a hobby project from scratch because of this.
Anyway, care to give details on the complications you've found? I'm not trying to convince anyone it's easy; I'm trying to help, and maybe gain a better understanding of the problems in the process.
- aston 19y agoYou've addressed most of the issues. One thing of note is that having to be able to undo everything is not really that easy for certain types of apps. Take submitting this reply form to the news.yc forum, for example.
- euccastro 19y agoThe 'delete' option is an undo. The 'edit' option is a less drastic way to correct your actions. Neither of them seems difficult to implement. The fact that they are only available for a short time is a design decision. If your point is that sometimes it doesn't make sense, design wise, to provide undo, then I agree.
- aston 19y agoThough I think we've argued this enough, I'll at least reply to say that neither delete nor edit are actually undos. They allow me to repair, but they don't (necessarily) return me/the server to the previous state.