Is it possible to step by step build and save a filter into the text field of a state tiddler using select widget

Is it possible to step by step build and save a filter into the text field of a state tiddler using select widget.
Filter will have multiple operator and parameters. Separate select widgets can be used for operators and parameters of the each step of the filter . Opening and closing brackets needs to be added.

Here is a early test version - https://demo-hub.tiddlyhost.com/#filter-builder

Of possible use: ways to insert square brackets in filters

1 Like

Thanks for sharing it. There are a few similar post in the forum. Let me read through them and experiment.

One small doubt.
Suppose I have two select widgets which is used to add data to the text field of the same tiddler…is there any way I can add the data using the second select widget without overwriting the data added previously by the first select widget.

I’d say this is used in some of the editor tools, for example the stamp tool. I think it is a matter of having a filter take the current content and dominantly append the new stuff and then set the field to this new value.

1 Like

First, some other filter-builders I’ve come across, if you’d like to see how other developers have approached it:

Re: your specific question: You can use the actions attribute of a $select widget to modify a separate field (or tiddler). For instance, you could define an $action-setfield widget to modify/append your selection(s) to the existing filter, as Mat suggests.

In theory, I suppose you could use actions on a $select to further modify the field where it stores its selection, but I really wouldn’t recommend it.

  • Any changes to the field defined by the $select field= attribute will remove the record of your last selection, and this will make it difficult to replace or remove a specific piece of the composite filter.
  • I think you’d also be likely to encounter the ever-growing filter problem we discussed yesterday.

I have updated the demo with another version which save the operators and parameters of the filter steps into fields first using select widget and then into the text field using another button.

I have checked the tiddlytools and xp versions before, but those are huge codes and may not suit mine…

Can you tell me when to use subfilter operator and filter run prefixes. I haven’t used those much and is confused when to use them.

I’m asking tw-xp’s author publish filter builder as a smaller plugin 希望 $:/FilterBuilder 能发布为独立插件 · Issue #21 · keatonlao/tiddlywiki-xp · GitHub

I also want an Evernote style story river with visual built filter.

1 Like

This is intriguing… You mean, instead of a story river displaying a simple list, we have a “filter river” that automatically shows tiddlers (full tiddlers, with all their view template cascade etc.) matching the filter condition specified (in a sidebar or menubar, etc.).

I’m intrigued by this idea. Still, there might be different ideas about how to handle links that point to a tiddler outside the filter condition. Should filter condition update (to include the new tiddler as an add-on at the end)? Or should the extra tiddler get a different status (above filter river, or below it, etc, or perhaps it opens only in a pop-up/hover state). I think there’s lots of room for variation and creativity in how a river of tiddlers might reflect a special and dynamic relation to a filter…

This reminds me of a plugin for TW Classic, from over 10 years ago, maybe 15. If I recall, the idea was to select/check one tag at a time to gradually narrow down search results in a list. There was a lot of community hype around it as it was being built by someone in the community. Unfortunately I cannot recall the name of the plugin nor of the creator. Any other old timers here who remember?

Rethink this tonight, I decided that filter should happened inside a tiddler with a sub-storyriver. So the search result is contained in a temp tiddler with tw-xp style filter builder on top, sub-river on body…

And the main river is still the standard way. So you can quick create new tiddler to add to it. Just like fsnotes.

I have created storyriver inspired by card like ui of heptabase with a filter builder at the top to modify the tiddlers opened in the storyriver. There are buttons and keyboard shortcuts to modify the width and height of the card tiddlers.

3 Likes

Cool, what filter builder plugin are you using, and what is the plugin name on CPL?

BTW, There isn’t much layout plugin on CPL, this is a pity because layout feature is one of the key advantage of TW compare to Obsidian and Notion.

It’s not a plug in…a filter builder tiddler with abovestory tag based on a similar work by @jonnie45