alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
101 stars 9 forks source link

Tod Task List: Sorting/Weight/Scoring system for tasks #354

Closed titoOdUA closed 8 months ago

titoOdUA commented 1 year ago

Ability to sort tasks by weight or scoring. Tasks have parameters. Different parameters have different modifiers or weights. Those weights form the final weight or score of the task that can be used for sorting and help to determine which tasks are more pressing at the moment.

We can draw some inspiration from taskwarrior, for example. https://taskwarrior.org/docs/urgency/

I guess it can be viewed as an alternative to the rank system that is implemented at the moment so maybe it is unnecessary. But for me, the rank system isn't really working. (99% sure that it is a "me problem")

@alanvardy I wonder what you think about it? =)

alanvardy commented 1 year ago

Yes, I think this is a great idea. Currently I give a "value" to each task here: https://github.com/alanvardy/tod/blob/0d8fce6e90913a45da68c97ba2ebfad94c719898/src/items.rs#L139 but of course the values are all hardcoded and it would be great if the user could set those numbers themselves.

I sum up the value of each task based on the date field and priority, do you think that we need to add any more fields to the calculation, or just make the current values adjustable?

I think that it would be great if we could put the values in the config, and have defaults so that functionality is not broken for current users.

stacksjb commented 1 year ago

In my workflow, I prioritize tasks based on 1) Priority then 2) Due (date) (so I get all p1 that are due, then all p1, then all p2 due, then all p2, etc), where "due date" means overdue or due today (prioritized, after priority, on date)).

For example, I might get a P1 task that is overdue done first, then a P1 due today, then 2 p1s with no due date, then a p3 with a due date, then a p3 with no due date, then an overdue p4... and so on (so within priority, by due/overdue)

(This assumes I have already bucketed tasks into contexts; I'm only doing this comparison within a specific context to begin with)

titoOdUA commented 1 year ago

I sum up the value of each task based on the date field and priority, do you think that we need to add any more fields to the calculation, or just make the current values adjustable?

I think that it would be great if we could put the values in the config, and have defaults so that functionality is not broken for current users.

Yeah, this sounds good as a first step at least. After that, we can think about further customization if we need to.

For example, I see the next step as the ability to work with labels. Users can opt in and specify the list of labels and corresponding weights. These weights would influence the final scoring. I think it would be really flexible and easy to implement.

stacksjb commented 1 year ago

I would recommend that as far as actual task 'priority' we just use what Todoist includes and not replicate any additional details on tasks themselves.

Howvever, from a workflow perspective, I would love to see some of defined 'sort' that would then be used when displaying tasks (or when doing the "tod task next" workflow), basically replicating the "sort" options within the official app

For example, I could say "Priority, then due date, then oldest task_created date"

The sorting methods could be predefined and set in your global config, maybe as a list of options (you could then choose from as part of your initial config).

(It's also worth noting that once labels and/or filters are added/supported, users can customize those for what they want to have returned). Supporting filters would all you to customize/exclude what you want returned in the filter, then we can jsut focus on the sorting of task priority within the tod CLI.

For my workflow, I start from a filtered set of tasks (those I have already labelled as to be completed/done) and then sort by priority, then due date (P1 tasks with a date, then p1 without, then p2 with, then p2 without, and so forth). I would love to add "by date created, oldest first" after those two to lower my task age)

Other common methods I see are by due date only, then priority, or even by specific project/label, or even alphabetical (for numbered tasks)

@titoOdUA @alanvardy how do you prioritize/rank your tasks?

titoOdUA commented 1 year ago

For example, I could say "Priority, then due date, then oldest task_created date"

The sorting methods could be predefined and set in your global config, maybe as a list of options (you could then choose from as part of your initial config).

Personally, I don't really see a need to save them in the config, sorting in todoist is pretty limited and can be easily provided as a command argument.

I plan to prioritize tasks based on to be created weight/scoring system that would take labels into consideration. Then I plan to just process (the due today and overdue tasks) via weighted sort. Determine what I would do today and reschedule the rest if needed.

stacksjb commented 1 year ago

The reaoson I think of the config is because of the usage of something such as "tod task next" and how it determines priority.

Certainly could override that but I'd like to just be able to grab the next according to predefined priority parameters.

alanvardy commented 1 year ago

Yeah, for process and next we need some sort of hierarchy of importance, but obviously what is important differs from person to person.

Perhaps for the first iteration we can just add the current options to config so that a person can define their own priorities, then iterate on it by adding labels, then multiple sorting options.

stacksjb commented 1 year ago

I was pondering on this today and thought of how if I run "tod task list" I just get a chunk of tasks, I would definitely also like that list sorted and grouped.

We could add a --sort parameter (which is probably a good idea), but for most use cases I would prefer using some sort of predefined sort.

stacksjb commented 8 months ago

This came up again today for me and is probably one of the more minor but critical things for me - I am now using Tod much more heavily for daily work. Using any of the "Tod Task next", "Tod filter process", etc commands gives me tasks as hardcoded in the above code, which gives me inconsistent results when I have tasks that are overdue but low priority.

For me, I want tasks to be returned in priority order first (I shouldn't start work on any P2 tasks until P1 are done, and P3 are after P2 are done, etc, regardless of when they are due). I have several recurring things that are "due" every day but don't actually need to be done every day in every case.

@alanvardy would it be possible to add weighting/scoring to a config method? It seems that if that was customizable I could tweak it easily to return them in the order I'd like.

stacksjb commented 7 months ago

Thank you! I tested this and it works well and is documented well.