This is a question for the more experienced folks here... I've lately been wondering whether ui actions should perhaps run in the background by default, instead of blocking the main thread. A question that comes up quite often is "why does x not work in a button action?".
The reason that it works the way it does mostly has to do with consistency. For delegate-style callbacks, it is simply unavoidable to run on the main thread because the control is waiting for a response synchronously, e.g. a TableView needs to produce a cell immediately, a TextView needs to decide whether a character should be inserted, and will block the keyboard until it's done so, etc.
On the other hand, using the action mechanism is much more common than delegates, especially for beginners. Since an action doesn't have to return anything, there's no real technical reason that it has to block everything else, and it makes a lot of common tasks more difficult, e.g. presenting a dialog when a button is tapped. Sure, you can usually just add @ui.in_background and be done with it, but I don't think that this is something a lot of beginners know (or should have to care) about, and decorators in general are not really something you see much when you start out learning Python...
I can't really take the existing ui.in_background behavior and simply make it the default – the new one would have to work a bit differently because otherwise things like View.wait_modal would break. My idea would be to run all ui actions on a separate background thread/queue, and make ui.in_background simply do nothing (so that existing code that uses it doesn't break). I'm not even completely sure if this would work well, but I'd like to experiment with the idea.
So, what do you think? Would this lead to inconsistency and more confusion? Would this break your existing code because you somehow rely on the current default behavior?