[tw5] sort:version:reverse?

I have change logs with a field for version information, and I am trying to sort them in reverse order and it doesn’t appear to be working. The change log tiddlers themselves are also lists, but I cleared all that out and loaded these into the latest TW version to make a minimal reproducible case. If I take out the sort entirely, the 10.0 comes to the top as you would expect for them to be sorted by title. But the sort either with or without :reverse is the same.
Screenshot 2024-04-16 112417.png

    <$list filter="[ascend.change[index]] :sort:version:reverse[get[ascend.version]]">
  • <$link to={{!!title}} />
    <$transclude/>

What am I doing wrong?

Hello Cade! As you might note with other posts at google groups, the community for this discussion has migrated to talk.tiddlywiki.org.

Although we (at that forum) can still see posts from the google group, we can’t reply easily to them.

So please come on over to talk.tiddlywiki.org

Meanwhile, I can suggest that the documentation on the reverse Operator shows that it … works at the “caboose” end of any filter to flip the list order. Something like this works at Tiddlywiki.com:

{{{ [has[version]] :sort:version[get[version]] +[reverse[]] }}}

(Note, the version field of tiddlers at the tiddlywiki.com currently holds no value other than 5.3.3 — but you can test the filter by adding a version field — with various fake values — to arbitrary tiddlers, and seeing how the list includes and sorts according to those version values.)

Of course, I meant “come on over from google groups, and join us at talk.tiddlywiki.org

I see, I can use that separate reverse operator instead of doing it in the initial sort.

I’m still not sure how to use the reverse documented here in the flaglist in the :sort filter run prefix:

https://tiddlywiki.com/#Sort%20Filter%20Run%20Prefix

I’ll post any future questions in the other forums.

Thanks,

Cade

Interesting! The documentation DOES imply that you can tuck :reverse into the very place where you had it (after :sort:version)!

Perhaps this is just an error in documentation? It turns out that the reversal works fine if :reverse comes before the sort-type parameter (:version):

{{{ [has[version]] :sort:reverse:version[get[version]] }}}

I’m not in a position to know whether this is just a documentation problem, or whether there could be reasons to see this as an actual bug, where the code needs to work the way the documentation expects it to.

Let me flag a couple folks who would know how to get to the bottom of this: @pmario @saqimtiaz

I’m not 100% sure yet, but there seems to be a bug. I’ll have a closer look.

A fast look to the code suggests, that the documentation is right.

But I can confirm, that it does not work as intended with my test tiddlers.

-m

I did create an GH issue: [BUG] The :reverse suffix used with the :sort filter run prefix and type :version does not work · Issue #8153 · Jermolene/TiddlyWiki5 · GitHub

2 Likes