element-hq / element-hq/element-web

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

Open
#23,837 8 comments 2 reactions 0 assignees View on GitHub
A-Export-Chat O-Occasional S-Minor T-Defect X-Needs-Product
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### 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 - alice: if you will need me to emergency smoke-test something with your branch this month?
2022-11-18, 08:28:16 - 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 `` 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](https://user-images.githubusercontent.com/479401/204018456-eb84b629-f990-4600-8c32-4da3143cb267.png)

(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

Contributor guide

Open the contributing guide

Research direction

Start from the room-name menu and the plaintext chat export path described in the reproduction steps. Trace how speaker usernames and mentions are formatted, then verify that exported messages use angle brackets around speakers while preserving the existing message content and other export behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.