3 ms·
Is your moral just to give up?
by superb_dev 2y ago
Is your moral just to give up?
- londons_explore 2y agoThats what the vast majority of webapps do... Can't exactly log into facebook, post something to your wall, and then press Command+Z to undo the post, and the Command+Z again to undo the login... No - both of the undo's have a special way to do it - click "delete post" followed by "log out".
- esperent 2y agoThe main reason you can't do that on Facebook is that it would confuse the hell out of people.
- muspimerol 2y agoBut logging in and posting don't seem like "undoable" actions to me. That would be similar to undoing a save or undoing a login to Adobe CC in Photoshop. Things definitely get trickier with network requests, but that can be solved with something like CRDT.
- deleted 2y ago[deleted]
- benatkin 2y agoHaving Command-Z and Command-Y work with actions such as deleting a post or logging in doesn't help with having a proper undo system undo anyway. Command-Z and Command-Y should be for document-based undo. Give the user some way of knowing what document they're working on. Even if the user is going to use the keyboard it helps to have Undo/Redo icons so they know what Undo/Redo applies to. Now, documents in code are more complex, but there's a wealth of research on it, and stuff like CRDTs and the history systems of libraries like ProseMirror and CodeMirror. And often the undo of deleting a post is needed, but that's a separate thing, nowadays handled by the snackbar components. And if you really needed a redo, that would be something to put in a history feature. Navigation does have a stack which works the same way as undo/redo but it doesn't normally use Command-Z and Command-Y.