Watson icon indicating copy to clipboard operation
Watson copied to clipboard

Add git commit-like comment on watson stop

Open speedRS opened this issue 9 years ago • 22 comments

This would be useful to provide historic context for a given time entry. Admittedly, this could possibly be handled via tags but I a description of "updated project estimates spreadsheet" vs. +project +estimates +update (or something similar) would make more sense.

An example of what I'm thinking is:

$ watson start .... $ watson stop ....

Then open default editor (akin to watson edit <frame ref>).

Alternatively, add an additional flag -c "some kind of comment or note".

speedRS avatar Feb 22 '16 01:02 speedRS

I have mixed thoughts about this proposal. A way to attach a longer note to a watson frame seems desirable. But:

  • It shouldn't change the established command line interface, i.e. I should still be able to start a frame with just "watson start project" without an editor opening up (also consider use in wrapper scripts).
  • I fear that trying to do too many things with watson, i.e. in this case trying to use as a project log instead of just a time tracker, might in the long run add to omuch bloat and make the interface un-intuitive. git is a particular bad example of UI design, IMHO.

SpotlightKid avatar Feb 22 '16 15:02 SpotlightKid

Personally I like the idea to add a short report to a working session. But it shouldn't be the default behavior, @SpotlightKid made the point.

jmaupetit avatar Feb 22 '16 17:02 jmaupetit

All good points and I agree on them all. The -c/--comment (or whatever works) would be an optional flag. The primary reason is context for my use case. There are times where all I need to track is time spent on a project; other times, we're expected to provide a brief note on what was worked on during that period for billing/justification purposes.

As some background, I'm currently oscillating between org-mode, a phyiscal notebook and Google Spreadsheets (I haven't settled on anything I'm 100% happy on and this has been cycling for about 2 years). Ideally, I don't want something as bloated as org-mode. I just like it's capabilities for time tracking and Watson seems a good replacement/fit without all the extra crap.

As I'm thinking about this, I wonder at which point the note should/could be entered. In some respects, on clock out almost makes more sense as you will have completed the work at that point. The only issue I see then is autoclockout on starting work on a new project, unless there is say a config item to pop up an editor, get a comment, clock out and start the new clock. Again, that sounds way too git-like but it's the best example of workflow I can think of at the moment.

Anyways, happy to discuss more if you think this is something you'd be interested in.

speedRS avatar Feb 23 '16 12:02 speedRS

Apologies - I keep clicking close and comment.

speedRS avatar Feb 23 '16 12:02 speedRS

:+1: for adding messages to frames. This is actually something that Watson was doing in its first days, and then I removed it in order to focus more on tags.

Adding a -m option to watson start seems to be a good place to start. Of course messages should also show up in watson edit and in the log.

k4nar avatar Feb 23 '16 12:02 k4nar

Thank you @speedRS for telling us a bit more about the context. Why would you "autoclockout"? I don't think it's a good idea, a simple notification system like the one proposed by @SpotlightKid or @yloiseau would do the trick.

Side note: IMO we should add this -m flag (to stay git-like, @k4nar is right) to the stop command not start.

jmaupetit avatar Feb 23 '16 13:02 jmaupetit

You're right it would be better on the stop command :+1: .

k4nar avatar Feb 23 '16 14:02 k4nar

@jmaupetit Regarding autoclockout, I'm referring to this:

[options]
stop_on_start = true

If that's enabled, I'm thinking either you notify or launch the default editor and ask for a comment on stop before starting the new timer. That in itself could and probably should be an optional config item for those that never want to add comments when stopping on start. I think of the stop_on_start functionality more as a convenience though so I'm not sure what your thoughts are on the feasibility of having this for both:

  • a CLI flag for a user-initiated stop (ie. -m)
  • a Watson-initiated stop as a result of stop_on_start=true when calling a subsequent watson start.

They are two linked but separate requirements in a sense.

speedRS avatar Feb 24 '16 04:02 speedRS

I've thought about this some more and have one final suggestion which, in mind my, probably should override all the above suggestions:

