profanity icon indicating copy to clipboard operation
profanity copied to clipboard

[Request] Increase readability by rendering the lines starting with ">" (quotes) with different color

Open mirror230469 opened this issue 1 month ago • 1 comments

Is your feature request related to a problem? Please describe. Line started with ">" are quotes. In other GUI XMPP client, quotes are often shown with lower contrast (a little bit darker) or even put into different frame (with a horizontal straight line on the left, or darker background color ) to let user easily distinguish between the quotes and the reply messages.

Describe the solution you'd like Increase readability by rendernig the lines starting with ">" (quotes) render with different color, to let user easily distinguish between the quotes and real reply message.

Describe alternatives you've considered Horizontal straight line with lines starting with ">" like other GUI clients. However profanity is a TUI XMPP client, the chat messages was designed immediately following the nick. So the horizontal straight line with lines starting with ">" to improve readability may require change a lot of code base.

But it is even better if it can be implemented.

Additional context

  1. Toggle on / off of this feature.
  2. Even better if the color can be configurable by user.
  3. Maybe also consider both the foreground and background color of the quoted message.

mirror230469 avatar Nov 14 '25 08:11 mirror230469

I like the idea.

This should be realized via the already existing theme model.

Approach 1 (A1)

Implementation wise the easiest would be adding two new entries main.text.me.quote and main.text.them.quote which define the color to use.

I'd suggest the following behavior: If one of the values isn't defined, use main.text.me for messages the user sent resp. main.text.them for messages the user received (i.e. the behavior is as before).

This will require a minor enhancement of the special handling shown below

https://github.com/profanity-im/profanity/blob/5da079bbb24c737c1f3837e042fba6caacb16730/src/config/theme.c#L654-L658

Where in the case of if (!val) we should first check whether the setting has a parent value which is not the root, and also contains a valid color code. Only if that's not the case fall back to the default value. This check could look whether setting contains a dot and if so, check if that one is not the root entry (i.e. after terminating the string at the last dot it still contains a dot). Maybe use g_utf8_strchr() and g_utf8_strrchr() to accomplish this.

Approach 2 (A2)

Another option would be to implement the color determination programmatically from main.text.me resp. main.text.them. Maybe some research should be done, whether there isn't already some implementation or paper published, that describes how to accomplish this.

Discussion

One advantage of the programmatical approach could be that nested quotes could be easily represented in other colors.

Regarding the horizontal straight line: I don't think this would improve anything. This feels like "plain text e-mail" vs. "Microsoft Outlook", where the latter usually looks visually appealing to some at the cost of decreased information density for all. And FMU we're all working on a CLI/plain text interface because we want dense information.

  • Toggle on / off of this feature.

In the case of A1 the existence of those new entries would automatically act as on/off switch. In the case of A2 we'd need this as a setting, most likely on application level, because it's a user preference.

  • Even better if the color can be configurable by user.
  • Maybe also consider both the foreground and background color of the quoted message.

Both possible in both approaches.

Just a stupid idea

XEP-0392, which is already implemented in profanity and can be enabled via /color on. When quoting a string, the implementation could search through the last N history entries and color code the quoted message according to the user that sent it!? But most likely this should just stay a stupid idea ...

sjaeckel avatar Nov 14 '25 10:11 sjaeckel