News for hackers. Stuff that matters.
Re:The UX of UUIDs by TehShrike on Thursday April 11, 2024 @03:57PM (#40006173)
> One way to enhance the usability of unique identifiers is by making them easily copyable.

No matter what your identifiers look like, if you want them to be easily copyable you should add `user-select: all` to the element containing them.

If you do this, all of the text will be selected automatically when you click on the element.

https://developer.mozilla.org/en-US/docs/Web/CSS/user-select

Re:The UX of UUIDs by blue_pants on Thursday April 11, 2024 @04:11PM (#40006329)
That's true, but there are a lot of places where ids live, but where I can't add `user-select: all`. For example, in terminal (logs), Studio3t (db client) etc.
Re:The UX of UUIDs by cess11 on Thursday April 11, 2024 @04:39PM (#40006578)
I find double click to select word, triple to select line or buffer, in surprisingly many contexts. Does this work for you?
Re:The UX of UUIDs by saurik on Thursday April 11, 2024 @05:00PM (#40006753)
The whole point of this article is that double-click to select a word doesn't work with a UUID... though, I think this should just be fixed: I have XTerm set up where double clicking selects a word, triple clicking selects a filename (which can include a hyphen, but not a slash), quadruple clicking selects a URL or path, and quintuple clicking selects the rest of the line.
Re:The UX of UUIDs by iaaan on Thursday April 11, 2024 @06:13PM (#40007363)
The workaround I've landed on is double-click and hold, then drag in the correct direction. Precise enough to just grab the UUID, imprecise enough to be quick and not annoying
Re:The UX of UUIDs by fiddlerwoaroof on Thursday April 11, 2024 @07:33PM (#40007939)
A lot of terminals let you adjust the characters that break words. I’ve always configured my terminals and editors to treat `-` as a word character.
Re:The UX of UUIDs by eyelidlessness on Thursday April 11, 2024 @11:33PM (#40009154)
This is what I use, because it works almost everywhere almost exactly the same way, even when quite a lot else doesn’t have that quality. I similarly use long-press+slide for very similar behavior on iOS (although that has much more variance in behavior across apps, and sometimes even within the same app).
Re:The UX of UUIDs by jraph on Friday April 12, 2024 @01:55AM (#40009761)
Adding clicks is not ideal, many people already have some troubles with double clicks (because they can't be fast enough, or it hurts), triple click is already harder.

Also more than 3 clicks starts taking a considerable about of time.

Re:The UX of UUIDs by cess11 on Friday April 12, 2024 @02:04AM (#40009798)
OK, right, yeah, they might have some word-break config that would need touching up. Thanks.
Re:The UX of UUIDs by yndoendo on Saturday April 13, 2024 @11:30AM (#40023742)
Now replace the double click, desktop, interaction, with press and hold, touch screen. I don't know of any triple click interaction that maps to a simplistic touch screen interaction.
Re:The UX of UUIDs by mynameisvlad on Thursday April 11, 2024 @04:20PM (#40006408)
The example used is a URL. I don't believe there is an equivalent for the address bar. Plenty of other examples exist, but that one is pretty easily reachable by users.
Re:The UX of UUIDs by hot_gril on Thursday April 11, 2024 @09:14PM (#40008527)
But you shouldn't be asking users to copy UUIDs out of your URLs... or really in general at all.
Re:The UX of UUIDs by mynameisvlad on Thursday April 11, 2024 @11:11PM (#40009058)
Why not?

> Customer: "I'm having issues with an order"

> CS: "Can you give me the order number?"

> Customer: "Sure, it's zero two a as in apple five..."

This seems entirely reasonable considering the whole point of TFA is to move away from using UUIDs as unique identifiers for resources in a service.

Re:The UX of UUIDs by Mtinie on Thursday April 11, 2024 @11:27PM (#40009127)
I’m inferring the comment you were responding to meant

“Asking the customer to copy/paste the UUID from a URL to send to Support via an email or chat.”

Rather than asking a customer to read it out to you.

Re:The UX of UUIDs by dumbo-octopus on Thursday April 11, 2024 @09:19PM (#40008554)
API keys are basically just UUID's, they need copying quite often.
Re:The UX of UUIDs by BeFlatXIII on Thursday April 11, 2024 @05:19PM (#40006934)
I support all extension makers who strip user-select: none from all stylesheets.
Re:The UX of UUIDs by christophilus on Thursday April 11, 2024 @06:17PM (#40007378)
Wow. TIL. I’ve been using JavaScript for that.
Re:The UX of UUIDs by keyle on Thursday April 11, 2024 @10:26PM (#40008860)
There is danger in that as well, you could be copying transparent/hidden text as part of the copy, and if you paste and <enter> without reading what you've entered, it can be dangerous.

That being said, most people copy and run bash script straight off the internet, so clearly not worried about copying stuff they haven't read!

e.g. https://bun.sh

   curl -fsSL https://bun.sh/install | bash
Re:The UX of UUIDs by rgoulter on Thursday April 11, 2024 @11:18PM (#40009094)
> That being said, most people copy and run bash script straight off the internet, so clearly not worried about copying stuff they haven't read!

The most common complaint about "pipe to bash" I've seen is the possibility for the server's response to detect it's being piped to bash, and then execute malicious code. The suggested remedy is to first download the install script (and check it) then run it. -- This seems overblown to me, since if you think the server may be malicious, then downloading programs from that server also seems risky.

Criticising people for not reading bash scripts from install pages is weirder to me. -- It's possible that some software author would hide malware in the install script; but, then why wouldn't they just hide malware in the installed program itself.

Re:The UX of UUIDs by eyelidlessness on Thursday April 11, 2024 @11:38PM (#40009172)
> This seems overblown to me, since if you think the server may be malicious, then downloading programs from that server also seems risky.

I heed the risk with the reasoning that even a benevolent server may be compromised, and that detecting pipe to bash is a potential way for that to go unnoticed.

Re:The UX of UUIDs by pphysch on Thursday April 11, 2024 @06:50PM (#40007640)
Thanks, I was looking this up yesterday and only found a bunch of JS that didn't work.
Re:The UX of UUIDs by kiitos on Thursday April 11, 2024 @07:04PM (#40007755)
In the browser, fine, but what about in the terminal?
Re:The UX of UUIDs by accrual on Thursday April 11, 2024 @07:22PM (#40007869)
I like that some tools also provide a copy button next to fields, it looks like two overlapping boxes (kind of like: ⎘). If I were building a tool that exposed user copyable keys, I'd be sure to add these to my forms and fields. A brief contextual "copied!" modal that quickly fades away is a nice touch too.
Re:The UX of UUIDs by timnetworks on Thursday April 11, 2024 @09:37PM (#40008644)
Triple clicking has been around for a long-long time, no?
Re:The UX of UUIDs by keyle on Thursday April 11, 2024 @10:22PM (#40008842)
This is a neat trick but it will select the whole 'paragraph', which in most logs means the entire row. Triple click the following:

b214a2bb-c3c1-48fb-8272-10a2808337f3, something, ...

b214a2bb-c3c1-48fb-8272-10a2828337f3, something else...

Re:The UX of UUIDs by jraph on Friday April 12, 2024 @01:51AM (#40009740)
Yep, double-click+drag is how I do it. On Linux double-click selects a chunk, and then dragging selects more chunks (fully). I double-click on the first or last chunk and go towards the other end.

Not as good as double-click selects all the id, but at least id doesn't take too much time and I don't have to precisely go to one of the ends.

Re:The UX of UUIDs by danlindley on Friday April 12, 2024 @03:38AM (#40010267)
I did not know about the double-click+drag feature. Thanks for sharing!
Re:The UX of UUIDs by keyle on Friday April 12, 2024 @06:19AM (#40011038)
I've had computers since the mouse was commercialised and I didn't know this was a thing. Amazing, thank you.
Re:The UX of UUIDs by eternityforest on Friday April 12, 2024 @12:27AM (#40009387)
Additionally, copy buttons are very nice.
Re:The UX of UUIDs by kazinator on Friday April 12, 2024 @12:35PM (#40014819)
How can I do that in my comment here? Say I want the word "double-click" to be simply selectable, right in this sentence.

I'm grateful to be informed about select-all, though!