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

Export chat: in plaintext mode, use < > to more clearly differentiate between the username of the speaker vs the mentions #23837

Open
nekohayo opened this issue Nov 25, 2022 · 7 comments · May be fixed by matrix-org/matrix-react-sdk#10748
Labels
A-Export-Chat good first issue Good for newcomers Hacktoberfest Issues which are suitable for Hacktoberfest PRs: https://hacktoberfest.digitalocean.com/ Help Wanted Extra attention is needed O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@nekohayo
Copy link

nekohayo commented Nov 25, 2022

Steps to reproduce

  1. Click the room name at the top of the UI
  2. "Export chat", choose plaintext format

Outcome

What did you expect?

Output like this:

2022-11-15, 09:44:48 - bob left the room
2022-11-16, 22:59:22 - <jeff> alice: if you will need me to emergency smoke-test something with your branch this month?
2022-11-18, 08:28:16 - <alice> jeff: thanks, I've been testing with my xml from stable and finding a billion bugs.

What happened instead?

Hard-to-read (or to process) output like this:

2022-11-15, 9:44:48 a.m. - bob left the room
2022-11-16, 10:59:22 p.m. - jeff: alice: if you will need me to emergency smoke-test something with your branch this month?
2022-11-18, 8:28:16 a.m. - alice: jeff: thanks, I've been testing with my xml from stable and finding a billion bugs.

The <speaker username> format would make this visually and programmatically much clearer, quite similar to the kind of logs you'd get from an IRC client. Otherwise the stack of foo: bar: baz: whatever: makes it hard to quickly spot who is saying what when reading logs.

Interestingly enough, the < > format also gets parsed and colored when you use the markdown syntax to highlight the file:

Screenshot from 2022-11-25 10-42-16

(it's maybe not perfect, because if there are multiple words / spaces in the speaker's name, then it will use two colors in gedit/gtksourceview, but that's still way better than nothing for me)


Note that the timestamps in my expected output respect the 24h time format setting, while they currently do not in practice. This is issue #23838.


Operating system

Fedora 37

Browser information

Firefox 107

URL for webapp

app.element.io

Application version

Element version: 1.11.15, Olm version: 3.2.12

Homeserver

matrix.org

Will you send logs?

No

@uhoreg uhoreg added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Occasional Affects or can be seen by some users regularly or most users rarely good first issue Good for newcomers A-Export-Chat labels Nov 25, 2022
@github-actions github-actions bot added the Help Wanted Extra attention is needed label Nov 25, 2022
@uhoreg
Copy link
Member

uhoreg commented Nov 25, 2022

Interestingly enough, the < > format also gets parsed and colored when you use the markdown syntax to highlight the file:

FWIW, the reason it gets coloured is that in Markdown, < > forces the contents to be considered to be a link.

@grimhilt
Copy link

grimhilt commented Jan 5, 2023

It seems that in your example you use "<>" on the sender, wouldn't be more logical to use it on the mention?
Could using "@" also be a good option?

@rj9911
Copy link

rj9911 commented Jan 22, 2023

Hello @uhoreg @nekohayo Can I take up this issue?

@uhoreg
Copy link
Member

uhoreg commented Jan 22, 2023

I think that this issue may require some discussion regarding how exactly the lines should be formatted (is < > what we really want, or do we want something else? Maybe something configurable?) You can choose to work on this issue exactly as-requested here, but be prepared to iterate on it when you submit your PR. Aside from that, I don't think there's anything preventing anyone from working on this.

@nawarajshah
Copy link

in the example, you not only use < > but there is also a color, is that color because of the link or just a color only to differentiate the user's role?

@nawarajshah
Copy link

I have sent PR, please review

@rameshsinghppc
Copy link

I have sent PR, please review

rameshsinghppc added a commit to rameshsinghppc/matrix-react-sdk that referenced this issue May 23, 2023
@Johennes Johennes added the Hacktoberfest Issues which are suitable for Hacktoberfest PRs: https://hacktoberfest.digitalocean.com/ label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Export-Chat good first issue Good for newcomers Hacktoberfest Issues which are suitable for Hacktoberfest PRs: https://hacktoberfest.digitalocean.com/ Help Wanted Extra attention is needed O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
7 participants