Well, hooking into system undo is tricky as there still seems to be no native web platform thing for that. I see all kinds of things like
https://github.com/samthor/undoer but the article was about the foundation, rather than the integration. For what I am doing, shortcuts + clickable buttons on screen will do the job.