projecthamster / hamster

GNOME time tracker

Home Page:http://projecthamster.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should forbid comma in "activity/category" fields in "add/update activity window"

rhertzog opened this issue · comments

In the "add/edit activity" window, it's possible to input an activity name or a category name with a comma, but that is not allowed by the (command line) syntax. When you type a comma in those fields, the "Save" button is (correctly) greyed out but that's not a particularly pleasant user experience

Example:
image

In particular because the cmdline is still updated to reflect the comma in the activity or category and if you switch back to the cmdline and make further changes, it will interpret the input entirely differently and will overwrite all the other fields based on this new interpretation and it will thus re-enable the "Save" button:

image

It would be better to simply refuse to input the comma in the activity and category fields. You type it and nothing happens (or it's immediately removed).

/cc @Flupp @GeraldJansen @mwilck

I am unsure if "simply refusing to input the comma" is a good strategy. Some users may think their keyboard is broken.

Instead, when a comma is entered in the activity, we could disable the link between the activity field and the command line / description fields (i.e. stop updating those from the activity field), and add an error highlight to the activity field (e.g. red background) to indicate that there's something wrong in this field, possibly with a toottip explaining that commas aren't allowed. If we do this, greying out the "save" button would be ok IMO.