Fractal contribution report: improvements for the context menu

These past weeks, I’ve been mainly working on my side project (rlife) but I’ve also done some small improvements for the context menu in Fractal.

First, I found out that there were problems regarding the line returns when inserting a quote: when clicking on the button “Reply”, there was a quote inserted at the beginning of the message input but there were an empty lines between each lines of the quote so for instance, we had this:

> A first line

> A second line


instead of

> A first line
> A second line


It was because there was an extra new line character appended at the end of each lines of the quote when inserting it in the message input. See this MR for more details.

Next, there were a problem with the name completion in the message input: if after doing a line return, you tried to write a name and complete it, it wouldn’t work; you absolutely had to have a space inserted just before the name you wanted to complete to get it work. Here is an example:

Capture du 2018-09-13 18-24-07.png

If we tried to complete “Rio” to have “Riot-bot”, Fractal would search the matches for “line\nRio” among the room’s user names instead of searching for “Rio”. We would have to add at least a space before “Rio” to have the good match. So to fix it, we had to split the strings to search with all white spaces instead of just ” “. Here is my MR to fix it.

I also have the redacted messages simply hidden instead of having them displayed as “Deleted” in this MR.

Finally, I’ve added appropriate actions for images in the context menu. I added buttons like “Open With…”, “Save Image As…” and “Copy Image” and removed the “Copy Text” button for messages that are of the type “m.image”. It looks like this:

Capture du 2018-09-13 18-32-03.png

Here is the MR that implemented it.

I also have an open MR for hiding the option to delete messages in the context menu when the user doesn’t have the right to do so (i.e. for the user’s own messages or when it has the right to do so in the room (e.g. for moderators or owners)). It’s pending for now because there are work done to reliably calculate the power level of a user given a certain room.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s