matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

Friendlier room names when calculating from members

Open tlaundal opened this issue 4 years ago • 10 comments

This is my first PR, and an attempt to solve vector-im/element-meta#1389. The implementation is driven by my own motivation for quickly being able to recognize my own rooms (bridged from Facebook Messenger). The style is inspired by Messenger and the issue mentioned above.

I know room naming is specified the client-server spec section 13.2.2.5 Calculating the display name for a room, and I don't believe this PR breaks that spec, although "calculate display names [...] and concatenating them" might be interpreted in several ways. I am of course open to changing my implementation should someone have better ideas, though.

In action

Here are some screenshots from Element. Before Skjermdump fra 2021-02-14 13-13-55 After Skjermdump fra 2021-02-14 13-17-31

Possible caveats

  • Not all names are delimited by spaces, or are reasonable distinct in their first "word"
  • The first "word" of names might be long, so the total length of the room name is longer than ideal for an UI. This problem also exists in the existing implementation
  • The first name / word might not be a good representation of the relevant person in all cultures

Commit message

The following changes are made to the room name calculation from list of members:

  1. Only show the first word of each member name (before first space)
  2. Show up to three members listed explicitly
  3. Show two names before appending "and n others"

The possible forms are now:

  • Empty room
  • Paul Brown
    • When there is only one member except you
  • Paul and John
    • When there are two members except you
  • Paul, John and Will
    • When there are three members except you
  • Paul, John and 3 others
    • When there are more than three members except you
    • Or, only two members have actually joined the room
  • Paul, John and 1 other
    • When the third member except you has not yet joined the room
  • Paul and n other(s)
    • When only one member except you has actually joined the room

Signed-off-by: Tobias Laundal [email protected]


Here's what your changelog entry will look like:

✨ Features

  • Friendlier room names when calculating from members (#1602). Contributed by @tlaundal.

tlaundal avatar Feb 12 '21 19:02 tlaundal

@tlaundal, may I ask why have you closed this?

SimonBrandner avatar Aug 02 '21 11:08 SimonBrandner

@SimonBrandner bitrot + no time?

ShadowJonathan avatar Aug 02 '21 11:08 ShadowJonathan

@SimonBrandner bitrot + no time?

Maybe, but I can only guess...

SimonBrandner avatar Aug 02 '21 11:08 SimonBrandner

@tlaundal, may I ask why have you closed this?

Sure. After six months of no feedback I thought the likelihood of getting a merge was pretty low.

If there is interest for this PR and it actually has a chance to be merged, I am happy to reopen and fix the conflicts.

tlaundal avatar Aug 03 '21 05:08 tlaundal

thought the likelihood of getting a merge was pretty low.

The PR was stuck on product review which often takes a lot of time, the team is super busy, so this is mostly about waiting... I think it would make sense to leave the PR open and wait for the product review. If they (eventually) approve, you can either resolve the conflicts or someone from the team will do it instead (if they are resolvable). But it's of course up to you

Sorry for the trouble

SimonBrandner avatar Aug 03 '21 05:08 SimonBrandner

I'll reopen this and await product review, then :)

Perhaps some info about this product review and expected wait time could go in CONTRIBUTING.md, or maybe one of those "Thanks for your PR"-bots could help with setting expectations for contributors?

tlaundal avatar Aug 03 '21 06:08 tlaundal

For European languages, I personally think that's ok, but would like to hear feedback from someone who speaks other languages. Also, in post-USSR countries, there's sometimes a tradition of writing the surname prior to the name for some reason, this could break the implemented approach as well. Is the first word always the best representation of the full name?

pioneer avatar Aug 03 '21 08:08 pioneer

Is the first word always the best representation of the full name?

I truly don't know, but I think it's the best compromise between simplicity and usability. It's fine for the few languages I know, but it would be very interesting to get some feedback with other perspectives.

tlaundal avatar Aug 05 '21 08:08 tlaundal

Is the first word always the best representation of the full name?

I truly don't know, but I think it's the best compromise between simplicity and usability. It's fine for the few languages I know, but it would be very interesting to get some feedback with other perspectives.

I, at least, have one concrete example of a nickname that won't pass that: "The Chose" (I redacted the nickname, but the idea is here). We would have "The, Paul and 4 others", that won't fly IMHO.

Isn't it possible to give the complete list and let the client do the job?

MightyCreak avatar Aug 06 '21 14:08 MightyCreak

Related to https://github.com/matrix-org/synapse/issues/12835

MadLittleMods avatar Jun 03 '22 05:06 MadLittleMods