More Undo functionality
I'm very new to Zotero, but I've noticed that there aren't a lot of Undo options for common tasks. I may have been coddled by years of this being a common feature, but I'm a little surprised and disappointed that I may make accidental changes that I can't "Undo". This makes me hesitant to switch to using Zotero full-time.
For example:
- Editing a field: Undo works as long as the cursor is in the field, but as soon as I hit "Return"/"Enter", those changes are committed, and can't be undone.
- Moving items. I noticed that if items are deleted (move to Trash), they can be restored, but I have to go to the Trash, find the appropriate item, right-click, and select "Restore to Library". But, if I accidentally drag a child item from one item to another, There's no way to undo it!
- Other things I just can't think of right now.
How much Undo support is already included? Are there limitations to the interface that prevent "Command/Control-Z" from triggering "Undo"? Is there a need for an "Undo" button in the toolbar to provide direct access to this feature, and have it greyed out when Undo is not available?
Cmd/Ctrl-Z within text areas is provided by Mozilla.
Thanks for the replies.
Wow Rintze, that looks complicated. I'd be happy with being able to undo/redo changes to individual items in order (all since Zotero was started, or last save):
I can see how adding something like this would be non-trivial, but I have to say, the lack of undo capability is a bit of a deal-breaker for me. I think most users have just gotten used to having this ability, and I admit, I'm a little scared without it. It's the biggest thing stopping me from switching over from EndNote (as well as batch editing, but pyzotero looks like a promising short-term workaround for that).
I know a little Javascript, and enough general programming to be dangerous, but very little about actual software development, or the best approach to actually add a feature like this. Is there anything I can contribute, or any way to help add this feature?
I admit, I don't have anywhere near that kind of time at the moment, sorry :(
However, looking at the sample plugin, would it be feasible to something like this?:
Then, you would just need an interface to reverse (undo) or re-apply (redo) each change in sequence, maybe even with a way to display a summary of changes in sequence: akin to the 'Photoshop history panel', though maybe a simpler version, like lists under undo/redo buttons.
I appreciate that the data model isn't currently designed for undo, although I strongly urge the developers to consider adding this to any planned changes. Nevertheless, if I can come up with a workaround, even a simple unoptimized plugin, it would make me very happy.
It will probably happen eventually, but it's not on the immediate roadmap.
As mronkko says, I think one would need to have a pretty deep understanding of Zotero's internals to implement this well. In terms of a plugin, I'm not sure whether the current state of the notifier (as used in the sample plugin) could support this, though you could certainly experiment. (I would say, though, that even your proposed version is far more complicated than necessary—a single-level undo would be much easier to implement, safer to use, and sufficient for the vast majority of cases.)
Well, I started with the sample plugin, to see what I could do, but I realized I don't really understand how the Notifier system works well enough to know what's possible. Should I go ask at zotero-dev, or can someone suggest where to look in the code to get a better idea of what's possible and how to do it?
I did find some documentation, but it says that the "JavaScript API is under-documented". I poked around the code on gitHub, and did find some interesting bits in notifier.js, and history.js, but I'm not sure how any of it connects to the way data is passed to the Callback function in a plugin itself.
I'd be happy to try to experiment a little in my free time, but at this point, I'm not really sure where to start, and I think I'm in a little over my head.
best
m
But see this: http://forums.zotero.org/discussion/7707/#Item_16