Ideas for a Streams rewrite

I have been wondering if this was on your agenda, and would be very interested in following your progress

1 Like

This would be great!
Could you please implement the ability to define a custom viewtemplate for nodes if this is marked either in the macro or in a stream-template field of the tiddler.

(Thanks @saqimtiaz for branching :slight_smile: )

Can you elaborate a bit more? Custom viewtemplates for streams based on tags or field conditions is (fairly) straightforward.

As has been discussed elsewhere, an update could allow this process to be slightly more user friendly by not requiring modifications to shadow tiddlers

So yes, since we are branching this into a wider topic, I’ll speak a bit more to custom viewtemplates and can go more in depth later if requested.

Currently I have contextual viewtemplates for for stream nodes (by modifying the row-body with conditional statements) and their context menus (by modifying the context-menu templates.

Conditional context menus has been very powerful for me, just a snippet:

 <$list filter="[<currentTiddler>tag[Index]]" variable="indexCheck">
            <$macrocall $name="menu-item" title="Create Idea" subtitle="((create-idea))" actions=<<create-idea-actions>>/>
            <$macrocall $name="menu-item" title="Remove Index" subtitle="((remove-index))" actions=<<removeIndexTag>>/>
            <$macrocall $name="menu-item" title="Adopt parent" subtitle="((adopt-parent))" actions=<<adopt-parent-actions>>/>
            <$macrocall $name="menu-item" title="Add Alias" subtitle="((add-alias))" actions=<<add-alias-actions>>/>
            <<common-menu-items>>
        </$list>

        <$list filter="[<currentTiddler>tag[Place]]" variable="placeCheck">
            <$macrocall $name="menu-item" title="Remove Place" subtitle="((remove-place))" actions=<<removePlaceTag>>/>
            <$macrocall $name="menu-item" title="Add coordinates" subtitle="((add-coordinates))" actions=<<add-coordinates-actions>>/>
            <$macrocall $name="menu-item" title="Add location" subtitle="((add-location))" actions=<<add-location-actions>>/>
            <$macrocall $name="menu-item" title="Rename" subtitle="((rename))" actions=<<rename-node-actions>>/>
            <<common-menu-items>>
        </$list>
				
				<$list filter="[<currentTiddler>tag[Incomplete]]" variable="IncompleteCheck">
            <$macrocall $name="menu-item" title="Mark Complete"  subtitle="((mark-complete))" actions="""<<mark-complete>>/>"""/>
            <<common-menu-items>>
        </$list>
				

As you can see here, in addition to the common-items, which all context menus have, depending on the tags of the corresponding tiddlers, those nodes have additional nodes in their context menus. This works so fantastically that I think an elegant repackaging would be a significant update.

As per the contextual node view, this has been discussed some elsewhere, but it is integral to my workflow:


<$list filter="[all[current]tag[concept]] [all[current]tag[element]] [all[current]tag[reaction]] [all[current]tag[setting]] [all[current]tag[description]] [all[current]tag[character]] [all[current]tag[Notes]]">
  {{||$:/config.template}}
</$list>

<$list filter="[all[current]tag[TODO]]">
<span style="display: inline-flex; align-items: center;">
<$checkbox tag="done"/>
[[TODO|$:/TODO]] &nbsp;&nbsp;
<$button actions="<$action-setfield $field='datepicker-visible' $value={{{ [{!!datepicker-visible}match[yes]then[no]else[yes]] }}}/>" class="tc-btn-invisible" tooltip="Toggle Datepicker">
{{$:/core/images/down-arrow}}
</$button>
</span>
&nbsp;&nbsp; <$button tooltip={{$:/wilk/buttons/add-to-calendar!!description}} class=<<tv-config-toolbar-class>> actions=<<addToCalendarActions>> >
	<%if [<tv-config-toolbar-icons>match[yes]] %>
		{{$:/Notestreams/images/calendar|1em|G}}
	<%endif%>
	<%if [<tv-config-toolbar-text>match[yes]] %>
		<span class=tc-btn-text>Add to calendar</span>
	<%endif%>
</$button> 
<br> {{!!text}}  <br> <$reveal type="match" state="!!datepicker-visible" text="yes">
{{||$:/Notestreams/datepicker}}
</$reveal>
</$list>

In the above snippet, you can see that my notes and TODO items are capable of remaining simple and not get bogged down with too much formatting, and get processed contextually through the streams viewtemplate.

I feel as if this is only really the tip of the iceberg and much more complexity could be added to it.

There are mainly two features I would like to have and that could be implemented by viewtemplates:

  • checkboxes for Taskstreams.
  • renamed nodes where the Title is displayed and the text can be folded. If I think of streams as an outliner this would be very practical, because the topics/nodes then could be edited and used in a more flexible way.

I already made a template that can do the latter, the only reason that kept me from using this more intensely is that it is not compatible with @fastfreddy’s fusion-plugin.

A concept for fusioning streams to tiddlers in the official distribution would be great. In such a concept, there should be a special way to merge in these tiddlers with custom names with a macro that keeps the them as individual tiddlers.

1 Like
  • renamed nodes where the Title is displayed and the text can be folded. If I think of streams as an outliner this would be very practical, because the topics/nodes then could be edited and used in a more flexible way.

I am very happy with this suggestion Streams plugin: how to add a custom new node template? - #19 by etardiff which lets me use Streams as outliner, if the very first line of nodes get treated as titles. Only the first line of streams nodes is displayed, for multiline nodes and the rest is collapsed.

1 Like

Could you post an image of how this looks in the Wiki or even better - a demo?

If I understand what you are saying, this would certainly be helpful.

Not always, but quite often I have the first tiddler in the stream representing a title or a headline, with tiddlers underneath it. It is a bit frustrating having so many unnecessary tiddlers that just represent a headline

Though I have tried to work around it philosophically, and organize my thoughts differently, I nonetheless find that I wish there were some “functional” nodes which did not actually represent tiddlers but, rather, represented relationships or headlines

vivaldi_gYtYRX4PCW

1 Like

I use Streams as task manager.

To mark a task

task

as done, I just rename it to either

[v] task

or

&#x2705; task

if I want it to look fancy.

Do you want something different in the quote above?

1 Like

There is something about the Transclusion of streams feature that I struggle with philosophically –

– it seems counterintuitive to the idea of streams nodes that they should be transcluded in such a way that they cannot flow easily back to the source of that tiddler or, (better yet), all of the original tiddlers links, or, (conceptually difficult for me to imagine), be entangled i.e., being one node that somehow exists in both states at once

(no need to have them collapse if a measurement is actually taken, perhaps?)

1 Like

Perhaps, to clarify – I would like to use the shift-drag feature to transclude more often:

However, it regularly irks me that dragging to transclude does not contain any reference to the stream-children of the transcluded. I suppose I could manually transclude all the children into their own nodes too, but that becomes less helpful quickly.

1 Like

I wanted to have a real checkbox - that checks within the tiddler itself…and thus allows to filter for done and undone tasks.
Perhaps streams could have a mechanism where a tiddlers where the text starts with certain strings like your [v] get a special view-template. @saqimtiaz Would that be possible?
Would it even be possible to have this configurable like in the template-cascade?

At the moment filter cascades are relatively “heavy weight” in terms of performance. So if they need to be calculated very often as with an outliner like streams, there may be a performance hit.

@JanJo, is what you’re describing different than what I’ve achieved by modifying the stream-row-body? Or are you asking for basically the same functionality but with a more user friendly setup?

The custom viewtemplates I’ve set up using the stream-row-body do not suffer from this on any of my devices, even if I am rapidly changing them while working.

This would be possible, I experimented with it some, but ultimately decided, and encourage, to go with tags rather than text – reason being, tags are relatively simple to add, remove, modify, whereas doing the same to the content of the text field is doable (especially with commander) but has less flexibility imo.

Sorry if I was blind. Is there a demo to test it?

No apologies, sorry if I was less than helpful – did this example look like the sort of thing you’re going for (right clicking and selecting todo) to change the template?

If so I can work up a demo or just show my work – it’s a fairly straightforward of the stream-row-body

1 Like

I must have had tomatoes on my eyes. This is great. But with demo, I meant a wiki to play with, the movie is to fast to grasp all the features. Did you implement @fastfreddy’s Fusion-Tools ? To my mind they are very important.
It is good you used the bullet to display the menu, the link to the tiddler is rather distracting.

I’m glad you think so, when you described to @vuk what you were going for I thought it sounded like a match.

I have used Fusion, but (I believe I saw you mention this recently), it is only really helpful for me if it preserves both the streams (outline-view) and also the fused version. I agree wholeheartedly (and think @saqimtiaz is on the same page with this) that better compatibility between Streams and Fusion would a big plus.

Perhaps it’s time for me to put this together, since it’s come up more than once – but previous conversations did not leave me with the impression that my thinking was too out-of-the-norm on this, so let me give you a quick overview (better structure and a formal demo of this would be good features for a rewrite):

$:/plugins/sq/streams/templates/stream-row-body controls the way that the nodes are rendered. This is extremely simple to set up conditional logic in. For example:

<$list filter="[all[current]!tag[Idea]!tag[Index]!tag[Praxis]!tag[Health]!tag[Source]!tag[Place]!tag[Journal]!tag[character]!tag[setting]!tag[reaction]!tag[description]!tag[element]!tag[concept]!tag[TODO]!tag[Notes]]">
  <$list filter="[all[current]!tag[Incomplete]]">
    <$transclude mode="block"/>
  </$list>
  <$list filter="[all[current]tag[Incomplete]]">
    <div style="color: red;">
      <p>{{!!text}}</p>
    </div>
  </$list>
</$list>

Above you see a very basic conditional statement from my stream-row-body which makes all items tagged Incomplete appear in red.

My Todo logic looks quite a bit more complicated, but I promise that’s illusory – you can see that it includes the logic for creating the checkbox:

<$list filter="[all[current]tag[TODO]]">
<span style="display: inline-flex; align-items: center;">
<$checkbox tag="done"/>
[[TODO|$:/TODO]] &nbsp;&nbsp;
<$button actions="<$action-setfield $field='datepicker-visible' $value={{{ [{!!datepicker-visible}match[yes]then[no]else[yes]] }}}/>" class="tc-btn-invisible" tooltip="Toggle Datepicker">
{{$:/core/images/down-arrow}}
</$button>
</span>
&nbsp;&nbsp; <$button tooltip={{$:/wilk/buttons/add-to-calendar!!description}} class=<<tv-config-toolbar-class>> actions=<<addToCalendarActions>> >
	<%if [<tv-config-toolbar-icons>match[yes]] %>
		{{$:/Notestreams/images/calendar|1em|G}}
	<%endif%>
	<%if [<tv-config-toolbar-text>match[yes]] %>
		<span class=tc-btn-text>Add to calendar</span>
	<%endif%>
</$button> 
<br> {{!!text}}  <br> <$reveal type="match" state="!!datepicker-visible" text="yes">
{{||$:/Notestreams/datepicker}}
</$reveal>
</$list>

$:/plugins/sq/streams/contextmenu/contextmenu-template is the relevant tiddler for the context menu: @saqimtiaz has a tagging system which allows you to add items to the context menu, but it does not allow for the contextual conditional statements which I have added to mine:

\define common-menu-items()
            <$macrocall $name="menu-item" title="Open" actions="""<$action-navigate/>"""/>
            <$macrocall $name="menu-item" title="Rename" subtitle="((streams-rename))" actions=<<rename-node-actions>>/>
            <$macrocall $name="menu-item" title="Add Description" subtitle="((add-description-actions))" actions=<<add-description-actions>>/>
						<$macrocall $name="menu-item" title="Mark as Stub" subtitle="((mark-stub))" actions=<<addStubTag>>/>
						<$macrocall $name="menu-item" title="Copy Title" subtitle="((copy-link))" actions="""<<copy-link>>/>"""/>
						<$macrocall $name="menu-item" title="Create Reference" subtitle="((create-link))" actions="""<<add-new-link>>/>"""/>
						<$macrocall $name="menu-item" title="Transclude as Note" subtitle="((transclude-config))" actions="""<<transcludeAsNote>>/>"""/>
            <$macrocall $name="menu-item" title="Delete" subtitle="((streams-delete))" actions=<<delete-node-actions>>/>
						<$macrocall $name="menu-item" title="Add to Daily Notes" subtitle="((transclude-tiddler))" actions=<<create-transclusion-and-append-to-daily-journal>>/>
						<$macrocall $name="menu-item" title="Edit Content" subtitle="" actions="""<<clarify-content-streams>>"""/>
						<$macrocall $name="menu-item" title="Yadda-yadda" subtitle="((yadda-yadda))" actions="""<<yadda-yadda-streams>>"""/>
						<$macrocall $name="menu-item" title="send to calendar" subtitle="" actions="""<<.addToCalendarActions>>"""/>
<$macrocall $name="menu-item" title="Cut from Stream"  subtitle="" actions="""<<copyTitleAndRemoveFromStream>>"""/>
<$macrocall $name="menu-item" title="Add to Stream"  subtitle="" actions="""<<add-to-streamlist>>"""/>
						\end

Here you can see the modifications to the common context menu items I’ve made

  <$list filter="[<currentTiddler>tag[Idea]]" variable="ideaCheck">
            <$macrocall $name="menu-item" title="Create Topic" subtitle="((create-topic))" actions=<<create-topic-actions>>/>
            <$macrocall $name="menu-item" title="Remove Idea Tag" subtitle="((remove-idea-tag))" actions=<<removeIdeaTag>>/>
            <$macrocall $name="menu-item" title="Adopt Index" subtitle="((adopt-index))" actions=<<adopt-index-actions>>/>
            <$macrocall $name="menu-item" title="Add Description" subtitle="((add-description))" actions=<<add-description-actions>>/>
            <$macrocall $name="menu-item" title="Recaption" subtitle="((recaption))" actions=<<recaption-actions>>/>
            <$macrocall $name="menu-item" title="Add Alias" subtitle="((add-alias))" actions=<<add-alias-actions>>/>
						<$macrocall $name="menu-item" title="Upgrade to Index" subtitle="((mark-index))" actions=<<mark-index-actions>>/>
            <<common-menu-items>>
        </$list>

And above you can see an example of a conditional filter I’ve applied which creates a custom menu for tiddlers tagged Idea (note the inclusion of <<common-menu-items>>)

I think my version is very sloppy atm and is overdue for some cleanup. If I can make some time this week, I’ll do that and put together a demo so we can get a better grasp on the potential of this as a long term feature.

2 Likes