Implemented tagging in stopwatch#215
Implemented tagging in stopwatch#215nicolae-stroncea wants to merge 7 commits intoActivityWatch:masterfrom
Conversation
|
Introduced couple of changes:
Currently, you can add tags to an event only by editing it(in the modal box), so many users may not be aware of the feature + it requires an extra click. It would be trivial to add an input field for tags next to the label one, so you can write both the Label and the tags when starting a new event. I can add that in, if you think that's a good idea. Could look something like this: Tested following cases (which I think covers all interactions):
|
ErikBjare
left a comment
There was a problem hiding this comment.
Looks good! A few comments.
|
@ErikBjare I had some more time to think about this, and thought of another possible implementation:
Advantages:
Disadvantages:
I think functionality wise, it would be the same, and a similar dropdown could be implemented using current approach(by looping through all events, and building the dropdown) |
|
I'd rather implement a solid, simple, solution that solves 80% of the problem (like what's already in the PR) than try to engineer a perfect solution that takes 10x as long to implement and maintain. I agree there needs to be a way to make this work well with categories, but I don't think creating a tags key-value table is the right way. Tags should be stored with events imo, otherwise they are lost on bucket export (they could be stored in
There is already an API for this in aw-server-rust, so that isn't really an issue.
I like this idea (it's how Toggl works), but we could just simply check the most recent tags and list them. Maybe @johan-bjareholt could give his 2¢? |
|
Tags definitely should be saved in events, I think the question should rather be if we want to store favorite tags or something like that. Whether they should be connected to actual categories or not I'm not sure. Need to think about that a little more.
I think both could be useful, we might suggest both the most recent tags as well as be able to pin/favorite a tag (the former not needing key-value and the latter requiring it). Both are valuable features in different ways, most recent gives a quick and automatic way to recommend a tag while the favorite/pin would be manual but reliable. I guess it's a matter of taste whether we should use the first, second or both. |
|
@ErikBjare @johan-bjareholt here's how I'm thinking a dropdown might work: dropdown will show events in alphabetical order, with top being "Add new Event". When you select an event, it will also selects the most recent tags for the specific event. Because users now have to fill out an extra field, to minimize user effort and time spent choosing, we should ideally have some mechanism which automatically adds the right tags for the event that you choose, minimizing errors. This is especially important if you use the stopwatch feature often. I think picking most recent tags for that event is a good heuristic for that. Doesn't have to be a dropdown just something which automatically tags events for you. EDIT: Another option would be to have a new view: Choose from Past Events, above History, where we show a list of unique event names you've created so far, with a heuristic for their tags (most recent tags/most popular tags/etc). This view would be pretty similar to the History view except for no duplicates and different sort mechanism. Currently History view is great for replaying past events if you have only a couple, and don't use the stopwatch often. I use the stopwatch multiple times daily, and searching for an event that I did last week can lead to a lot of scrolling sometimes. |
|
This is on a slight side note, but should this be removed: This is an early experiment, an important missing feature is the ability to set start/end times manually.? It looks like it is already implemented. I can add it in one of the commits |
|
I played around with it and added a dropdown. I also moved the Start button on the new line, to better accomodate narrow width devices. When you select an item from the dropdown, it will automatically fill in the tags with most recent tags for that event. If you change the tags from the default, it will create this event with the new tags, but won't change any past events, which is the intended behaviour. Mobile view: |
Yes this can be removed. There's still a few things which I'm kind of confused about. Sorry for being a bit picky, but I'm a bit afraid of doing the data structure of this wrong because if we do and want to change it in the future we need to write some kind of migration which will be a lot of work. It's less work to get it right from the start. The UI looks really good, but I don't think it's clear to the user how to specify multiple tags. EDIT: It would work though if only the task (but not the tags) can be assigned to a category. |
|
@johan-bjareholt assigning the task (instead of the tags) to a category makes sense. Would that information be stored similar to how the categories in the settings will be stored? |
I don't know how that would be stored, it will be very hard to get working nicely because it would create dependencies between the bucket and the categories (and the categories can be removed at any time, so the category might break). I think we should postpone that idea. I also realized something else from earlier:
While the implementation is simpler, the data format is less portable. |
|
Re categorization: I assumed we'd deal with the stopwatch events like any other events. Let them be categorized by rules like everything else. Categories should not be stored with/assigned to events.
I agree with this. I don't like the idea of storing lists as a comma-separated string. |




This is the updated PR for: #161
Created a new one cause the old commit history was too messy to fix and rebase.
From old PR: