How to display account names and usernames

In the last sprint a few weeks ago the topic of how to display the name and username of publishers and other accounts came up again. Right now we have a few different ways to do that, and we’d like to standardize on something that is reasonable and consistent across the several frontends.

Then, as a coincidence we’ve also landed a change just recently that went out in 2.31, modifying how usernames are presented in the terminal. The change looked simple and obviously correct, yet it wasn’t because of a historical detail in the API. So we’ll need to revert that in 2.31.1, while we discuss the right way we want that done.

So here is a proposal: we need to display the username almost always, whether in the terminal, on the web, or in a GUI, because that’s the unique aspect that in fact identifies the account. Then, when we do have more space, we should consistently present the name next to the username in a format we agree to. For the latter, I suggest the format Display Name (username).

There’s one case where we don’t need to present the display name and the username next to each other, though, and that’s when one matches the other exactly, or the display name is merely a casing change on the username. In other words, instead of Blender (blender), we present simply Blender.

More succinctly:

  1. When space is tight (e.g. snap find), we display: blender
  2. When there is space (e.g. snap info, web), we display: Blender Foundation (blender)
  3. When there is space but username and display name match: Blender instead of Blender (blender)

As for snapd, note the following version differences:

  • 2.30 and earlier would display option 1 only
  • 2.31 displays simply Blender Foundation, which is a mistake
  • 2.31.1 will display option 1 again
  • 2.XX will eventually use 1, 2, and 3, depending on correct context

(cc @mvo @carlaberkers @mpt @Lukewh)

Hi Gustavo

Thanks for the post.

A couple of questions:

  1. username is the same field as username in Ubuntu1 ?
  2. What/where is Display name generated from?
  3. Why would a publisher choose to have the two names be different?

What’s the course of action if a publisher’s username is longer than, or the same length as, their display name?

The username we’re talking about is the field we get as “username” in account assertions. The store team may give you more details about how that spans out across other systems.

Similarly, that’s the “display-name” field in account assertions.

Because one of them is very strict (lowercase, unique, no spaces, etc), while the other one is not.

The logic above doesn’t account for length, so in principle there’s no special casing needed. Is there a more specific problem you’re facing?

opened

this makes the information on publishers of snaps returned by the snapd API similar to the new store APIs, which means also enough information to represent them as discussed here (especially once we also have a the start of a verified flag):

"publisher": {
     "id": "canonical",
     "username": "canonical",
     "display-name": "Canonical"
}
1 Like

@pedronis Makes me wonder about what to do with “developer” there, including the discussion about developer vs. collaborator.

this exposes publisher’s validation over the snapd API (both for installed snaps and for remote results):

@robert.ancell hi, the added "validation": "unproven|verified|..." to publisher is also relevant for snapd-glib

1 Like