-
Notifications
You must be signed in to change notification settings - Fork 250
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
Strange behavior when adding an activity starting by a number #618
Comments
Thanks for the report.
The problem is that hamster interprets the 2nd number as a duration. This is by design (if you look at the "Input" page in the hamster help). It was merged by the previous maintainer @ederag as part of #525 two weeks before the beta release. There was no broad discussion about this change. IIRC, it hasn't bothered anybody so far. In general, the parser has changed quite a bit in 3.0 without a formal specification and without broad community discussion. Note that you wouln't have this problem if your number had 4 or more digits, or if you didn't use a blank after the number. If I'd designed the parser, I think I'd have defined duration as
This seems to be a bug, actually. We have commit 03288b1, merged in #490, which should allow What we'd really need would be a specification for the parser, clearly defining what the syntax would be and how it would be interpreted, ideally discussed and agreed on by maintainers and users. Currently we only have a few comments in the source code (which is more than nothing). I count you as a user who wants activities starting with |
I understand your frustration, and I've cursed GNOME for this myself. But hamster is not part of GNOME any more. Making a complex arser like this configurable is very hard to get right. If we had made this configuratble, most users wouldn't even understand the effect the options would have. And imagine trying to test, or write documentation for, a parser that can be configured to interpret I'm not saying we made all the right choices. Some of this might be up to discussion again, even though we have to be cautious, as some users may have got used to and like the new parser already, and they won't be pleased if we revert certain features. The only thing that might be feasible is to offer a choice between "v2" and "v3" parsers. |
Hi Martin, first very much for your complete answer ! Here are my answers below
Ok, I suspected it but I wasn't sure. I said to myself "no, it can't be a wanted behavior" as I personally would have used
In fact, I wonder why can't I define my own patterns, defining a regexp expression. But maybe this is not as simple as I thought.
Again, I don't think a solution that makes everybody happy could exist. Why not let users define their own regex / parsing class that could be included as plugins ? This would solve all of those questions / complains / problems and let everybody happy. For non technical users, we could easily imagine a main repo for those syntaxes where users can pick their prefered one and activate it by pasting a Python file onto their
Indeed, I never used plain numbers as duration, as I'm using Hamster "in real time"; ie: start / stop. Sometimes I forget to start Hamster (when a client calls typically, it's an activity switching but not initiated by me) but when the call finishes I look at current time and I add an activity knowing the end time. Anyway, I never use that functionality. So in summary I'd say that I'm not sure that an international parsing format could exist, as every user have their needs, that are all. And I see some solutions to make everybody happy (separated by inclusive OR):
Maybe I should open an issue for this idea being discussed. |
I thought ! As the project description in Github is "GNOME time tracker". Maybe should it be "A time tracker for Gnome ?"
Of course I fully understand that a few devs are working on this project, mainly in their spare time.
Maybe all of this could be cancelled with a plugin system letting users code their parser. I'd love that ! Thanks again |
You can include any #tag in the activity name, including numeric values like #999, but you have to end the activity[@category] by @mwilck The wiki page Entering activities was my attempt at getting the parser behaviour formally specified outside of the code. Unfortunately the idea was not fully adopted and the page is out of date w.r.t. the actual changes implemented. |
Sigh, this is so non-intuitive...
Thanks a lot for starting this endeavor. I think we should take it up again. |
TL;DR: Hold on. Fix is simple (IIUC the issue). General discussion started about 4 months before the 3.0 release: #465. @brunetton Thanks a lot for the clear report. So your "long story" use case is already covered. The "short story" is an actual bug, but not in the parser itself, IMO.
It's tempting, but will end up with even more frustration for the user,
About the parser specification. Finally, I recently read the first chapter of "The Legacy Code Programmer's Toolbox", and that's exactly how I approach contributing to old codebases. Couldn't resist to recommend it. |
@brunetton About using for the duration
And @mwilck
As many statements about the parser, Rationale here:
|
IMO, what made it so not intuitive is the bug quickly fixed with f302a57, not the parser itself. To make all this more intuitive, as I said a few months ago,
|
Hi @GeraldJansen. I do not use tags, ever. So I do not want to add tags. I "just" (I know this is relative) want to include a |
Hi @ederag thanks for your answer !
I'm using UI, but in UI in
I think I got your point, and I'll detail it for any user that comes in this thread:
Thanks for pointing this out, I would probably never found this by myself !
Thanks. But I'm confused here: I can't find this commit in branches history. Have this commit been deleted from master and is kind of dangling commit ?
I totally agree on this two points 👍, but letting users write their own parser (of course this do not prevent from using the default one, shipped with project) won't break those 2 rules IMHO
IMHO trying to re-implement a parser is reinventing the wheel, as tools that do the job great out of the box are available, even in Python stdlib.
I understand this. But I doubt that many users need all use cases accumulated along the years. Do we ? Personally I need a very basic parser that I could write in 5mn with a regex (as I don't use tags and I'm fine with adding the category at the end of the "cmdline") Summary
Okay, I'm aware that I'm the guy that comes from nowhere, after years of project life, saying "just do this". But this is just an idea, presented with all my respect and humility ! |
@brunetton Your post reminds me why I'm glad to be out. Q: Hey my custom parser looks good, but the result is strange, could it be a bug in hamster ?
It's not weird if you understand that Also, you may hit But you want a "no-tags mode", that's clear. Most people do not even state the version in their reports... Best wishes. |
Hi
I'm using happily using Hamster for years, and like many many other users, I'm very confused with new behavior (introduced in v3 if I understand well; not sure about this).
"Long" story: why I need to enter activities starting by a number
Before I was using Hamster for time tracking and I used two projects I developed for syncing my work with issues systems:
This scripts used regex to find the issues ID I'm working for. This was straight and simple:
#123 - fix this bug
indicated I was working on issue 123.But since v3 (since using hamster-snap on Ubuntu), I can't use
#123
notation on facts description as Hamster interprets it as a hashtag. I never use hashtags but as the new Gnome philosophy seems to be "no configuration, we choose for you what you need" I can't decide to use tags or not. So I can't use#123
notation anymore.The alternative is to start activities names (facts, in DB) by the issue number; without
#
. For example: "123 - fix this bug".Short story, the concrete example
Steps to reproduce:
ctrl-+
), Hamster gently propose your last activity, socmdline
is17:31 123 - fix this bug
enter
) and observe that instead of starting an activity named123 - fix this bug
at 17:31, Hamster started an activity named- fix this bug
that finishes in the future (at 19:34)The text was updated successfully, but these errors were encountered: