iceportal-api icon indicating copy to clipboard operation
iceportal-api copied to clipboard

Color progress bar based on delay

Open mre opened this issue 1 year ago • 4 comments

I found it hard to understand whether the train was on time or not, just by taking a quick glance at the program output. The red color would make me feel uneasy, as I generally associate it with warning signals; I constantly thought we're late, heh.

To mitigate that, I thought about making the progress bar green when the train is on time and red when it is not. What do you think about that change?

image image

P.S. testing this live from a train. 😆 There are no tests for the view right now, but I could try to add one if needed.

mre avatar Jun 28 '23 06:06 mre

Hi! Thanks for creating this PR - I'm suprised somebody is actually using this :^)

I chose the red color mostly because I wanted to match the official UI of the iceportal.

But I get that it can be confusing, so maybe it makes sense to add come kind of config option to this? maybe something like a color scheme option in a config file. What do you think of this? If you like it, we can either create a new issue for it or discuss on how it's best implemented.

craftamap avatar Jul 04 '23 19:07 craftamap

Makes total sense!

I'm not sure if a single config option is enough to warrant an entire config file. If more settings will be added in the future, it might be reasonable, though.

Alternatively, it could just be a CLI option for now, e.g. --theme portal and --theme delay. It's easy to support config files in the future. Just an idea. 😉

mre avatar Jul 04 '23 23:07 mre

That sounds reasonable to me - do you want to update the PR with this? I guess https://github.com/spf13/pflag would be a good choice :)

craftamap avatar Jul 06 '23 16:07 craftamap

Sure, I've updated this PR. Let me know if I should make any adjustments.

mre avatar Jul 07 '23 00:07 mre