~whereswaldon/arbor-dev#75: 
Colourise usernames

Looking for a message by a specific user is somewhat difficult with so many lines being the same colour. When most messages in an area are in response to the same branch and your cursor is on a different one, all text is the same colour and picking out a specific username is difficult.

Visually separating the username from the rest of the message info (content and timestamp) would aid in readability.

Status
REPORTED
Submitter
~amolith
Assigned to
No-one
Submitted
9 months ago
Updated
9 months ago
Labels
feature wisteria

~amolith 9 months ago

Actually, adding another might not be the best idea. Maybe make them bold instead?

~whereswaldon 9 months ago

Bolding the messages would be easy, we can definitely do that. I'd like to colorize them too, but it begs some questions:

  • what to do when a terminal doesn't support color?
  • how to assign colors?
  • for limited- color support terminals like the Linux virtual terminal, what do we do when we run out of colors?

Any thoughts?

~amolith 9 months ago

The reason I said adding another might not be the best idea is because there are already two. I'm not sure how colours are defined in wisteria (terminals in general really) but it looks as if they're hardcoded at the moment. My theme is dynamically generated by pywal and based on my current wallpaper. The colours wisteria currently uses aren't the most accessible (especially red) and adding another one will make it harder to come up with a good palette while maintaining a high enough level of contrast with an arbitrary background to make it readable. Right now, my background is #323231, the current message is #FF000, children are #008000, and parents are #FDFD00. The parents look fine but the children and current message are somewhat challenging to read unless you focus on it.

I've mocked up what I see on Codepen and what it might look like in bold and with another colour.

As to your other question, I really don't know 🤷‍♂️ A large portion of terminal accessibility is based on the background and, when you can't control that, colour choice becomes very hard. I'm thinking there are variables that developers often use and that emulators respect so theirs TUIs conform to the user's chosen theme, whatever it may be.

~amolith 9 months ago

I've mocked up what I see on Codepen and what it might look like in bold and with another colour.

My background is set with my GTK theme, not the colour scheme of my terminal or shell.

~whereswaldon 9 months ago

The reason I said adding another might not be the best idea is because there are already two. I'm not sure how colours are defined in wisteria (terminals in general really) but it looks as if they're hardcoded at the moment.

You're right that they are hard-coded right now, but I hope to remedy that soon. I don't even love the current colors. I'm thinking that it will make sense to allow those to be overridden as soon as wisteria gains a configuration file of its own.

You're right that we don't currently have much control over the terminal background, but I think that's actually because we haven't tried to exert any control. I think that most terminal emulators with background images don't display those images when a program requests a specific background color. Similarly with default terminal background colors. I think they can be overridden by a program which requests that.

I'm thinking there are variables that developers often use and that emulators respect so theirs TUIs conform to the user's chosen theme, whatever it may be.

You would think, right? Wrong. To my knowledge, there's no standard for theming terminal programs other than defining the basic 16 ANSI colors. Those are essentially what older color terminals had to work with. Most modern terms allow you to override those basic colors to be any specific shade you want, and many terminal programs confine themselves to working solely within those 16 shades. We are currently taking advantage of those definitions (I believe), so the specific shades of red, yellow, and green that we use should match your theme. If we chose to (and we were in a terminal with richer color support), we could instead use a specific RGB color.

I looked into making the usernames a different color or bold today, and it required a slightly larger refactor than I have time for at the moment. Basically, styles are currently set by line instead of by character, so I can't make a region of a line of text styled differently. Not terribly hard to change though. Hopefully within a week or so.

~whereswaldon 9 months ago

As ~amolith suggested today during the sync, we could just colorize the entire line (data and username) according to the user as a fast way to disambiguate.

Register here or Log in to comment, or comment via email.