Tasks and todo lists in Streams

@well-noted in case it is of interest or inspiration, here is a screenshot from a quick hack I did for Streams a while back to use it as a todo list for a project:

It uses a very basic WYSIWYG editor (that only supports basic text formatting) and does away with the need to switch between view and edit modes.

2 Likes

I’d love to know more about the approach you took to the hack :slight_smile: My todo is a streams-row-body condition for items tagged TODO, which is toggled in streams with ctrl-shift-t, which gives me a lot of flexibility to create lists of todos among other types of tiddlers

image

Since all items in your list are todos, I can’t tell if you took a similar approach or if all items in this hack must be todos

1 Like

My wiki is currently 50MB and I often have pretty long stream-lists rendered in the story river among different tiddlers at once, all displayed through different tag templates – Streams has never been the slog for me (Soren’s Reference Explorer does bog things down quite a bit when there are many items in a stream-list, but turning it off immediately makes performance return to normal)

I don’t have the code at hand to refer to and it has been a few years, however as I recall I used the field stream-type set to task as the trigger for showing a different UI. This field was always intended to distinguish between different node types.

Since I wanted to remove the distinction between view and edit modes for tasks, I overwrote stream-row-body to use the WYWIWYG editor widget.

Editing stream-row-template - which makes future upgrades more difficult and might be an area that needs more extensibility - I added the checkbox widget and also classes to the node container that are based on the value of the stream-type field for styling. I would consider adding extensible support for the latter in the future, based on a similar mechanism to the one now used by the core for the page template and story tiddler template.

I assumed as much and thought about taking a similar approach, but I thought technically not all tasks have to be streams (although they almost entirely are in my case), so tags are more helpful for other lists.

I have also modified my stream-row-template but only to add draggable attributes for making streams lists compatible with other droppable elements, and also to change the state tiddler which controls the collapsed/expanded state into a Boolean value of stream-collapsed so the state persists through reloads.

Recently I did create an alternate stream-row-template though, which includes the TODO-counter logic we talked about recently

Could you elaborate a bit on what was needed? It sounds like the sort of thing that might be worth incorporating into Streams if its generic enough.

I have a branch somewhere in which I implemented this as well as expand/collapse all controls. As far as I can recall, the implementation was more complex than I liked as a result of trying to make minimal changes, and warranted a cleaner rewrite. If I ever get the opportunity I will pick that up again.

Recently I’ve been tooling with @linonetwo 's Calendar layout and I have modified the stream-row-template so I can drag streams items into the calendar and autopopulate with tiddler values. Pretty straightforward, maybe not generic enough in its current form, but might be something to adapt to more general use.

I sympathize with this, I remember it was slightly more complicated than I had expected, but still managed

Relevant pieces of the template:

 
    <div class={{{ stream-row [<currentTiddler>get[stream-collapsed]match[yes]then[stream-row-children-collapsed]] +[join[ ]]}}}
        data-node-title=<<currentTiddler>>
        data-node-tags={{!!tags}}
    >
<$button class="tc-btn-invisible stream-node-ctrl-btn stream-node-collapser" data-btn-role="stream-node-visibility">
                <$action-setfield $tiddler=<<currentTiddler>> stream-collapsed={{{ [<currentTiddler>get[stream-collapsed]match[yes]then[no]else[yes]] }}}/>
                {{$:/plugins/sq/streams/icons/node-expand-arrow}}
            </$button>
<$reveal
    tag="div"
    type="nomatch"
    stateTitle=<<currentTiddler>>
    stateField="stream-collapsed"
    text="yes"
    class="stream-row-children"
>
    {{||$:/plugins/sq/streams/templates/stream-root-template}}
</$reveal>

In my refactered version, you can assign row-template to each different streams instance, so a template won’t make every outliners become todo list.

Oh, I’d be interested in seeing that code :slight_smile:

Sorry, I’m wrong, it is newNodeTiddlerTemplate like <<stream-outliner Index5 newNodeTiddlerTemplate:"$:/plugins/linonetwo/streams-outliner-lib/language/zh-Hans/Name" id:stream-outliner-5>>

not a nodeRenderingTemplate. Still need some refactor, like making part of stream-row-template to be a procecure, and allow user overwrite it by define a local same-name procedure…