Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message previews use mxid instead of display name when mentioning users #16262

Open
HarHarLinks opened this issue Jan 24, 2021 · 5 comments
Open

Comments

@HarHarLinks
Copy link
Contributor

Description

Mentioning a user usually inserts a "pill" which Element resolves to a user's display name. This isn't done for the message preview and thus inconsistent and confusing.

image

Logs being sent: no

Version information

Kind of related maybe: element-hq/element-meta#1603

@t3chguy
Copy link
Member

t3chguy commented Feb 4, 2021

Cannot reproduce

Screenshot 2021-02-04 at 00 39 19

@HarHarLinks
Copy link
Contributor Author

Event source:

{
  "content": {
    "body": "@s3858136:tu-dresden.de could it be your inbound federation is broken?",
    "format": "org.matrix.custom.html",
    "formatted_body": "<a href=\"https://matrix.to/#/@s3858136:tu-dresden.de\">@s3858136:tu-dresden.de</a> could it be your inbound federation is broken?",
    "msgtype": "m.text"
  },
  "origin_server_ts": 1611486186934,
  "room_id": "!xYvNcQPhnkrdUmYczI:matrix.org",
  "sender": "@sorunome:sorunome.de",
  "type": "m.room.message",
  "unsigned": {
    "age": 945599308
  },
  "event_id": "$KzOkHACRdW-gMFTb8uaX6SRlFwx5ZDhwUL1dsh-zjRE",
  "user_id": "@sorunome:sorunome.de",
  "age": 945599308
}

https://matrix.to/#/!xYvNcQPhnkrdUmYczI:matrix.org/$KzOkHACRdW-gMFTb8uaX6SRlFwx5ZDhwUL1dsh-zjRE?via=bpulse.org&via=matrix.org&via=maunium.net

sorunome is probably using another client than element to send this message. this issue might stem from the fact that pills are not specced (to my knowledge?).

however if element resolves <a href=\"https://matrix.to/#/@s3858136:tu-dresden.de\">@s3858136:tu-dresden.de</a> to display the current name in the timeline, it should do so consistently for the preview as well.

@t3chguy
Copy link
Member

t3chguy commented Feb 4, 2021

The issue is their Pills don't contain the Display Name in the fallback as they ought to:

<a href=\"https://matrix.to/#/@s3858136:tu-dresden.de\">@s3858136:tu-dresden.de</a>

Resolving pills in message previews across the entire breadth of rooms a user is in could end up being quite computationally expensive as they can yield network requests per-pill

@HarHarLinks
Copy link
Contributor Author

HarHarLinks commented Feb 4, 2021

If this is specced ("When mentioning users, use the user's potentially ambiguous display name for the anchor's text. If the user does not have a display name, use the user's ID."), then the root of this issue lies at another client, but there is still room for element to be nice and try to improve the situation.

Edit: imo, element is to blame partially for this issue by resolving the name at one place, but not the other.

How about updating the preview after the message window resolved the display name and notices it is different from the given fallback? Next to no additional cost and increases consistency ("UX").

@t3chguy
Copy link
Member

t3chguy commented Feb 4, 2021

No additional computational cost, but a lot of software complexity around plumbing that together in React.

Given that it doesn't show bolds, strikethroughs, etc, it is already chosen to be inconsistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants