Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inputting descriptions with single or double comma? #657

Closed
matthijskooijman opened this issue Dec 11, 2020 · 7 comments
Closed

Inputting descriptions with single or double comma? #657

matthijskooijman opened this issue Dec 11, 2020 · 7 comments

Comments

@matthijskooijman
Copy link
Member

matthijskooijman commented Dec 11, 2020

From projecthamster/hamster-shell-extension#334:

With hamster 3.0.2, if you type Activity@Category, task description in the shell extension, nothing happens. To get it to actually start, you need to type Activity@Category,, task description. This is likely related to the breaking change made in hamster that now requires two commas to separate descriptions:
42d3c05

I think we should revisit that decision as it doesn't seem like a good decision to me. In particular when typing Activity@Category, #tag just works.

But if we don't, then we somehow need to fix the shell extension. Something needs to happen when the user inputs something... either it creates an activity with some unexpected values, or it displays an error. But just dropping the user's input is wrong.,

And from #656 (comment)

I would love to see some discussion on projecthamster/hamster-shell-extension#334 and see wether we prefer to revert 42d3c05 here or find some other solution elsewhere.

@matthijskooijman
Copy link
Member Author

w00ps, pressed ok too soon. Edited in the issue description above now :-)

As for the double comma, I also noticed that this had some special handling in the activity editing window that seems a little fragile. It seems that the description is also the only part that is not serialized into the cmdline, though it is editable from the commandline using the double comma I think.

Anyway, I wonder what the motivation for the double comma is. I guess it serves to distinguish a tag from the description? Maybe it allows starting the description with a hash, which is probably not otherwise possible? Would we mind?

I haven't looked too closely at this yet, though, just wanted to get this dicussion in a separate issue in the right place :-)

@GeraldJansen
Copy link
Contributor

Basically the double comma emerged to satisfy the request of one user to be able to include a comma in the activity name. @mwilck argued against the change here and I have to say I agreed with him then and still do.

@ederag
Copy link
Collaborator

ederag commented Dec 13, 2020

Basically the double comma emerged to satisfy the request of one user to be able to include a comma in the activity name.

You do not think this through, IMO.
And forget about #476 (comment).
See #465 (comment) + other reasons.

I agreed with him then and still do.

Reading the final PR #482 again, there was no opposition,
apart from important remarks, all taken into account (thanks !).

@GeraldJansen
Copy link
Contributor

@ederag The fact that I didn't provide further opposition to the double comma doesn't mean that I liked it. In fact, I agree that the decision could and should be revisited. It could be done without reducing the rock solidness of the parser.

@mwilck
Copy link
Contributor

mwilck commented Dec 14, 2020

My €0.019 here.

GeraldJansen added a commit to GeraldJansen/hamster that referenced this issue Dec 23, 2020
This PR reverts the use of a double comma to indicate the start of the
description, a breaking change introduced in Hamster 3.0, back to the
previous use of a single comma, as discussed in projecthamster#657. Likewise, the
double comma needed before tags, in the case of descriptions containing
the #hash pattern, is also reverted to the use of a single comma.

This change requires two restrictions to the parsing rules. Firstly,
no comma is allowed in the activity name (projecthamster#270). Secondly, tags
may not be separated by a comma when entered on the commandline
(ie. just use `#tag1 #tag2`, not `#tag1, #tag2`).
@ederag
Copy link
Collaborator

ederag commented Dec 26, 2020

As a reference, here are the v3.0.0 rules (from the help):

  1. Specify specific times as 13:10-13:45, and "started 5 minutes ago" as -5.
  2. Next comes the activity name
  3. Place the category after the activity name, and start it with an at sign @, e.g. @garden
  4. If you want to add a description, add a double comma ,,.
  5. The description is just free-form text immediately after the double comma, and runs until the end of the string or until the beginning of tags.
  6. Place tags at the end, and start each tag with a hash mark #.
  7. A double comma ,, can also be placed to indicate the beginning of tags. Otherwise any # in the activity, category or description would be interpreted as a starting a tag.

Change between v2 and v3:
Double comma before description
and possibly before tags (people happy with the old syntax can continue to enter tags without comma).
Clear and simple, except perhaps for someone used to a single comma before description.

The parser then became fully robust and general enough.
The only drawback is that the same key has to be hit twice where once was needed (before description).
Apart from that, the new parser accepts all of the old syntax.

matthijskooijman pushed a commit to rhertzog/hamster that referenced this issue Apr 29, 2023
This PR reverts the use of a double comma to indicate the start of the
description, a breaking change introduced in Hamster 3.0, back to the
previous use of a single comma, as discussed in projecthamster#657. Likewise, the
double comma needed before tags, in the case of descriptions containing
the #hash pattern, is also reverted to the use of a single comma.

This change requires two restrictions to the parsing rules. Firstly,
no comma is allowed in the activity name (projecthamster#270). Secondly, tags
may not be separated by a comma when entered on the commandline
(ie. just use `#tag1 #tag2`, not `#tag1, #tag2`).
@matthijskooijman
Copy link
Member Author

This was resolved by merging #663.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants