Thursday, April 01, 2021

Take a Moment

In our various user interfaces, not only in those made by KDE, really pretty much everywhere, we often have situations that cause the user to think something like "hm, did I click that button?" or "is it doing anything?" or perhaps "is it broken?". The way we often deal with that is to immediately slap a spinner on something, if we think it might take a long time, or we just wait for things to happen if we think it might happen kind of soon.

The problem we end up with is, how do we make that choice? Optimally, we'd want to handle the situation where things happen really quickly gracefully, and just not show that spinner. At the same time, we also want to handle the situation where, in some cases, something takes just that little bit longer, and people end up thinking something has broken. The base issue is that it is near impossible to determine how long something is actually going to take before the process has ended, and so we need some way of dealing with that.

Hugs are pretty great

In 2011, the Journal of Ethnology published a paper by Emese Nagy entitled "Sharing the moment: the duration of embraces in humans", in which they investigate the duration of hugs between the competitors and coaches at the 2008 Olympic Games. They found, within that sample, that hugging someone takes an average of 3.2 seconds. Now, the body of evidence for those 3.2 seconds is, granted, not the largest ever found in science, but it's a useful data point.

However, as discussed in this article in Psychology Today (also from January 2011), which used the above paper as its entry-point to commenting on this particular duration, there is "a slew of research" which tells us that the amount of time humans can discern as an independent event is somewhere between two and five seconds. With that in mind, it seems reasonable that we should take that lowermost number of two seconds as a safe amount of time for gauging if the majority of humans would start feeling as though something is taking too long.

Given the above ideals that when the user does a thing, the computer should respond in a timely fashion, but also not unnecessarily, we can take that limit into account and make the decision that if we get to two seconds, something's definitely taken too long, and most people will have registered that as something being wrong. In various places through our software, we have already taken this into account in different ways, and have ended up with a scattering of choices which have, for the most part, intuitively landed somewhere around that kind of time. Some longer, some shorter, but most reasonably close.

What did you do?!

So what we have done now is to actually add this human moment as a base duration unit, called explicitly humanMoment, which we can use in our software. Kirigami already optionally uses this duration of time in its SearchField component, if it has the option turned on to delay firing the automatic accepted signal for situations where the searching thing is expensive (for example if you are doing a search that pulls stuff from online), which also was added for 5.81.

Now, i'm not talking here about those cases where we know that something is definitely going to take a long time. There we could perhaps just slap that spinner on immediately and tell people that yeah, this will take a while. At the same time, though, we might reasonably decide to apply this pattern everywhere. That way when someone decides to install software we put out, and in which it currently takes ages to do some task, and stick it on some future, hyper-fast computer, they will still get a graceful experience - i'm sure you'll have seen those videos of people installing windows 3.1 on a modern high-end computer.

Over to you

In short, as of KDE Frameworks 5.81 we will have ourselves a new unit in both Kirigami and Plasma's Unit classes which will tell you a suitable amount of time to wait before showing the user that something is taking a while to happen. Go forth, and enrich our users' experiences by not pestering them about things taking a long time until they're taking a long time, but also before the user gets the impression that it's taking a long time! ;)

(yes, i realise what date this is, and no, this isn't a joke. But while you're here and hopefully smiling, and if you can do it safely: Go and give someone a hug. And if they are amenable, do it for longer than 3.2 seconds. It's good for you :) )


The word of the day is: Harmoniously. Because that is how we move with a unit like that :)

Labels: ,

1 Comments:

Blogger Unknown said...

I've thought about this before and I'm glad this is being worked on. For me, I have a System Monitor window open so when something doesn't seem to be responding, I'll switch to that and see if it's really working. Normal users shouldn't have to do that and it's something that I think about with my friends and clients for whom I install Kubuntu on their computers. Especially computers with spinning hard drives, which are slooooow. There's a bunch of places where better feedback is so needed in the KDE stack.

5 April 2021 at 02:15  

Post a comment

<< Home