[PATCH 4 of 4] autocomplete: consistently show 'username (Full Name)'

Thomas De Schampheleire patrickdepinguin at gmail.com
Wed Jun 24 13:42:10 EDT 2015

On June 24, 2015 5:45:23 PM CEST, Mads Kiilerich <mads at kiilerich.com> wrote:
>On 06/24/2015 05:15 PM, Thomas De Schampheleire wrote:
>> On June 23, 2015 10:00:00 PM CEST, Thomas De Schampheleire
><patrickdepinguin at gmail.com> wrote:
>>> # HG changeset patch
>>> # User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
>>> # Date 1435088059 -7200
>>> #      Tue Jun 23 21:34:19 2015 +0200
>>> # Node ID 08fff816a576b4a6a70499d2d40e8ee516db83d4
>>> # Parent  b609779e357e262092c323bc63eebd569e9e1f36
>>> autocomplete: consistently show 'username (Full Name)'
>>> There are three user-related autocompletion paths: members (when
>>> editing
>>> permissions), mentions (in comments), reviewers (in pull requests).
>>> The pop-ups shown when autocompleting would show
>>>     'Full Name (username)'
>>> unlike the way Kallithea normally handles such strings:
>>>     'username (Full Name)'
>>> Hence, line up the autocomplete code to use the same format.
>>> Note: there is a lot of duplication in this autocomplete code, to be
>>> refactored.
>> To be clear, I already started this deduplication...
>Quite related, these patches remind me how wrong it is that we have 
>'firstname' and 'lastname' in the database without having a clear and 
>working mapping from that to "given name" and "family name". We should 
>probably take a first step of fixing that by hiding firstname +
>behind a fullname getter in db.py .

How do you see this? From controller code, most places are already using the full_name* variants do should be fine, right?
Or are you specifically referring to the JavaScript code?

>> (08:12:23 PM) patrickdp: kiilerix2: other question: 
>> User.username_and_name currently shows 'username (First Last)', would
>> you be opposed to turning it around to: 'First Last (username)' ?
>Yes, please. I'm all for consistency, but consistency in the direction 
>of this patch 4/4 looked too wrong.

Seems I took the wrong guess about your opinion :) 
However, what if the name is not available? Then "full name (username)" would become "username" I guess? Or would you prefer "(username)" here? With the current patch, the thing outside parentheses it's always the same (a username) but with this change it could sometimes be a name and sometimes a username.

Also, patch 4/4 is just increasing the consistency. To swap towards the other display style also requires changes in 3/4 and probably some new patches.

>I applied a patch for that on top of your patches on our local
>I guess it will conflict with your cleanup, but it will also be nice to
>go more directly towards where we want to be insted of taking detours; 
>this patch seems to be a bit in the wrong direction.

Is that patch changing to the new style on all places? Care to send it to the list?

I suggest that I finish the cleanup in the JavaScript and apply the reworked patches on top of that and resend.
Do you agree?

Thanks, Thomas

More information about the kallithea-general mailing list