Hacker News new | ask | show | jobs
by ballenf 1991 days ago
Why wouldn't the <enter> key interrupt or freeze the keypress queue? I don't think you need some advanced async logic to get this right.

The only potential downside would be if people expected to be able to cancel the <enter> action. But that would be unusual, I think.

2 comments

As a rule of thumb: if you ever ask "why not", and the alternative you're proposing is more complicated - that is normally why not. Lots of UI/UX bugs can simply be attributed to the programmer taking the most simple possible design.

In this case, the async logic is not advanced. In fact, I'm willing to bet that this is what happened: at first, the file-opening was synchronous in the GUI. People complained that opening certain files locked up the file picker, so a developer sticks the file-opening code in a background thread. This produces the above bug, without complicating the input design - in fact, preventing the bug requires making additional changes to the code in some way.

Thanks that makes total sense. And a good rule of thumb for me to remember.
You can't do work on the UI thread, it'll block the UI! With only half a /s