Great stuff, thank you @talha131. I’d welcome tiddlywiki.com updates – perhaps we could expand the task management examples into a series of progressive lessons that gradually add features.
Use <$action-listops> instead of “tm-remove-tag” and “tm-add-tag”. This eliminates the need for the surrounding <$fieldmangler> widget.
Add some newlines and indentation for improved code readability.
Thus, TaskManagementExample (Draggable) would contain:
This is a version of the TaskManagementExample enhanced with the ability to drag and drop the task list to re-order them.
! Outstanding tasks
//Drag the tasks to re-order them//
<<list-tagged-draggable tag:"task"
subFilter:"!has[draft.of]!tag[done]"
itemTemplate:"TaskManagementExampleDraggableTemplate"
emptyMessage:"<div>You don't have any active tasks</div>">>
! Completed tasks
//(Listed in reverse order of completion)//
<$list filter="[!has[draft.of]tag[done]!sort[modified]]"
emptyMessage="<div>You don't have any completed tasks</div>">
<div>
<$checkbox tag="done" uncheckactions="<$action-listops $tags='-done +task'/>">
~~<$link/>~~
</$checkbox>
</div>
</$list>
and TaskManagementExampleDraggableTemplate would contain:
I think it’s not necessarily a pollution. .. The task is still a task. It’s done.
The main problem with your solution for me is, that a done task, if opened as a tiddler in the story river has no evidence anymore, that it has ever been a task.
It’s tagged: “done” and “TaksManagementExample” .. but “task” is missing now and that is “loss of information” which I think is a problem.
It may be only me, but that’s how I see it. Tiddlers should contain enough information, that they are useful if they are used alone.
I’m in agreement with @pmario… just because a task is completed, doesn’t mean it’s no longer a task. To retain the “task” tag in my previously posted code, make the following changes:
in “TaskManagementExample (Draggable)”, change <$action-listops $tags='-done +task'/> to <$action-listops $tags='-done'/>
in “TaskManagementExampleDraggableTemplate” change <$action-listops $tags='+done -task'/> to <$action-listops $tags='done'/>
Note that this also fixes a problem where using “+task” and “+done” was also removing any other tags on the target tiddler.
Ah. I see now why you want a separate todo tag. You can then arrange tasks in order of their priority by dragging them in the todo tag pill popup without the “pollution” of the done tasks (that would still appear in the task tag pill popup).
But is that something you’d propose for the official TaskManagement Example - or is it just for your own stuff? If it is for your own stuff… then just tag the tasks any way you want
I think it’s not the TaskManagementExample problem you want to solve it’s “Can a tagpill always be used to sort by priority”. I think the TaskManagementExample in the docs, should stay as it is.
The problem “Can a tagpill always be used to sort by priority” can be discussed here.
and imo the answer is “no” … because
The system with sorting with a tag-pill will break down as soon as you have 2 projects/contexts, that can use the same tag to identify “what is a task”. eg:
The stepdaughter has to
take out the bread
harvest apples
make the bed
Frodo has to
get the ring
go to Mordor
find a way in
At the beginning all responsibilities may be tagged “task” or “todo” … But they can’t be prioritized using the “task” or “todo” tag pills, since the “assignees” or the “context” is a different one.
The priority information is bound to “the context” and the “task”, so both of them have to be uses to create a priority list.