Skip to content

Support user pills and autocomplete for arbitrary Matrix IDs (not limited to room members) #3260

Description

@lostendo

Your use case

What would you like to do?

Currently, user pills/mentions in Element are limited to users who are members of the current room.

I would like Element to support creating user pills for any valid Matrix user ID (@user:server) regardless of whether that user is currently in the room.

This should work similarly to how mentions work today:

  • Typing a Matrix ID should render as a user pill rather than plain text.
  • User pills should be visually distinct and unambiguous.
  • Clicking a pill should open the user profile or start a DM, where supported.
  • User information (display name, avatar, etc.) should be resolved when possible.

To improve usability, Element should also provide autocomplete suggestions while typing Matrix IDs, similar to the current mention autocomplete:

  • Suggest known users from the local server.
  • Suggest users already known to the client (previous DMs, shared rooms, contacts, etc.).
  • Fall back to displaying the raw MXID if no additional information is available.

Why would you like to do it?

We use Element in a professional/work environment where it is important to identify people unambiguously in conversations.

Example:

In my mail to Thomas: have you already spoken to @john:matrix.example.com about this?

In this example, John is not necessarily a member of the room, but participants should still be able to clearly see that a specific Matrix user is being referenced.

How would you like to achieve it?

  • Separate “user reference pills” from “notification mentions”.
  • Render any valid MXID as a pill.
  • Resolve profile information via:
    • locally cached users,
    • users known through shared rooms,
    • server-side directory lookups where available.
  • Reuse the existing mention autocomplete UI to suggest users beyond current room membership.

Have you considered any alternatives?

Currently we use:

  • Raw MXIDs (@user:server)
  • Display names written manually
  • matrix.to links

None of these provide the same clarity and visual distinction as user pills.

Display names are ambiguous, while raw MXIDs are easy to miss in busy conversations.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions