Leonezz / obsidian-tasks-calendar-wrapper

This plugin currently provides a timeline view to display your tasks from your obsidian valut, with customizable filters and renderring options.
MIT License
189 stars 11 forks source link

In-progress task without due date or scheduled date will disappear #129

Open sqybi opened 4 months ago

sqybi commented 4 months ago

"Unplanned" panel shows all to-do ([ ]) tasks without due date or scheduled date.

However, if one unscheduled task is now in-progress status ([/]), it will not appear either in "Unplanned" panel or in "Todo" panel.

Should we keep those kind of tasks in "Unplanned" panel, or show them in a new channel, in case users lose their tasks?

tejas-hosamani commented 4 months ago

This is working fine for me

LeCheenaX commented 2 months ago

Same Issue here.

Issue Description:

In addition, the issue is not defined to tasks with process status [/], but also scheduled tasks [<]. The cancelled tasks are fine without any issues. image

For your convenience I add the names of tasks status from main.js image

Repro Steps:

Copy the following into anywhere valid of your md file:

Expected Result:

The count of ToDo will add 2, and the tasks will be displayed in taskList whether with ToDo Filter on or not.

Analysis:

I suppose that the issue is regarding dataview. The tasks with anything filled in the blanket '[ ]' will be marked as done, rather than todo, in dataview. Thus, similar mechanism as [>] will be counted correctly into overdue should be applied to both [<] and [/].

Temporary Workaround:

Go to the your obsidian folder: .obsidian\plugins\tasks-calendar-wrapper\main.js

Press ctrl+F to find "const todoCount", you will find the following:

    const overdueCount = taskList.filter((t) => t.status === "overdue" /* overdue */).length;
    const unplannedCount = taskList.filter((t) => t.status === "unplanned" /* unplanned */).length;
    const completedCount = taskList.filter((t) => t.status === "done" /* done */).length;
    const cancelledCount = taskList.filter((t) => t.status === "cancelled" /* cancelled */).length;
    const todoCount = taskList.length - unplannedCount - completedCount - cancelledCount - overdueCount; 

Now replace the last line with the following codes:

    const processCount =  taskList.filter((t) => t.status === "process" /* process */).length; // Lex added
    const scheduledCount =  taskList.filter((t) => t.status === "scheduled" /* scheduled */).length; // Lex added
    const todoCount = taskList.length - unplannedCount - completedCount - cancelledCount - overdueCount - processCount - scheduledCount;  //Lex Test Modify, this is wrongly counted, the fix is to contain other situations into unplanned/todo

Then the counting is fixed as follows: image The tasks with [<] and [/] will not be counted into Todo anymore.

However, it would be best to incorporate Todo with process/scheduled tasks that do not have a due, which should be a final fix.

LeCheenaX commented 2 months ago

"Unplanned" panel shows all to-do ([ ]) tasks without due date or scheduled date.

However, if one unscheduled task is now in-progress status ([/]), it will not appear either in "Unplanned" panel or in "Todo" panel.

Should we keep those kind of tasks in "Unplanned" panel, or show them in a new channel, in case users lose their tasks?

@Leonezz May you have a look on this when available?

sqybi commented 2 months ago

@LeCheenaX Great job! I had planned to create a new Vault and reproduce this issue, but I haven't had the time yet. I agree that there should be a final fix for these kinds of tasks to add them to the Todo list.

Leonezz commented 2 months ago

"Unplanned" panel shows all to-do ([ ]) tasks without due date or scheduled date. However, if one unscheduled task is now in-progress status ([/]), it will not appear either in "Unplanned" panel or in "Todo" panel. Should we keep those kind of tasks in "Unplanned" panel, or show them in a new channel, in case users lose their tasks?

@Leonezz May you have a look on this when available?

Thanks for the work to find out the issue here, I will take a look and work out a fix this weekend.