matrix-js-sdk
matrix-js-sdk copied to clipboard
Friendlier room names when calculating from members
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
After
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:
- Only show the first word of each member name (before first space)
- Show up to three members listed explicitly
- 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, may I ask why have you closed this?
@SimonBrandner bitrot + no time?
@SimonBrandner bitrot + no time?
Maybe, but I can only guess...
@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.
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
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?
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?
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.
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?
Related to https://github.com/matrix-org/synapse/issues/12835