Introduce configurable urgency mechanism akin to Taskwarrior

I really like Taskwarrior’s approach at implementing an urgency mechanism. In short, what they do is calculate what they call an urgency score for each task based on various attributes, such as dueness, priority, content rules, labels, projects, and relations to other tasks. The weight of each of those attributes is user-configurable. That way, it is possible to tweak the weights in a way where, if you sort the tasks by urgency, it lines up closely with the ideal order in which you feel the tasks need to be approached. It enables you to get into a workflow where you just keep adding tasks to Taskwarrior and it automatically ranks them, so if at any given point in time you’re not sure what to do next, you can simply look at the top of the task list sorted by urgency.

I still prefer Vikunja over TaskWarrior, but this is a feature I would really like to see. I feel like it would make the overview page even more powerful, as you would have everything in one place: The input box to add new tasks, an overview of currently relevant projects, and a list of the things that should be done next. This already works well for tasks that have a due date, but anything else tends to get buried over time.

I seem to not be alone with this: @JesusSanchez456 was looking for the same thing a while ago, and Vikunja client vja even implements some of that logic on a client level already.

However, I feel like it should be part of the server component instead. That way, a user would be able to set their preferred weights once and have their tasks consistently ranked to their liking afterwards – no matter if they view them in the Vikunja web app, the Android app, in the daily report email or in a third-party client. And for those who don’t like it, there could be a toggle that lets them use the original Vikunja ordering instead, just like it’s already possible to choose between Vikunja and Todoist syntax for the quick add magic.

2 Likes

Welcome :waving_hand:

I really like that idea. Not sure if we can implement it exactly like TaskWarrior, but I’m sure we can do something similar. And I have no good solution on how to make this performant yet.

I’ve added an item to the backlog about this, but I can’t promise this will be implemented quickly.

1 Like

This is exactly the thing I’d love to see! This would be really helpful for me when sorting all of my projects’ priorities on a single pane of glass.

If it is helpful: I might break down my own weighted sortables into urgency, impact, hours remaining, and project priority.

@kolaente If you’d like a hand, please shout!

I would love a PR for this!

I think the first version could be implemented relatively easy: For each user, save a list of filter with an associated score. The logic is simple: for each task, evaluate all filters the user has configured. If the filter is true, add the score to the urgency of that task. Once all tasks are scored, sort the whole list by that number.

This seems similar to what Taskwarrior is doing, but because it’s implemented with filters, it’s the most flexible.

Now, to make this performant, I’d store this in the database. A new table (task_id, user_id, score) and then some events and listeners to automatically recalculate this when the task details change. That way, sorting by urgency is fast.

Once that’s done, I’d think about the default configuration for this and a way to make users aware of it.

1 Like

Sounds good! I’ve started a thread in Matrix here to continue the discussion, perhaps in near-realtime.

Taskwarrior has a time component as well. Which means the urgency score has to be recalculated based on time (maybe once a day).