Ticket #699 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 2 years ago

Enhancement to store.filterTiddlers() to support more complex filter strings

Reported by: jayfresh Owned by: jayfresh
Priority: undefined Milestone: 2011.cleanup
Component: core Version:
Severity: undefined Keywords: filterTiddlers core
Cc:

Description

Overrides ticket #454:  http://trac.tiddlywiki.org/ticket/454

This patch extends TiddlyWiki.prototype.filterTiddlers to support complex filter strings, where filter string are of the form:

filterStep | filterStep | ... // only one filterStep is required

where filterStep is of the form:

[filterElements]

where filterElements is one or more of the following:

[TiddlerName?] tag[TagName?] sort[SortField?] limit[NoOfResults?]

Attachments

ticket699.patch Download (6.5 KB) - added by jayfresh 5 years ago.
Patch for ticket #699

Change History

Changed 5 years ago by jayfresh

Patch for ticket #699

  Changed 5 years ago by jayfresh

  • owner changed from JeremyRuston to jayfresh

  Changed 5 years ago by jayfresh

This is a suite of JSSpec tests for the patch:  http://jnthnlstr.googlepages.com/testFilterTiddlersCore.html

This is a TiddlyWiki that contains the same test tiddlers as the testing suite, but allows you to try the patch out in situ:  http://jnthnlstr.googlepages.com/FilterTiddlersCore.html

NB: We made a choice of "|" as the character to separate filter steps. Anyone with a better idea for the character is welcome to suggest it.

  Changed 5 years ago by jayfresh

  • status changed from new to assigned

  Changed 4 years ago by JeremyRuston

  • milestone set to 2.6

  Changed 3 years ago by jdlrobson

What is the current status of this ticket? It is much needed. [tag[a]tag[b]] would provide all tiddlers tagged with a and tagged with b [tag[a]] [tag[b]] would provided all tiddlers tagged with a or b.

follow-up: ↓ 7   Changed 3 years ago by MartinBudden

This is a large piece of code. My view is that it should remain a plugin, especially since the syntax is different to TiddlyWeb filter syntax.

On the other hand you say "It is much needed" - can you say why?

in reply to: ↑ 6   Changed 3 years ago by jdlrobson

Replying to MartinBudden:

This is a large piece of code. My view is that it should remain a plugin, especially since the syntax is different to TiddlyWeb filter syntax. On the other hand you say "It is much needed" - can you say why?

I find myself using the heavy forEachTiddler plugin and writing custom code for tasks which I feel should be in the tiddlywiki core.

I can't use the list macro in TiddlyWeb as it the filter syntax is only half done and doesn't support basics such as accepting fields.

For instance I should be able to do <<list filter [server.bag[mybag]]>> but can't and should be able to do <<list filter [tag[foo]tag[bar]]>> Even if the resulting code is slightly unreadable or some people find the above syntax unreadable, it seems we need to provide a solution for these sorts of filters even if it is not perfect.

  Changed 3 years ago by FND

While those are valid use cases, they don't make a goo case for why this functionality should be in the core.

Having said that, I do agree that the core's filters are half-baked.

  Changed 3 years ago by MartinBudden

  • milestone changed from 2.6.2 to 2.7.1

Milestone 2.6.2 deleted

  Changed 2 years ago by cdent

  • status changed from assigned to closed
  • resolution set to wontfix
  • milestone changed from 2.7.1 to 2011.cleanup

There seems to be lack of specificity on what needs to happen with filters and a couple of different implementations, all old.

So this seems a candidate for "try again later"

Note: See TracTickets for help on using tickets.