The "architype filters" collection

Folks as a result of a discussion in GitHub [IDEA] TiddlyWiki filter visualizer/helper tool #5058, I raised the idea of “filter architypes”. Basically pre-coded filters you can use with the filter or subfilter operators. This Topic is to call on feedback and contributions.

  • A key long term outcome is to build a tool that allows you or your wiki users to interactively build filters from a set of “filter architypes”.

Filter architypes have the following advantages;

  • Design once and share many times between you own wikis and others
    • This is a way to accrue experience in the community, peer review and publish the results.
  • Collapse the details into named macros to use as filters makes writing more complex filters simpler
  • Work with a de facto standard that overtime becomes familiar and easier to use, “remember rather than lookup”.
  • And inspired by the [IDEA] TiddlyWiki filter visualizer/helper tool #5058 it may prove a lot easier to make a tool for building complex filters with a GUI from the “architype filters”.
  • Even if you do not use shared “architype filters” you may very well use and learn from the methods used for them.

Here is a preliminary example based on todo and project tags like in the projectify plugin

\define active-filter() [!tag[done]!tag[archive]]
\define inactive-filter()  [tag[done]] [tag[archive]] +[limit[1]]
\define active-todo() [tag[todo]filter<active-filter>]
\define active-project() [tag[Project]filter<active-filter>]
\define inactive-todo() [tag[todo]filter<inactive-filter>]
\define inactive-project() [tag[Project]filter<inactive-filter>]
\define created-today() [days:created[0]]
\define modified-today() [days:modified[0]]
\define due-today() [days:due[0]]
\define due-before() [days:due[-10000]]
\define no-due-date() [!has[due]]

For example (untested just now)

"[subfilter<active-todo>]" replaces "[tag[todo]!tag[done]!tag[archive]]"
or
"[subfilter<active-todo>] +[subfilter<created-today>]" (longer but simpler) replaces

  • "[tag[todo]!tag[done]!tag[archive]days:created[0]]"

So I invite the experience and naïve to comment on this topic with a review to developing this further

Things to consider for inspiration (optional reading)

  • How to you distinguish between tiddlers of different types?
  • What kinds of status do you like to assign to tiddlers
  • What domains and subdomains do you use to organise tiddlers
    • Personal/work… Project/subProject Book/chapter
  • What determines the context of a tiddler?
    • Eg If I create a task in a project the context is the current project and assigned to the new task
  • What are your key organising approaches tags, categories, subjects, lists, sets…
  • In future we will be in a position to build our own “filter Operators” which could allow these to systematised, simplified and/or given aliases. eg list-todos[]may get all active todo items.

I look forward to your ideas and experience.

1 Like

Very interesting!
Filters is one the area most questions arises in the forum!

1 Like

Instead of using macros to define the “archetype filters”, consider using the TWCore’s existing “saved filter” mechanism, where each filter is a separate tiddler with the following fields:

  • tags = $:/tags/Filter
  • description = filter name (e.g., “Active ToDo”)
  • filter = filter syntax (e.g., [tag[todo]!tag[done]!tag[archive]])

One advantage of this approach is that each saved filter tiddler will automatically appear in the $:/AdvancedSearch > Filter tab’s drop-down list, making it easy to select and apply any saved filter.

In addition, you can still combine definitions as you have shown in your example macros. For instance, the “active todo” filter could be defined using something like [tag[todo]filter{ActiveFilter!!filter}]

Also note that my TiddlyTools PowerSearch interface uses this approach, so that any filters constructed and saved with that interface automatically appear in the $:/AdvancedSearch > Filter tab dropdown.

ref: https://tiddlytools.com/filtergenerators.html#TiddlyTools%2FFilterGenerators%2FPowerSearch

-e

2 Likes

Eric, I totally agree with you here, though right now I hope we can extract what the filters will be in a generic way. Ideally we can build sets of “archetype filters” that match with common usage. Perhaps even a click to add to “global filters”. Keep in mind not all “archetype filters” will be suitable as stand alone filters.

  • I expect given your Timertools you would be in a good position in relation to time and date filters.
    • This week, next week, older than a week etc… but generalised as much as possible.

Another class of filters to be considered are those relating to change,

  • How to change a tiddlers status depending on its current status.
  • Display filters, display when a condition is true such as it has a particular status.

Can these be designed as filters that drive change through actions?

  • So we need not code actions just pass filters to a prepared set of actions that achieve what we ask.

I would add here to create “architype filters” we can make use of other architypes or metaphors that people are familiar with such as for status the “traffic light” analogy. “Red Yellow and Green” or consider green is new yellow is in progress red has stopped, or has it finished?

  • Architype filters can be toggles or cycles,
  • The 5.2.3 updates to the checkbox widget also allows more sophisticated checkbox driven logic
    • using checkboxes is helpful because it encodes the set/unset reveal and hide you would otherwise have to do with buttons. The listField version also supports the equivalent of list ops against a list field.