You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature will enable the user to reply to a particular message. Currently Robrix only supports sending a standalone message that is not in-reply-to anything.
Implementation Approach
This requires modifying the UI in two places:
adding a reply button to each message
adding a "Replying-to" preview above the message input box
Reply button
For the Makepad DSL components, we can add a Reply IconButton to all of the Message-like views. Most likely, the best place to add this is as part of the MessageMenu, which itself needs to be redesigned entirely.
By default, this view would be marked as visible: false, and would only be set to visible upon hover, or by showing a context menu when right-clicking / long-pressing on a message. I think the best option is to show this on the upper-right corner of the message, which is what both Element and Discord do (see the Examples section below).
Note that we should only show the reply button if the message can be replied to, which can be determined via this function.
Makepad doesn't yet have built-in support for context menus, so it is probably best to initially make the buttons (and the MessageMenu) visible at all times (instead of just upon hover).
Makepad also doesn't yet support gestures, but eventually when it does, we'll want to add a swipe gesture to reply to a message too.
Replying-to message preview
Once the reply button has been pressed, we should add a view right above the message_input text input box (at the bottom of the RoomScreen) that shows a preview of the message that the user is about to reply to. We could likely re-use the ReplyPreview suggested in issue #82 for this.
In addition, we need a cancel (X) button that sits at the far right side of the reply preview, which allows the user to cancel the reply action, which will make the current message being composed in the message_input text box act as a regular standalone message.
Here's an example of how Element displays this "Replying to" preview:
This feature will enable the user to reply to a particular message. Currently Robrix only supports sending a standalone message that is not in-reply-to anything.
Implementation Approach
This requires modifying the UI in two places:
Reply button
For the Makepad DSL components, we can add a Reply IconButton to all of the
Message
-like views. Most likely, the best place to add this is as part of theMessageMenu
, which itself needs to be redesigned entirely.By default, this view would be marked as
visible: false
, and would only be set to visible upon hover, or by showing a context menu when right-clicking / long-pressing on a message. I think the best option is to show this on the upper-right corner of the message, which is what both Element and Discord do (see the Examples section below).Note that we should only show the reply button if the message can be replied to, which can be determined via this function.
Replying-to message preview
Once the reply button has been pressed, we should add a view right above the
message_input
text input box (at the bottom of theRoomScreen
) that shows a preview of the message that the user is about to reply to. We could likely re-use theReplyPreview
suggested in issue #82 for this.In addition, we need a cancel
(X)
button that sits at the far right side of the reply preview, which allows the user to cancel the reply action, which will make the current message being composed in themessage_input
text box act as a regular standalone message.Here's an example of how Element displays this "Replying to" preview:
Actually sending the message
Currently, messages are sent in the code here:
robrix/src/home/room_screen.rs
Line 578 in a5ff746
It should be straightforward to augment this to support sending a reply message. Currently, the actual message is sent here:
robrix/src/sliding_sync.rs
Line 265 in a5ff746
send_reply()
function provided by the Matrix SDK.Examples
Here's how Element on desktop shows a message menu upon hovering over it, with the reply button in the middle:
Here's how Discord shows the reply button:
The text was updated successfully, but these errors were encountered: