News for hackers. Stuff that matters.
Re:Writing a tiny undo/redo stack in JavaScript by hyperhello on Wednesday March 26, 2025 @05:03PM (#43487292)
It's very nice, but it doesn't do system undo. You can shake iPhones to get an Undo/Redo dialog, for example.

So you can probably trap Meta-Z but some people use menus or the other affordances.

Re:Writing a tiny undo/redo stack in JavaScript by julik on Wednesday March 26, 2025 @06:39PM (#43488287)
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.
Re:Writing a tiny undo/redo stack in JavaScript by hyperhello on Wednesday March 26, 2025 @11:26PM (#43490116)
If you're interested, [plug] here is my technique, just a page of script.

https://hypervariety.com/NativeBrowserUndo/NativeBrowserUndo...

Re:Writing a tiny undo/redo stack in JavaScript by nukem222 on Wednesday March 26, 2025 @05:36PM (#43487635)
> You can shake iPhones to get an Undo/Redo dialog, for example.

When are they gonna add a proper UI for this? I look like a moron using the phone this way, and shaking only works to trigger the undo about half the time.

Re:Writing a tiny undo/redo stack in JavaScript by frou_dh on Wednesday March 26, 2025 @05:51PM (#43487809)
Re:Writing a tiny undo/redo stack in JavaScript by nukem222 on Wednesday March 26, 2025 @05:53PM (#43487833)
Edit: thank you!

Man I get gestures have been embraced by the community, but this is emphatically not what I meant. The only gesture that makes sense to me is pinch-to-zoom and maybe swiping on cards that appear to be floating.

There's no way to discover this functionality outside of googling documentation and it often doesn't work with one hand.

Re:Writing a tiny undo/redo stack in JavaScript by julik on Wednesday March 26, 2025 @06:40PM (#43488292)
There is another that is fairly intuitive for a Mac person: tap-and-hold to get a contextual menu. Shame they have hidden it under some kind of "haptic feedback" thingamagig.
Re:Writing a tiny undo/redo stack in JavaScript by nukem222 on Wednesday March 26, 2025 @07:05PM (#43488499)
The ipad also has an icon above its keyboard. Whatever lack of obvious interaction is available on the phone seems intentional.

Cynically, I think you'd just look like even more of a fool shaking an ipad and this is the only reason they approved such a button.

Re:Writing a tiny undo/redo stack in JavaScript by rekabis on Wednesday March 26, 2025 @05:50PM (#43487792)
Half the time? More like 10% of the time.

Sometimes I think I have to use a paint can shaker on a 5-minute cycle just to trigger it.

Re:Writing a tiny undo/redo stack in JavaScript by sgarland on Wednesday March 26, 2025 @08:32PM (#43489139)
TIL this is why that modal has popped up at seemingly random times.

Very useful, if you know how to summon it!

Re:Writing a tiny undo/redo stack in JavaScript by aitchnyu on Thursday March 27, 2025 @01:56AM (#43490732)
Around 2018, the ultra buggy Matrix messenger had a onShakeListener that triggered a dialog "It seems you are frustrated. Do you want to raise a bug report?"
Re:Writing a tiny undo/redo stack in JavaScript by JadedBlueEyes on Friday March 28, 2025 @05:21PM (#43509909)
Element's crash reporting system is still called 'rageshake' today, and you can enable the shake-to-report function in dev settings.