Decouple -m from watson stop or watson start entirely. This solves the above stop_on_start issue. Simply have a command like watson -m <insert short note here>. This would then follow this logic:

  1. If timer is active, add note to frame "message" array to allow 0..n notes per frame.
  2. If timer is inactive, display error (eg. cannot add a note as no timer is active).

Knowing the code base better than I do, what do you think?

speedRS avatar Feb 24 '16 23:02 speedRS

Your last message makes me think that there is no need for a new command or flag to achieve this. Simply add support for a message field in a frame object will do the trick with the edit command:

{
    "project": "crick",
    "start": "2016-02-25 09:16:26",
    "tags": [
        "tailordev",
        "community",
        "watson"
    ],
    "message": "This is my log message."
}

And if editing a raw json object is not user-friendly for watson users, we can put some efforts on the edit command interface.

jmaupetit avatar Feb 25 '16 08:02 jmaupetit

Making a command line wrapper for editing should be easy and is more user-friendly IMO. I like the idea of a -m option for the stop command.

SpotlightKid avatar Feb 25 '16 16:02 SpotlightKid

I still think there's a need for the command line flag. A quick throwaway note in a single command is a little less involved than popping up the editor and navigating to the section you want to edit (unless something can be achieved there to simplify the UX). I think the main intention behind my request is to take the path of least resistance to adding a note to a given frame (be that while it's running or on stopped). I'm happy either way :smile:

speedRS avatar Feb 25 '16 22:02 speedRS

I also like the idea of watson stop [-m|--message="A note of what I just did"]

loonies avatar Mar 03 '16 11:03 loonies

I'd love the ability to add messages to a frame either when stopping or starting a task. A good intermediate step though would be to allow manual editing of the frame JSON with a "message" or "note" key.

bryanjswift avatar Mar 30 '16 20:03 bryanjswift

I'll try to implement those messages as soon as I have some time. In the mean time, if someone else wants to try to give it a shot, go ahead :) .

k4nar avatar Mar 30 '16 21:03 k4nar

There's now a PR that implements this: #119

SpotlightKid avatar Jun 15 '16 20:06 SpotlightKid

@jmaupetit Is there anything I can do to help out here? I would really like to see this feature implemented.

PRs:

  • #119 Closed in February 2019
  • #252 Draft opened but has seen no comments since its creation in February 2019

prat0088 avatar Nov 08 '19 22:11 prat0088

Maybe we should ask @jnsebgosselin if you can work together on this or take the lead if Sébastien is missing free time to wrap up his contribution?

jmaupetit avatar Nov 12 '19 09:11 jmaupetit

@jmaupetit As someone who has used a dozen other timers, I would like to suggest we add --message flag to start, too. This appears to be a common feature. For example, Clockify's UI)

I know watson isn't meant to be a task manager, and neither is clockify. But I find it helpful to stay focused. For example, if somebody walks to interrupt me, and I get back to my computer 5 minutes later and forget what I'm working on, I can do a 'watson status' and see the log message.

This has the benefit of being able to log messages using --no-gap:

watson start foo -m "Working on save bug" watson start foo -G -m "Updating documetation" watson start admin -G -m "Replying to email before going home for the day" watson stop

I really like the idea of that usage.

If the user starts a timer with a message and ends the timer with a message, the start message could be overwritten by the stop message, or perhaps appended.

@jmaupetit Thoughts?

prat0088 avatar Nov 16 '19 22:11 prat0088

@jmaupetit I'm new to watson so please check my understanding:

Report and aggregate don't seem to print individual timing information, so the only other command that needs modification is the log command.

Do you think we should truncate the log messages to stay within 80 char col convention for terminals, and add a flag to print the whole log message? Or we could print it on the line just below the existing line, so each entry takes up two lines. The color would be light gray so it's not distracting when you're scanning columns, but still visible if you want to inspect it.

prat0088 avatar Nov 16 '19 22:11 prat0088

@jmaupetit Any thoughts on the previous two comments?

prat0088 avatar Dec 03 '19 20:12 prat0088

Ok for adding a -m flag to the stop and the start commands.

Concerning the log command I would prefer having the message in a new line below the frame metrics (ok for the gray color).

In brief: we put our trust on you :muscle: :pray:

jmaupetit avatar Dec 04 '19 10:12 jmaupetit