robrix icon indicating copy to clipboard operation
robrix copied to clipboard

Properly handle `matrix.to` links for Rooms

Open kevinaboos opened this issue 1 year ago • 3 comments

These links are special and should be handled via in-app actions rather than by opening them as a regular URL in the system browser.

There is a separate issue #222 for handling matrix.to links to a specific Event, which is much more complicated.

Implementation

Currently, Robrix just ignores matrix.to links that are clicked on, as seen in the code here: https://github.com/project-robius/robrix/blob/61f49943b3bb89161dfca26c8cfaec98705f1f42/src/home/room_screen.rs#L857-L868

Note that issue #84 already covers one specific case of this: links to Users, which should be displayed as a special UserTag widget.

This issue covers one other type of matrix.to links:

  • Rooms via alias (e.g., https://matrix.to/#/#matrix:matrix.org), and rooms by ID (e.g., https://matrix.to/#/!cURbafjkfsMDVwdRDQ:matrix.org)

Links to a room

We should create a RoomTag widget similar to the UserTag widget mentioned above, which looks like this in Element: image

Upon click, if the current user has already joined the room, we simply open that room's timeline view.

However, if the user has not yet joined that room, Robrix should open a preview view of the room that shows the last few messages

kevinaboos avatar Jul 15 '24 22:07 kevinaboos

~~This is blocked; it needs support from the new Robrix UI for navigating between different rooms programmatically (in order to jump to an event in a different room).~~

kevinaboos avatar Sep 09 '24 20:09 kevinaboos

This is now unblocked, as the dock-tab UI and the mobile stack navigation both support jumping to or opening another room.

kevinaboos avatar Oct 31 '24 06:10 kevinaboos

I am looking at this.

aaravlu avatar Nov 07 '24 05:11 aaravlu