This goes well beyond UI design, and there are even physical analogs - for example, the crash of Turkish Airlines flight 981 in Paris could have been prevented if the device to prevent the cabin being pressurized if the cargo door was not properly closed had been operated by the door locking pins sliding home all the way, rather than by a side-linkage off the linkage that was supposed to drive in the pins.
https://en.wikipedia.org/wiki/Turkish_Airlines_Flight_981#Ca...
But I feel my first suggestion was exactly what you're suggesting -- immediately register the input and apply the operator -- I just phrased it in terms of what happens to the animation.
Also! I certainly feel there are times when letting an animation block your logic is valid. That would be any time when an animation has the UI in a potentially confusing state, such that the meaning of an input is ambiguous. (You should avoid these states as much as possible, of course. And this sort of button-flash comes nowhere even near that category.)
You don’t want the switch activated until it’s all the way left or right.
The buffer in question is, for a tty, a driver-level buffer that holds on to the data until something reads it. If a command doesn't read it (which things like apt-get update don't) then it'll get read as the next command.
Of course, most terminals these days are ptys accessed via emulators, so the buffer is actually part of the emulator, but the same idea applies.
Soo.. When he left his desk, I went in and hit SHIFT-SETUP, turned the audible BEL off in the VT-100 setup menu and enjoyed the silence.
When I came back in the office the next day, there was a technician from Digital with the terminal in what looked like 100 pieces on the desk trying to "fix" it. He was pretty upset when he realized it wasn't the speaker and the setting was just turned off (why he didn't check that first, I'll never know). Needless to say as a teenager, I kept quiet about the whole thing.. until now..
You can link two commands together with the "AND IF" operator
sudo apt update && sudo apt upgrade
Furthermore, you also have `||` which is the logical or, and also `;` which is just a separator which doesn't care what happend to the command before.
What needs to happen here is pressing the button needs to immediately register the press elsewhere in the code. The UI animations and the button tap should be decoupled entirely.
Then the user can tap away as fast as their heart desires and only the animations are going to continue on. That’s an easy problem to solve... by doing as you say and aborting them or shortening them.
But you should NEVER have UI animations and effects block your logic path. They should be parallel operations not serial.