Annotating Productivity and Visualizing#162
Annotating Productivity and Visualizing#162nicolae-stroncea wants to merge 4 commits intoActivityWatch:masterfrom
Conversation
Should be simple to fix right? Assuming "Unknown Productivity" if nothing is set |
johan-bjareholt
left a comment
There was a problem hiding this comment.
Great idea! needs some more work though
| productivity: -1, | ||
| parent: [], | ||
| }, | ||
| productivity_description:{ |
There was a problem hiding this comment.
I don't think this is a good way to do it.
Don't ever set "Unknown Productivity", in that case just don't set the productivity for that rule and make the transform skip that rule.
Then for example set 0 as neutral, 1 as productive and -1 as unproductive. Then you could for example later give the productivity score for a day/week/month/year a scale from -1 to 1
There was a problem hiding this comment.
@johan-bjareholt
are you saying to completely remove the attribute if it's never set? If we don't set it to anything, then some categories will have a productive attribute, some won't, which might complicate the checking that needs to be done when we're parsing events. What do you think about flipping it instead to: "not productive":-1, "neutral":0, "productive":1, "unknown":2.
There was a problem hiding this comment.
are you saying to completely remove the attribute if it's never set? If we don't set it to anything, then some categories will have a productive attribute, some won't, which might complicate the checking that needs to be done when we're parsing events.
Change the transform to ignore calculating productivity on events which do not have a productivity set.
What do you think about flipping it instead to: "not productive":-1, "neutral":0, "productive":1, "unknown":2.
See my comment below about I'd prefer if it was a range from -1 to 1 rather than static enums.
nicolae-stroncea
left a comment
There was a problem hiding this comment.
Will work in a completely new environment(or if defaults are reset), but there are currently bugs if you start it in an environment where Productivity has not yet been set for already existing categories.
Should be simple to fix right? Assuming "Unknown Productivity" if nothing is set
@johan-bjareholt
That's what I was thinking as well. So I implemented that in in the most recent commit I just pushed. I'm still getting the same error, which is difficult to debug. I'll have to debug further to figure it out.
| productivity: -1, | ||
| parent: [], | ||
| }, | ||
| productivity_description:{ |
There was a problem hiding this comment.
@johan-bjareholt
are you saying to completely remove the attribute if it's never set? If we don't set it to anything, then some categories will have a productive attribute, some won't, which might complicate the checking that needs to be done when we're parsing events. What do you think about flipping it instead to: "not productive":-1, "neutral":0, "productive":1, "unknown":2.
|
This is really nice work, but I kinda had this use-case in mind when I designed categorization. So I already have some opinions on how I think this should be done, and it's somewhat different. When I built the categorization stuff, the intention was for the user to be able to create multiple sets of categories. One is the "user set" that we have today, one could be an open/standardized set, and one could be a "Productive/Unproductive" set. A query would be something like: events = get_events()
events = categorize(events, cats_user)
events_productive = merge_events_by_key(categorize(events, cats_productivity), "$category")This has some benefits:
Note that you can still categorize productivity using previous categorization data, since "$category" is just an event attribute which will be used in categorization. It makes rules applicable to categories, instead of making specific categories applicable to rules (which is what this way of doing it does). What do you think @nicolae-stroncea and @johan-bjareholt? Sorry I didn't really write about these plans anywhere before you put a bunch of work in it, but I could build it on top of these changes so it comes to use and you get your credit 🙂 |
@ErikBjare not a problem, I should have probably asked as well to confirm whether there was anything in the works and what the general ideas were on the implementation. The commits are now in the PR's for aw-webui and aw-core, so feel free to take the bits and pieces that fit with your implementation. |
Agreed, however if you could weigh it as 1.0 for "very productive", 0.5 for "productive" and -1 for "very unproductive" it would be an acceptable start as we could in the future upgrade that to a smarter algorithm for weighing the productivity.
I agree that it's stupid that it's so black-and-white (either productive or unproductive and nothing in between). Otherwise I don't see it as a flaw that it's better to leave the computer to avoid slacking at the computer even though your AFK time could potentially be unproductive. Do you have any more reasons? |
|
I just want to add here that ActivityWatch/activitywatch#416 would work really well with my proposal for how this feature should be built (multiple category-sets). |
|
Hey @nicolae-stroncea, I just wanted to tell you how much I appreciate your work on this PR even though it might not be merged. I'm still not convinced of the best/cleanest way to implement this, but this PR really got the gears turning and I'll try to salvage whatever I can from this PR when we eventually get around to it, so you get your commit-credit where due 🙂 And regarding 'point scoring', I found this post: https://samplesize.one/blog/posts/my_year_in_data/
I think it's a pretty neat idea, and I like the approach to simply let the user score their categories themselves. Users could set single-digit points like in the post, or a dollar value, or whatever they like. |
|
@ErikBjare I really like the idea of scoring each category. This gives the user full flexibility of choosing whether they want the standard Productive:1, Unproductive:-1, Neutral:0, or something more powerful that is custom to their preferences. Here's a possible approach: Implementation:
New views:
EDIT: To make this even more flexible, the productivity score for a category could be set to any real number. This would not require any added complexity since JavaScript's number type allows floats, and it can be stored as Real data type in SQLite. EDIT 2: Added images for visualizations. |
|
@ErikBjare if above implementation makes sense to you and @johan-bjareholt , I can modify this PR accordingly. I'll be busy for a couple of weeks but I can give this a shot once I free up some time. |
|
@nicolae-stroncea I've rebased this PR on master and adjusted a few things in #258 which makes the implementation a lot simpler (no need to add a transform to the backend). Once I realized the similarities between the 'productivity score' and the category colors I implemented in #254 it became pretty clear how this should be implemented, and I anticipate we can get it merged pretty soon! I appreciate you might not have much time in the coming week, but I'd be really grateful if you had a look and reviewed it :) |
|
Closing this since #258 was merged |



Known Issues